HiddenWave 🌊
Secure Audio Steganography & Cryptography in Rust
HiddenWave is a fast, memory-safe CLI tool and library that hides files and text messages inside audio files (WAV/MP3) using a striding byte-injection algorithm. It combines steganography (hiding the existence of data) with AES-256-GCM cryptography (protecting the contents).
It's a re-write of the original C++ version
- WAV & MP3 Support: Natively parse WAV files or decode MP3s on the fly via
symphonia. - Encryption: Payloads are encrypted and authenticated using AES-256-GCM with a PBKDF2-derived key.
- Striding Algorithm: Distributes the payload evenly across the audio file to minimize distortion.
- Format Preservation: Automatically outputs safe lossless
.wavformats to prevent lossy compression from destroying payloads. - Library API: Exposes
hiddenwave_libfor easy integration into other Rust projects.
cargo install hiddenwavegit clone https://github.com/thehackersbrain/hiddenwave-rs.git
cd hiddenwave-rs
cargo build --releaseThe compiled binary will be at ./target/release/hiddenwave-rs.
Analyze an audio file to see exactly how much data it can hold.
hiddenwave c -i cover_audio.mp3Hide a message or file. If no output -o is specified, it defaults to output.wav.
# Hide a text message with a password
hiddenwave h -i song.wav -m "Meeting at midnight" -p "SuperSecret123"
# Hide an entire file (e.g., PDF, ZIP) inside an MP3
hiddenwave h -i podcast.mp3 -f secret_document.pdf -o secure_audio.wav -p "SuperSecret123"Extract and decrypt your hidden payloads.
# Extract a hidden text message
hiddenwave e -i secure_audio.wav -p "SuperSecret123"
# Extract a hidden file
hiddenwave e -i secure_audio.wav -o recovered.pdf -p "SuperSecret123"Add hiddenwave to your Cargo.toml:
[dependencies]
hiddenwave = "x.x.x"Example: Embedding and Extracting Data
use hiddenwave_lib::stego::{embed::embed, extract::extract};
// Note: To use the library, you provide raw PCM audio bytes and the payload.- Encryption: Your payload is encrypted using AES-256-GCM. The key is derived via PBKDF2 (100,000 iterations).
- Analysis: The tool calculates the available raw PCM audio samples and determines a "stride" (interval).
- Injection: The encrypted bytes are injected at the calculated intervals, replacing bits to make the change imperceptible to the human ear.
- Sentinels: A magic byte sequence (
@<;;) marks the end of the payload for safe extraction.
MP3 Disclaimer: MP3 is a lossy format. If you compress an audio file containing steganography into an MP3, the compression algorithm will destroy the hidden bytes. HiddenWave accepts MP3s as input, but must output a lossless
.wavfile to preserve your data.