Image methods Image file
Palette order
Palette-order steganography was popularised in 1998 by Matthew Kwan’s Gifshuffle program, for GIF images. It applies identically to indexed PNGs. What sets it apart: the message touches neither the pixels nor the colours, only the order in which the file lists them.
How does palette steganography work?
An indexed PNG does not store one colour per pixel. It holds a palette of at most 256 colours, and each pixel is a number pointing to one of them.
Palette 0 → (255, 0, 0) 1 → (0, 0, 255)
Pixels 0 0 1 0 red red blue red
Palette 0 → (0, 0, 255) 1 → (255, 0, 0)
Pixels 1 1 0 1 red red blue red ← same image Swap two colours in the palette, renumber the pixels, and you get a different file that displays exactly the same image. The palette order is therefore free space.
256 colours can be arranged in 256! ways (a 507-digit number), about 1,684 bits. The message is read as one very large number, and that number designates a permutation:
- sort the colours in a reference order (by value);
- divide the number by 256: the remainder picks the first colour to place; then by 255 for the next, and so on (the factorial number system);
- to read, compare the order found in the file with the reference order and rebuild the number.
What does the image look like?
The original reduced to 256 colours: flat areas and banding in a photo’s gradients, no difference on a logo or drawing. That reduction is the format’s entry fee, not the message’s trace: with or without a message, the displayed image is the same pixel for pixel.
What are the weaknesses of palette order?
Strengths
- No pixel depends on the message: comparing the image with the original shows nothing.
- File size unchanged, whatever the message.
- Pixel statistics are blind: there is nothing to measure in the image.
Weaknesses
- Fixed, small capacity: 208 bytes, whether the image has 100 pixels or 10 million.
- A shuffled palette is suspicious: software normally orders colours by frequency, brightness or first appearance. A random-looking order flags the manipulation.
- Fragile: any re-save reorders the palette, or converts the image to true colour, and wipes the message.
- Forces the indexed format, ill-suited to photos.
How can a message in the palette be detected?
By looking at the palette itself, with an image editor or a tool such as pngcheck -p. A sorted palette, or one ordered by frequency of use, is normal; a palette with no logic at all is not. Reading the message then requires knowing the reference order, here a plain sort by value.
What variants of palette steganography exist?
- Gifshuffle — the original, on GIF, with compression and encryption of the message before encoding.
- LSB on indices — altering the last bit of each pixel’s colour number, after sorting the palette so that neighbouring numbers are neighbouring colours (the EzStego method).
- Duplicate colours — a palette holding the same colour twice lets you choose either number, pixel by pixel.
- PNG private chunk — another hiding place in the file structure, roomier but more visible.
In CipherChronicle
The workshop encodes the image itself as a 256-colour indexed PNG, then orders its palette according to the message: the method must therefore come before other file methods in a chain. Text is limited to 208 bytes. The file produced is uncompressed and weighs about one byte per pixel. For decryption, drop the file exactly as it is.