π΅οΈ Lupin
A blazing-fast, lightweight steganography tool for concealing data inside PDF files. Lupin exploits the fact that PDF viewers ignore content after the %%EOF marker, allowing arbitrary payloads to be appended to a document without affecting how it is displayed by standard PDF readers.
Written in Rust for performance and safety, Lupin provides a simple command-line interface for embedding and extracting hidden files. It is cross-platform and works on Linux, macOS and Windows.
In an era when privacy is important, Lupin offers a discreet way to conceal sensitive information within ordinary documents. It is named after ArsΓ¨ne Lupin, the fictional gentleman thief β a nod to the project's goal of invisibly hiding data inside ordinary files.
π Quick Start
Installation
You can build Lupin from source:
Alternatively, download the latest binary for your platform from the releases page.
Basic usage
# Hide a secret file inside a PDF
# Extract the hidden file
# Extract to stdout (useful for piping)
# Extract without using Lupin (using standard tools)
| |
While extraction can be done with standard tools, we recommend using Lupin to ensure compatibility.
π§ How it works
Lupin exploits a feature of the PDF format: content after the %%EOF marker is ignored by PDF readers but remains part of the file. The tool implements two main operations:
- Embedding: finds the last
%%EOFmarker in the PDF and appends base64-encoded payload data directly after it. - Extraction: locates the
%%EOFmarker and decodes everything after it back to the original binary data.
In short, Lupin uses the PDF as a container for hidden data while preserving the original document so it opens normally in any PDF viewer.
π‘ Usage examples
Hide a text message
Hide an image
Hide an archive
# Create a zip archive of a folder
# Embed the archive into a PDF
Extract and view
# Extract to a file
# Extract and pipe to another command
|
ποΈ Building from source
Prerequisites
- Rust 1.48 or later
- Cargo (included with Rust)
Build commands
# Development build
# Optimised release build
# Run tests
# Check code formatting
# Run the linter
π§ͺ Testing
The project includes comprehensive tests to ensure reliability:
# Run all tests
# Run tests with verbose output
# Run a single test
The CI pipeline also performs integration tests by embedding and extracting data from the included examples/cat.pdf file.
π Project structure
lupin/
βββ src/
β βββ main.rs # CLI interface and argument parsing
β βββ lib.rs # Core library with modular components
βββ examples/
β βββ cat.pdf # Sample PDF for testing
β βββ out.pdf # Sample output PDF after embedding message.txt
β βββ message.txt # Sample payload file
βββ .github/workflows/ # CI/CD pipelines
π Library usage
You can also use Lupin as a Rust library:
use ;
use Path;
π€ Contributing
Contributions are welcome. To contribute:
- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature) - Commit your changes (
git commit -m "Add your feature") - Push to the branch (
git push origin feature/your-feature) - Open a pull request
Development guidelines
- Follow Rust formatting conventions (
cargo fmt) - Ensure all tests pass (
cargo test) - Add tests for new functionality
- Update documentation as appropriate
π License
This project is licensed under the Apache License 2.0 β see the LICENSE file for details.
Disclaimer: This tool is intended for educational and legitimate use only. Users are responsible for complying with applicable laws and regulations relating to data hiding and steganography.