Image and Audio Steganography
Embedding data in media files.
How Images Store Pixels
To hide data in an image, you first need to know how images store color. A pixel in an RGB image has three channels red, green, blue each typically an 8-bit number from 0 to 255.
So one pixel is three bytes. A small 800x600 image has 480,000 pixels and 1.44 million color bytes. That redundancy is what steganography exploits: there are far more bytes than the eye can scrutinize.
The key insight: the human visual system cannot distinguish a color value of 200 from 201. That imperceptible margin is where hidden data lives.
Least Significant Bit Embedding
LSB embedding replaces the lowest-order bit of each color byte with one bit of the secret. Because the lowest bit only changes a value by 1, the visual change is invisible.
Consider hiding the bit 1 in a red channel value of 200 (binary 11001000). Replacing the last bit with 1 gives 11001001 = 201 a change no human can see.
Across thousands of pixels, you reconstruct the payload by reading those LSBs back in order.
# Embed: keep top 7 bits, set LSB to the secret bit
# value 200 = 1100100 0 -> hide 1 -> 1100100 1 = 201
#
# In Python terms (read-only illustration):
# new_byte = (color_byte & 0xFE) | secret_bit # 0xFE clears the LSBAll lessons in this course
- What Steganography Is
- Image and Audio Steganography
- Detecting Hidden Data (Steganalysis)
- Covert Channels and Exfiltration