A Python-based Image Steganography Command Line Tool that allows you to encrypt a secret message and embed it inside an image (PNG) using LSB steganography, and later extract & decrypt it securely using a password. This CLI tool is built for terminal users, automation, and security-focused experimentation, combining strong cryptography with invisible data hiding.
Image-Steganography-CLI-Tool/
β
βββ assets/ # Screenshots
βββ main.py # Basic CLI application
βββ interactive.py # Rich CLI Version
βββ requirements.txt # Project Dependancies
βββ README.md # Project documentation- Encrypts message using Fernet (AES-128 encryption)
- Derives key from password using PBKDF2-HMAC (SHA256)
- Embeds encrypted payload into WAV audio using LSB (Least Significant Bit)
- Supports:
- Direct text input
- Message from file
- Extracts embedded payload from WAV
- Uses stored salt to regenerate the Fernet key
- Decrypts message securely
- Outputs decrypted message to:
- Terminal or
- File
- Colored terminal output
- Structured key display tables
- Styled panels for encoding/decoding results
- Better user experience and readability
- π§Ό Basic CLI β Lightweight, no dependencies
- π¨ Rich CLI β Enhanced UI with colors and panels
| Technology | Purpose |
|---|---|
| Python 3 | Core language |
| argparse | CLI argument parsing |
| Pillow (PIL) | Image processing |
| cryptography (Fernet + PBKDF2HMAC) | Secure encryption |
| LSB Steganography | Data hiding technique |
| struct / secrets / base64 | Payload & cryptographic helpers |
| Rich | Interactive CLI interface |
git clone https://github.com/ShakalBhau0001/Image-Steganography-CLI-Tool.gitcd Image-Steganography-CLI-Toolpip install rich cryptography pillowOR
pip install -r requirements.txtpython main.pypython interactive.pypython main.py encrypt --in-image cover.png --out-image stego.png --password mypass --message "secret"python main.py encrypt --in-image inputfile.png --out-image outputfile.png --password yourpassword --message "Enter Your Secret Message"python main.py encrypt --in-image cover.png --out-image stego.png --password mypass --message-file secret.txtpython main.py encrypt --in-image inputfile.png --out-image outputfile.png --password yourpassword --message-file Add Your Secret txt filepython main.py decrypt --in-image stego.png --password mypasspython main.py decrypt --in-image outputfile.png --password yourpasswordpython main.py decrypt --in-image stego.png --password mypass123 --out-file output.txtpython main.py decrypt --in-image outputfile.png --password yourpassword --out-file filename.txt- Input Image: PNG / RGB or RGBA images
- Output Image: PNG (RGBA)
- Message Type:
- UTF-8 text
- Binary files (via
--message-file)
β οΈ Payload size depends on image resolution. Small images may not support large messages.
1οΈβ£ Key Derivation
- Password β PBKDF2-HMAC(SHA256, 390k iterations) β 32-byte key β Fernet key
2οΈβ£ Encryption
- Message encrypted using Fernet
- Payload format:
[STEG][16-byte salt][4-byte length][encrypted data]
3οΈβ£ Embedding
-
Each bit of payload embedded into:
- LSB of R, G, B channels
-
Alpha channel remains untouched
-
Image visually unchanged
4οΈβ£ Extraction
- Reads LSB bits
- Reconstructs payload
- Validates MAGIC header
- Regenerates key from password + salt
- Decrypts message
- Wrong password β Fernet Decryption fails
- Wrong image β MAGIC header not found
- Small image β Payload too large
- Corrupted stego image β Payload integrity error
- Auto capacity detection before embedding
- Progress indicator for large images
- Support for JPEG (with DCT-based steganography)
- Multi-file embedding
- Optional compression before encryption
This repository focuses on a specific steganography technique implemented as a command-line (CLI) learning project.
The goal of this project is to:
- Understand how steganography works at a practical level
- Experiment with data hiding techniques
- Learn how CLI-based security tools are structured
For a more advanced and combined implementation that includes:
- Image steganography
- Audio steganography
- File encryption support
please refer to:
π StegaVault-CLI
This project is intended for educational and research purposes only.
It is not designed for real-world secure communication. Steganography alone does not guarantee secrecy and should not be considered a replacement for proper cryptographic security.
Creator: Shakal Bhau
GitHub: ShakalBhau0001
If you like this project, consider giving it a β on GitHub!



