Developed as part of the AI Vicharana Shala programme at IIT Ropar (CSE Dept. × iHub-AWaDH)
Overview · Techniques · Demo · Setup · How It Works · Use Cases
Steganography is the art of hiding information inside other data so that its very existence is secret — unlike encryption, which hides the content, steganography hides the fact that a message exists at all. This project implements three distinct steganography techniques in Python:
| Technique | Cover Medium | Method | Detection Resistance |
|---|---|---|---|
| Image | PNG / BMP | LSB (Least Significant Bit) | High — no visible change |
| Audio | WAV | LSB in audio samples | High — inaudible |
| Emoji | Unicode text | Zero-width characters | Very high — invisible |
Original image → image with hidden message embedded
| Original | With hidden message |
|---|---|
![]() |
![]() |
The two images are visually identical. The difference exists only at the binary level (LSB of pixel values).
Decoded output — message successfully extracted:
Original pixel: [10110110] [11001010] [10101011]
R G B
Secret bit: 1 0 1
Modified pixel: [10110111] [11001010] [10101011]
↑ ↑
bit flipped bit flipped
(imperceptible change of 1/255 in brightness)
- Embeds 1 bit per colour channel (RGB) per pixel
- 3 megapixel image = ~1.1 MB of hidden data capacity
- Uses OpenCV to read/write pixel values
- Extraction reverses the process — reads LSB of each channel
Audio sample (16-bit): 1001101010110110
Secret bit: 1
Modified sample: 1001101010110111
↑
last bit changed
(change = 1/65536 of full scale — completely inaudible)
- Embeds 1 bit per audio sample using Python's
wavemodule - Human hearing threshold: changes below ~0.003% amplitude are inaudible
- LSB modification = 0.0015% change — well below detection threshold
- Works on uncompressed WAV files
Visible text: "Hello!"
Hidden message: "secret"
Encoded: "Hello!..."
↑↑↑↑↑↑↑↑
Zero-width characters invisible to human eye
but present in Unicode string
- Maps each character to a sequence of zero-width Unicode characters
\u200b(Zero Width Space) = binary 0\u200c(Zero Width Non-Joiner) = binary 1
- Hidden message is completely invisible in any text display
- Useful for watermarking text documents
pip install opencv-python numpy emojiFull dependencies:
opencv-python>=4.5.0
numpy>=1.21.0
emoji>=2.0.0
Note: Audio steganography uses Python's built-in
wavemodule — no additional install needed.
git clone https://github.com/imAryanSingh/Steganography.git
cd Steganography
pip install opencv-python numpy emoji
python Steganography.py# ENCODE: hide message in image
python Steganography.py
# Select option 1 (Image Steganography)
# Enter: input image path, secret message, output image path
# DECODE: extract message from image
# Select option 1 → decode
# Enter: encoded image path
# Output: original secret message# ENCODE: hide message in audio
# Select option 2 (Audio Steganography)
# Enter: input WAV file, secret message, output WAV file
# DECODE: extract from audio
# Select option 2 → decode
# Enter: encoded WAV file
# Output: original secret message# ENCODE: hide message in text using emojis/zero-width chars
# Select option 3 (Emoji Steganography)
# Enter: cover text, secret message
# DECODE: extract from emoji text
# Select option 3 → decode
# Enter: encoded text
# Output: original secret messageSteganography.py
│
├── ImageSteganography class
│ ├── encode(image_path, message, output_path)
│ │ → reads pixels → embeds bits → saves new image
│ └── decode(image_path)
│ → reads pixels → extracts LSBs → reconstructs message
│
├── AudioSteganography class
│ ├── encode(audio_path, message, output_path)
│ │ → reads WAV samples → embeds bits → writes new WAV
│ └── decode(audio_path)
│ → reads WAV samples → extracts LSBs → reconstructs message
│
└── EmojiSteganography class
├── encode(cover_text, secret_message)
│ → converts chars to binary → inserts zero-width chars
└── decode(encoded_text)
→ extracts zero-width chars → converts binary → message
How much data can you hide?
| Cover Medium | File Size | Hidden Capacity |
|---|---|---|
| 1MP image (PNG) | ~3 MB | ~375 KB of text |
| 5MP image (PNG) | ~15 MB | ~1.87 MB of text |
| 1 min WAV (CD quality) | ~10 MB | ~1.25 MB |
| 5 min WAV | ~50 MB | ~6.25 MB |
| Application | Technique | Why |
|---|---|---|
| Digital watermarking | Image LSB | Embed copyright info invisibly |
| Covert communication | Any | Message existence is deniable |
| Document authentication | Emoji/text | Hidden integrity check |
| CTF / security challenges | All three | Classic steganography puzzle |
| Research in ML-based steganalysis | Image | Generate training data |
LSB steganography is a basic technique — it can be detected by statistical analysis (steganalysis tools like StegExpose). This project is educational and demonstrates the core principles. Production-grade steganography uses more sophisticated approaches (DCT domain embedding, adaptive bit allocation, deep learning-based methods).
| Library | Purpose |
|---|---|
| OpenCV | Image read/write, pixel manipulation |
| NumPy | Array operations on pixel/sample data |
| wave (stdlib) | WAV audio file read/write |
| emoji | Emoji character lookup and encoding |
Aryan Singh — AI/ML Engineer
Developed during the AI Vicharana Shala residential programme at IIT Ropar (May–Jul 2024)
- Wake-Word Detection for ISRO TRISHNA Satellite — CNN + MFCC, built at ISRO SAC Ahmedabad
- Recommendation System for Retail Stores — Collaborative filtering, IIT Ropar
- Smart Vision Quality Control — Top 0.3% Flipkart GRID 6.0


