Steganography
Hide secret messages inside images by encoding data in the least significant bits of pixel values. The change is invisible to the eye — but the data is there. Encode a message, compare the images, then reveal what's hidden in the bit planes.
What is steganography?
Steganography is the practice of concealing a message within another medium so that the existence of the message itself is secret. Unlike cryptography, which makes a message unreadable, steganography makes it invisible. The word comes from Greek: steganos (covered) and graphein (to write).
A brief history
Herodotus recorded one of the earliest examples: a Greek nobleman shaved a slave's head, tattooed a message on the scalp, waited for the hair to regrow, then sent the slave as a messenger. During WWII, microdots reduced entire pages to the size of a period. Modern digital steganography hides data in image files, audio, video, and even network packet timing.
LSB encoding
The least significant bit of each color channel (R, G, B) can be modified with minimal visible effect — changing a pixel value from 200 to 201 is imperceptible. Each pixel provides 3 bits of storage (one per channel). For a 400×300 image, that is 360,000 bits or roughly 45,000 characters. The bit plane viewer shows each bit layer: the MSB (bit 7) carries most visual information, while the LSB (bit 0) looks like random noise — the perfect place to hide data.
Digital watermarking
A related application is digital watermarking, where ownership information is embedded in media files. Unlike steganography, the goal is not secrecy but proof of origin. Robust watermarks survive compression, cropping, and format conversion. Fragile watermarks detect any tampering.
Detection: steganalysis
LSB steganography is vulnerable to statistical detection. The chi-squared attack measures pairs of values (2k, 2k+1) that become suspiciously equal after embedding. The RS analysis detects regular vs. singular pixel groups. More advanced methods use machine learning classifiers trained on cover and stego images. This is why real-world steganography uses more sophisticated embedding, such as matrix encoding to minimize the number of bit changes.