Skip to content

djhworld/steg

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 

Steganography library.

Encode

Provide an image, data to encode and a place to store the result

    let mut cover =  File::open("image.png")?;
    let mut data = BufReader::new(Cursor::new("Hello world!"));
    let mut encode_output = Vec::new();
    let encoder = Encoder::new(CompressInput::None, ByteSplitGranularity::OneBit);

    encoder
        .encode(&mut cover, &mut data, &mut encode_output)
        .expect("no error");

You can optionally compress the data by providing CompressInput::Gzip

ByteSplitGranularity controls the level of encoding. OneBit hides the data in the least significant bit pretty well but consumes a lot of space, and FourBits will most likely be noticeable in the resulting image

Decode

    let mut image =  File::open("encoded-image.png")?;
    let mut decode_output = Vec::new();
    let decoder = Decoder::new();

    decode
        .decode(&mut image, &mut decode_output)
        .expect("no error");

About

Steganography library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages