Steganography lab · v2
Hide words
in plain sight.
Justeg tucks a message into the lowest bits of an image's pixels. The picture looks the same; the words are there for anyone holding the right key.
- AES-256-GCM optional encryption
- 0 bytes uploaded
- ±1 per channel change
The lab
Pick an image. Leave a trace.
Runs entirely in your browser
How it works
The secret lives in the least significant bit.
- 01
Every pixel is three numbers
Red, green and blue, each stored as 8 bits from 0 to 255. Your eye can't tell 182 from 183.
- 02
The last bit is spare
Justeg overwrites the lowest one or two bits of each channel with bits of your message. Colours shift by at most ±1 or ±3.
- 03
A key decides where
With a passphrase, the message is encrypted first and then scattered across the image in an order only the key can reproduce.
Why nobody notices
A channel's bits are not equal. The top bit is worth 128 steps of brightness, the bottom bit just one. Changing the bottom bit moves the colour by less than 0.4%, well under the smallest difference human vision can pick out, measured below as ΔE in the CIELAB colour space.
| R | 10110111 | 182 → 183 |
|---|---|---|
| G | 01101001 | 104 → 105 |
| B | 11010111 | 214 → 215 |
ΔE 0.37 · below the 2.3 just-noticeable difference. Your eye can't tell them apart.
“J” is byte 74, or 01001010 in binary. Each bit replaces the lowest bit of one colour channel, so it takes eight channels: just under three pixels.
| Pixel | Channel | Before | Message bit | After | Change |
|---|---|---|---|---|---|
| 1 | R | 01110110 | 0 | 01110110 | 0 |
| 1 | G | 10100100 | 1 | 10100101 | +1 |
| 1 | B | 11010100 | 0 | 11010100 | 0 |
| 2 | R | 01111001 | 0 | 01111000 | −1 |
| 2 | G | 10100110 | 1 | 10100111 | +1 |
| 2 | B | 11010101 | 0 | 11010100 | −1 |
| 3 | R | 01110111 | 1 | 01110111 | 0 |
| 3 | G | 10100011 | 0 | 10100010 | −1 |
| 3 | B | 11010010 | – | 11010010 | 0 |
Roughly half the bits already match, so only 5 of 8 channels change, each by one step out of 256. The largest colour difference is ΔE 1.38, 60% of the smallest difference the eye can notice.
What happens when you press Hide
- 01TextAny Unicode, encoded as UTF-8 bytes.
- 02Derive keysPBKDF2-SHA256, 600k rounds, random 16-byte salt.
- 03EncryptAES-256-GCM seals the bytes and adds a tamper tag.
- 04FrameA header records the length so the reader knows where to stop.
- 05OrderSequential from the first pixel, or a keyed Feistel scatter.
- 06Write LSBs1 or 2 bits replace the lowest bits of each R, G and B.
- 07Save losslesslyPNG, or PPM for Netpbm covers. JPEG would wipe the bits.
runs only with a passphrase. Revealing reads the same slots in the same order and runs every step in reverse. With encryption, a wrong passphrase picks the wrong slots and fails the tag check, so it finds nothing rather than garbage.
Plain · written in order from the top-left pixel
The magic bytes let the reader find it, and also let anyone else find it. Hidden, not secret.
Encrypted · salt in order, the rest scattered by the key
No magic bytes and no fixed position: without the passphrase there is nothing fixed to search for.
Invisible, not undetectable
The eye judges a whole colour value; a forensic view can isolate the one bit Justeg changed. The bit plane shows only the lowest bit of every channel, and that is where a message shows itself.
The egg in your browser tab carries a 100-byte plain message. These are its 64×64 pixels before and after Justeg wrote it, rebuilt with the same code the lab uses.
| Pixel 1 | R | G | B | Bit plane |
|---|---|---|---|---|
| Before | 00000111 | 00000110 | 00001011 | |
| After | 00000110 | 00000111 | 00001010 |
rgb(7, 6, 11) → rgb(6, 7, 10) · ΔE 1.00, below the 2.3 just-noticeable difference. In the bit plane the same pixel jumps from magenta to green.
Why the band only shows up in the bit plane
- The bit plane amplifies one step to the full range. It throws away the top seven bits and paints bit 0 as either 0 or 255. A change of 1 out of 255, invisible in the favicon, becomes the largest contrast the screen can show.
- A flat colour has uniform lowest bits. The background is rgb(7, 6, 11) everywhere. Its lowest bits are 1, 0, 1, so the whole plane is one solid magenta.
- Message bits look random. The 100 bytes become 800 bits, one per channel, written in order from the top-left: 267 pixels, just over 4 rows. Where a message bit disagrees with the background's bit, the channel changes. That is 389 of 800 channels, about half, scattered with no pattern, so the uniform magenta breaks into noise.
- Texture hides it, even here. Inside the egg the plane is busy before and after: the gradient already moves neighbouring pixels by a step or two, so its lowest bits are naturally noisy. Bits written there would blend in. That is why photos make better covers than flat graphics, and why a passphrase scatters the message across the whole image instead of leaving a band.
Try it on your own images: open the lab, load a picture and switch to Bit plane. A plain message shows up as a band along the top, while an encrypted one is spread across the whole picture.
Security model
Hidden and sealed.
AES-256-GCM
Authenticated encryption. A wrong passphrase or a single flipped bit is detected, never misread.
PBKDF2 · 600k
Passphrases are stretched with 600,000 rounds of SHA-256 and a random salt per image.
Keyed scatter
A Feistel permutation spreads bits across the whole image, so there is no band to spot.
No signature
Encrypted images carry no magic number. Without the key they look like any other PNG.
Nothing uploaded
Images are decoded, edited and encoded on your device. No server ever sees them.
Honest limits
- Re-saving as JPEG, resizing or posting to most social apps destroys the hidden bits. Share the PNG as a file.
- Statistical steganalysis can still flag that an image was edited, even if it can't read the message.
- Unencrypted mode is hidden, not secret: anyone with Justeg can read it.