Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stegano-Tool

Hide encrypted messages inside images. Uses LSB (Least Significant Bit) steganography to embed data into pixel values, and AES-256 encryption so the hidden content can't be read without the correct password.

The modified image looks identical to the original — pixel changes are too small for the human eye to detect.

How It Works

Original Image ──► LSB Embedding ──► Stego Image (looks the same)
                        ▲
    "secret message" ──► AES-256 Encrypt ──► binary payload
                              ▲
                          password
  1. Your message gets encrypted with AES-256-CBC using your password
  2. The encrypted bytes are converted to bits
  3. Each bit replaces the least significant bit of a pixel's color channel (R, G, or B)
  4. Since only the last bit changes, the color shifts by at most 1 out of 255 — invisible

Features

  • AES-256 encryption — password-protected, not just hidden but also encrypted
  • LSB steganography — modifies only the least significant bit, visually undetectable
  • Capacity check — see how much data an image can hold before encoding
  • Image comparison — compare original vs stego image to verify they look identical
  • Length header — uses a 4-byte header so decoding knows exactly how many bytes to read

Quick Start

git clone https://github.com/Emirzonee/Stegano-Tool.git
cd Stegano-Tool
pip install -r requirements.txt

Hide a message

python stegano.py encode photo.png "this is a secret" --password mypass123

Output: photo_stego.png

Extract a message

python stegano.py decode photo_stego.png --password mypass123
----------------------------------------
  Hidden message:
  this is a secret
----------------------------------------

Wrong password?

python stegano.py decode photo_stego.png --password wrong
[!] Decryption failed. Wrong password?

Check image capacity

python stegano.py capacity photo.png
[*] photo.png can hold approximately 14,989 bytes (14 KB)

Compare original vs modified

python stegano.py compare photo.png photo_stego.png
----------------------------------------
  Image Comparison Results
----------------------------------------
  Resolution:       200x200
  Total pixels:     40,000
  Modified pixels:  164
  Changed:          0.41%
  Max pixel diff:   3 (out of 765)
----------------------------------------
  Verdict: Visually identical — undetectable by eye

Building a Standalone Executable

If you want to share this with someone who doesn't have Python installed:

pip install pyinstaller
pyinstaller --onefile stegano.py

The executable will be in the dist/ folder. They can then run:

stegano.exe encode photo.png "hidden message" --password secret
stegano.exe decode photo_stego.png --password secret

Project Structure

Stegano-Tool/
├── stegano.py          # Main script — encoding, decoding, comparison
├── requirements.txt    # Python dependencies
├── .gitignore
├── LICENSE
└── README.md

Technical Details

  • Encryption: AES-256-CBC with PKCS7 padding. Key is derived from password via SHA-256. Random 16-byte IV per message.
  • Embedding: Sequential LSB replacement across RGB channels. Payload format: [4-byte length][encrypted data][delimiter]
  • Capacity: Each pixel stores 3 bits (one per channel). A 1000x1000 image can hold ~366 KB.

Limitations

  • Only works with PNG output (JPEG compression destroys LSB data)
  • Input image must be large enough to hold the encrypted message
  • Single-image steganography only (no multi-image splitting)
  • No support for hiding files (text messages only)

Possible Improvements

  • Support hiding files (images, PDFs, zips) not just text
  • Add HMAC verification to detect tampering
  • Spread bits randomly using a seeded PRNG instead of sequential embedding
  • Add a simple GUI with tkinter

License

MIT

About

Hide encrypted messages inside images using LSB steganography and AES-256 encryption. Supports capacity analysis and pixel-level comparison.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages