PNGer
A cross-platform command-line tool for embedding payloads within PNG files using steganography techniques.
Features
- LSB Steganography: Embed data using Least Significant Bit manipulation
- LSB Customization: Linear or random patterns with configurable bit targeting (0-7)
- Reproducible Patterns: Use seeds and salts for deterministic embedding/extraction
- XOR Obfuscation: Optional payload encryption with custom or default keys
- Bidirectional Operations: Both embed and extract capabilities with parameter matching
- Multiple Output Formats: Save to file or output raw binary data
- Cross-Platform: Works on Windows, macOS, and Linux
- Fast & Efficient: Optimized Rust implementation
- Extensible Architecture: Support for multiple steganography algorithms
Installation
From Source
The binary will be available at target/release/pnger.
Using Cargo
Usage
Basic Examples
Embed a text file into a PNG image:
Embed binary data with explicit LSB mode:
Output to stdout for piping:
Advanced Examples
Advanced LSB with reproducible random pattern:
Linear LSB pattern for sequential embedding:
Target specific bit position (bit 2 instead of LSB):
Add XOR obfuscation for extra security:
Extract with matching parameters:
Command Line Options
Usage: pnger [OPTIONS] --input <FILE>
Options:
-i, --input <FILE> Input PNG file
-p, --payload <FILE> Payload file to embed
-o, --output <FILE> Output file (write result to file)
--raw Output raw binary data to stdout
-m, --mode <MODE> Embedding mode to use [default: lsb]
-x, --extract Extract payload from input file
--xor Toggle payload obfuscation with XOR algorithm
--xor-key <XOR_KEY> Key to use for XOR obfuscation
--lsb-pattern <PATTERN> LSB pattern to use (linear or random) [default: random]
--lsb-bit-index <INDEX> LSB target bit index (0-7) [default: 0]
--lsb-seed <SEED> LSB seed for reproducible random patterns
--lsb-salt <SALT> LSB salt for reproducible random patterns (minimum 8 characters)
-h, --help Print help
-V, --version Print version
Available modes:
lsb Least Significant Bit embedding
Available LSB patterns:
linear Sequential bit embedding
random Pseudo-random bit embedding (default)
Library Usage
PNGer can also be used as a Rust library:
use ;
API Functions
embed_payload_from_file(png_path, payload_data)- Embed using default optionsembed_payload_from_file_with_options(png_path, payload_data, options)- Embed with custom optionsembed_payload_from_bytes(png_data, payload_data)- Memory-based embeddingembed_payload_from_bytes_with_options(png_data, payload_data, options)- Memory-based with optionsextract_payload_from_file(png_path)- Extract using default optionsextract_payload_from_file_with_options(png_path, options)- Extract with matching options
How It Works
PNGer uses steganography to hide data within PNG images by modifying the least significant bits of pixel data. The embedded data includes a length prefix, allowing for reliable extraction while maintaining image quality.
Requirements
- Rust 1.70 or higher
- Valid PNG input files
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Security Notice
This tool is intended for educational purposes and legitimate use cases. Users are responsible for complying with applicable laws and regulations regarding data hiding and steganography.