Steganography-Tool
Hide files or text inside images and extract them later โ with optional password encryption and a simple Python GUI.
โจ Features
๐ Optional encryption for hidden data (password-based)
๐ผ๏ธ Lossless image support (PNG recommended)
๐งฐ Hide & Extract modes in a single GUI
๐ฆ Works with arbitrary files (audio, docs, zips, etc.) or plain text
๐งฎ Capacity check to avoid truncation (explained below)
๐ธ Screenshots / Outputs
The repo includes example outputs like stego_output.png. Add your own GUI screenshots here if youโd like:
/stego_output.png /stego_output (1).png
๐ Getting Started Prerequisites
Python 3.8+
Pip
Install
python -m venv .venv
pip install pillow cryptography
If your code uses a different crypto lib (e.g., PyCryptodome), replace cryptography above with the actual dependency.
Run python tool.py
This launches the GUI.
๐ฑ๏ธ How to Use (GUI) Hide (Embed)
Open cover image (PNG recommended).
Choose payload: either select a file to hide (e.g., WhatsApp Audioโฆ) or type a secret message.
Set password (optional) for encryption.
Choose output filename (e.g., stego_output.png).
Click Hide / Embed.
Extract (Reveal)
Open stego image (e.g., stego_output.png).
Enter the password (if you used one).
Choose where to save the revealed file / copy revealed text.
Click Extract / Reveal.
๐ง How It Works (High-Level)
The payload (file or text) is converted to bytes.
If a password is provided, the bytes are encrypted (e.g., using a symmetric cipher via cryptography).
A small header (e.g., payload length, mode, maybe filename) is prepended.
Bits are embedded into the least significant bits (LSB) of the image pixels.
On extraction, the header is read first, then the payload is reconstructed and decrypted if needed.
Why PNG? PNG is lossless. JPEG is lossy and can corrupt embedded bits, so donโt use JPG/JPEG for steganography.
๐ Capacity & Limits
Rough capacity for RGB PNGs:
capacity_bytes โ (width * height * 3) / 8 - overhead
3 channels per pixel (R, G, B), ~1 bit used per channel
overhead includes header and (if enabled) encryption IV/tag
If the payload is too large for the cover image, use a bigger image or compress/zip your file first.
๐ Security Notes
Steganography hides that data exists; encryption protects what it says.
Use a strong password. Without a password, hidden data is only obscured, not protected.
This project is for educational use; donโt rely on it for high-stakes secrecy.
๐๏ธ Project Structure . โโโ tool.py # main app (GUI + logic) โโโ stego_output.png # example stego image โโโ stego_output (1).png # another example โโโ README.md # you are here
(There is also a sample payload file in the repo you can use for testing.)
๐งช Quick Test
Run python tool.py.
Choose a PNG cover image.
Hide a small .txt file (or type a short message).
Save to stego_output.png.
Extract from stego_output.png and verify the contents match.
๐งญ Roadmap (Nice-to-haves)
Drag-and-drop for files/images
Batch embedding/extraction
JPEG-compatible strategy (DCT-based stego) with warnings
Built-in compressor for large payloads
Dark/light theme toggle
CLI flags for headless use
๐ค Contributing
Issues and PRs are welcome! If you change dependencies, please update the README and add a requirements.txt.
๐ License
MIT License โ Copyright (c) 2025
๐ Acknowledgements
Python community & docs
Pillow for image processing
cryptography for encryption
๐ฌ Contact
Author: @codewithgaani
Project: Steganography-Tool