Tools · Machines and secret writing
Image steganography (LSB)
Hide text in the least significant bits of a PNG and get it back; view an image’s bit planes.
Runs in your browser. Your text goes nowhere.
How to use it
Drop an image onto the frame. On the left you see the picture itself; on the right, one bit plane: for every pixel one bit of one channel is taken, a 1 drawn white and a 0 black. Pick the channel and the bit above the pictures, or use “Every plane at once” to see all 24 together, from the highest bits to the lowest. Hover over the picture and the pixel’s values appear underneath in binary, with the chosen bit marked.
The Extract block first looks for a message hidden by this tool. If there is none, it shows what sits in the chosen bit, in a row, packed into bytes. Meaningful words at the start are almost certainly a message; a line of dots is noise.
The Hide block offers two ways. Text goes into the lowest bits of the red, green and blue channels in order, from the start of the picture, and the tool tells you in advance how many bytes fit. A word-as-picture is drawn straight into the chosen plane and shows up only there. Save the result with Download PNG.
How it works
A pixel’s colour is three numbers from 0 to 255. The lowest bit changes a number by one: 200 becomes 201. The eye can’t see that. So the low bits of a photograph are close to pure noise, where sensor grain and smoothing settle. Put something of your own there and the picture looks just the same.
Text is turned into UTF-8 bytes. A marker, “CK”, and a four-byte length go in front, so the reader knows where to stop. Bits are written one (or two) per channel: R, G, B of the first pixel, then the second, and so on. Alpha is left alone. A 1000 × 1000 picture at one bit per channel holds almost 375,000 bytes.
Such a picture gives itself away to statistics rather than to the eye. Writing random bits evens out pairs of values like 200 and 201, and a χ² test catches that (Westfeld and Pfitzmann, 1999). A picture drawn into a plane, on the other hand, shows at once — which is the whole point of the puzzles built on it.
Questions
Why PNG and not JPEG?
PNG keeps pixels exactly. JPEG recomputes them when it compresses, and the low bits get scrambled. Messengers and social networks recompress images too, so send the PNG as a file, not as a photo.
Is this encryption?
No. Steganography hides the fact that there is a message, but anyone who knows the method can read it. If you need both, first encrypt the text with a password, then hide it. More in the steganography lesson.
Is my image uploaded anywhere?
No. Everything runs in your browser and the file stays with you.