A lightweight Rust library for text steganography that hides secret messages inside ordinary text using zero-width Unicode characters.
- 🔒 Hide messages in plain sight using zero-width Unicode characters
- 🎯 Lossless encoding and decoding
- 🌍 Full UTF-8 and Unicode support
- 🚀 Zero dependencies
- ✅ Comprehensive test coverage
Add this to your Cargo.toml:
[dependencies]
whisper-text = "0.1.0"use whisper_text::{encode, decode};
fn main() {
let cover_text = "Hello, World!";
let secret = "secret message";
// Encode secret into cover text
let encoded = encode(cover_text, secret).unwrap();
// Decode secret from encoded text
let decoded = decode(&encoded).unwrap();
assert_eq!(decoded, secret);
}use whisper_text::{encode, decode, strip_hidden};
// Strip hidden content to get only visible text
let encoded = encode("Hello", "secret").unwrap();
let visible = strip_hidden(&encoded);
assert_eq!(visible, "Hello");The library converts secret messages to binary and encodes them using zero-width Unicode characters:
U+200B(ZERO WIDTH SPACE) → binary '0'U+200C(ZERO WIDTH NON-JOINER) → binary '1'U+200D(ZERO WIDTH JOINER) → start markerU+FEFF(ZERO WIDTH NO-BREAK SPACE) → end marker
These characters are invisible in text editors, web browsers, and most applications, but are preserved by computers. Note: Terminals may render these characters visibly, but they are truly invisible in practical use cases.
Run the test suite:
cargo testRun the example:
cargo run --example basicThis library is designed for hiding data in plain text, not for cryptographic security. The hidden messages are obfuscated but not encrypted. For sensitive data, encrypt your secret message before encoding it.
MIT