#steganography #steg #hiding #text

whitespace_text_steganography

A steganography strategy that uses whitespace to hide text in other text

6 releases

0.2.1 Oct 29, 2018
0.2.0 Oct 26, 2018
0.1.3 Oct 26, 2018

#75 in Command-line interface

Download history 8/week @ 2018-10-23 40/week @ 2018-10-30 51/week @ 2018-11-06 20/week @ 2018-11-13 17/week @ 2018-11-20 12/week @ 2018-11-27 36/week @ 2018-12-04 1/week @ 2018-12-11 17/week @ 2018-12-18 84/week @ 2018-12-25 6/week @ 2019-01-08

95 downloads per month
Used in 1 crate

MIT license

10KB
117 lines

whitespace_text_steganography

(Zero width whitespace steganography)

This repo is a module for the commandline tool steg but can also be used independently.

It takes paths to two text files and hides the contents of the first in the second one, it can then reveal the hidden text again.

Usage

Add the following to the Cargo.toml in your project:

[dependencies]
whitespace_text_steganography = "*"

Add a payload.txt and a carrier.txt to a folder called texts.

and import using extern crate:

extern crate whitespace_text_steganography;

use std::error::Error;
use std::fs::File;
use std::io::prelude::*;

use whitespace_text_steganography::{ hide, reveal };

fn main () {
    let payload_path = "./texts/payload.txt";
    let carrier_path = "./texts/carrier.txt";
    let output_path = "./hidden.txt";

    let text = hide(payload_path, carrier_path);
    println!("\n-------{}------", output_path);
    println!("{}", text);

    let mut file = match File::create(output_path) {
        Err(why) => panic!("couldn't create because: {}", why.description()),
        Ok(file) => file,
    };
    
    match file.write_all(text.as_bytes()) {
        Err(why) => panic!("couldn't write because: {}", why.description()),
        Ok(_) => (),
    }

    println!("\n--------The hidden message revealed---------");

    let hidden_message = reveal(output_path);
    println!("{}", hidden_message);
}

Dependencies

~2MB
~36K SLoC