This project implements Least Significant Bit (LSB) Steganography using Python. It allows you to hide and extract secret messages within image filesβparticularly PNG imagesβby manipulating the least significant bits of the pixels, a method undetectable to the naked eye.
Steganography comes from the Greek words:
- Steganos β "Covered"
- Graphie β "Writing"
It is the practice of concealing messages within other non-secret, ordinary files (like images, audio, or video), so that only the intended recipient knows of the messageβs existence.
In LSB steganography, the last bit (or bits) of a byte in an imageβs pixel data are altered to encode the hidden message. This is effective because the change is minor enough to not visibly affect the image.
For example, in an 8-bit grayscale image:
- Each pixel = 8 bits.
- Changing the last bit alters the pixel value by at most 1βvisually undetectable.
Suppose we want to hide the letter "A" (ASCII: 10000001) into the following grayscale pixel data:
Original pixels (in binary):
11110011
11011011
10110110
11011100
11011111
11010111
00100110
01000011
After hiding "A":
Modified pixels:
11110011
11011010
10110110
11011100
11011110
11010110
00100110
01000011
- πΌοΈ Hide messages in grayscale or RGB PNG images.
- π Optional password protection.
- π Steganalysis notes included.
Run the stego script with the appropriate flags:
./stego -f <filename.png> -e "<secret_message>" -p <password (optional)>./stego -f <secretfile.png> -x -p <password>-p flag is still required during extraction.
While this project focuses on Image Steganography, here are the broad categories:
- π· Image Steganography
- π§ Audio Steganography
- ποΈ Video Steganography
- π Text Steganography
- π¦ Black & White
- βͺ Grayscale (8 bits per pixel)
- π RGB (24 bits per pixel)
In RGB images, each pixel contains three components (Red, Green, Blue), and LSB manipulation can occur in any or all of them.
Steganalysis is the art of detecting hidden messages in stego media.
- π Histogram Analysis can help detect LSB manipulation.
- β Lossy Compression (like JPEG) can destroy hidden data.
- β Always use lossless formats (like PNG) for LSB-based techniques.
stego.pyβ Main Python script for LSB embedding and extraction.README.mdβ This file.