Skip to content

kascit/whisper-text

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

whisper-text

License: MIT

A lightweight Rust library for text steganography that hides secret messages inside ordinary text using zero-width Unicode characters.

Features

  • 🔒 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

Installation

Add this to your Cargo.toml:

[dependencies]
whisper-text = "0.1.0"

Usage

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);
}

Advanced Usage

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");

How It Works

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 marker
  • U+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.

Testing

Run the test suite:

cargo test

Run the example:

cargo run --example basic

Security Considerations

This 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.

License

MIT

About

Whisper Text is a lightweight text steganography tool that hides secret messages inside ordinary text using zero-width Unicode characters. The encoded text looks unchanged to the reader but can be reliably decoded to recover the hidden message.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors