irfan-sec/stegano-sec
A comprehensive toolkit for steganography and steganalysis. stegano-sec enables users to hide, extract, and analyze hidden data within images, audio, and other files. With support for multiple algorithms and detection techniques, it is suitable for security researchers, CTF participants, and anyone interested in information hiding.
stegano-sec
stegano-sec is a Python-based, offline steganography toolkit for security enthusiasts, CTF players, and researchers. It allows you to hide (encode) and extract (decode) text or files within various media typesβsuch as images (PNG, JPEG), audio (WAV), and plain text filesβwith no need for external APIs or internet access. The toolkit is designed to be modular, user-friendly, and easily extensible, making it ideal for both educational and practical infosec use.
π Version 3.0.0: Now with AES encryption, BMP support, and enhanced CLI!
Features
- Encode and decode messages/files in:
- PNG, JPEG & BMP images (using LSB steganography)
- WAV audio files (LSB steganography)
- Plain text files (whitespace or zero-width character encoding)
- π AES Encryption: Optional password-based encryption for hidden messages
- Graphical User Interface (GUI) - Easy-to-use tkinter-based interface
- Command-line interface (CLI) for easy usage and scripting
- Modular codebase for adding new media formats or encoding techniques
- Offline & privacy-friendly: No data ever leaves your computer
- Modern Python: Full type hints, pathlib usage, and Python 3.8+ compatibility
- Developer-friendly: Comprehensive test suite, pre-commit hooks, and linting tools
- Pip installable: Can be installed as a proper Python package
Installation
Quick Start
git clone https://github.com/irfan-sec/stegano-sec.git
cd stegano-sec
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txtDevelopment Setup
git clone https://github.com/irfan-sec/stegano-sec.git
cd stegano-sec
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
pip install -r requirements-dev.txt # Optional: for development toolsPackage Installation (Future)
# Coming soon: pip install stegano-sec
pip install -e . # Install in development modeUsage
GUI (Graphical User Interface)
Launch the user-friendly GUI:
python stegano_sec_gui.pyThe GUI provides three tabs:
- Encode: Hide messages in images, audio, or text files
- Decode: Extract hidden messages from files
- Capacity: Check how much data a file can hide
CLI (Command Line Interface)
Encode a message in an image
python stegano_sec.py encode -i input.png -o output.png -m "Secret message here"Encode with password encryption
python stegano_sec.py encode -i input.png -o output.png -m "Secret message" -p mypasswordDecode a message from an image
python stegano_sec.py decode -i output.pngDecode an encrypted message
python stegano_sec.py decode -i output.png -p mypasswordEncode a file in a WAV audio
python stegano_sec.py encode -i input.wav -o output.wav -f secret.txtMore options
See all available commands and options:
python stegano_sec.py --helpProject Structure
stegano-sec/
βββ stegano_sec.py # CLI entry point
βββ stegano_sec_gui.py # GUI entry point
βββ stegano/
β βββ __init__.py
β βββ image.py # Image steganography functions
β βββ audio.py # Audio steganography functions
β βββ text.py # Text steganography functions
β βββ crypto.py # AES encryption/decryption
β βββ utils.py # Helper utilities
βββ requirements.txt
βββ README.md
βββ examples/
βββ sample.png
Development
Running Tests
# Run basic test suite
python -m pytest tests/
# Run with verbose output
python -m pytest tests/ -vCode Quality Tools
# Format code with Black
black stegano/ stegano_sec.py tests/
# Sort imports with isort
isort stegano/ stegano_sec.py tests/
# Lint with flake8
flake8 stegano/ stegano_sec.py tests/
# Type checking with mypy
mypy stegano/ stegano_sec.pyPre-commit Hooks
# Install pre-commit hooks (optional)
pre-commit install
# Run all hooks manually
pre-commit run --all-filesWhat's New in v3.0.0
- π AES Encryption: Password-based encryption using
--passwordflag for both CLI and GUI - πΌοΈ BMP Support: Added BMP image format for steganography
- π Version Flag: Added
--version/-VCLI flag - π Crypto Module: New
stegano/crypto.pywith encrypt/decrypt/detect functions - π§ͺ Expanded Tests: 11 tests covering encryption, BMP support, and core functionality
- π¦ New Dependency:
cryptographylibrary for secure AES encryption
All existing functionality remains fully compatible!
Security Notice
This toolkit is for educational and research purposes. While v3.0.0 adds AES encryption for hidden messages, steganography alone does not provide strong security. The encryption feature adds a layer of protection, but do not rely solely on it for high-security scenarios in adversarial environments.
Contributing
Pull requests, bug reports, and feature suggestions are welcome! Please open an issue or submit a PR.
License
MIT License
Credits
Developed by @irfan-sec
