asbs

Crates.ioasbs
lib.rsasbs
version1.2.3
sourcesrc
created_at2024-11-12 23:11:24.006187
updated_at2024-11-19 17:00:23.103624
descriptionA generic steganography library
homepage
repositoryhttps://github.com/aeverless/asbs
max_upload_size
id1445698
size37,352
Artemy Astakhov (aeverless)

documentation

https://docs.rs/asbs

README

ASBS

The ASBS (Arbitrarily Significant Bits) library provides the traits and implementations useful for steganographic concealment and extraction of messages.

Binary Implementation

The library provides the binary module which can be used to encode messages in binary data with bit patterns, which act as keys and should be shared with the receiver of the message.

Bit patterns are defined as a function that takes a byte index and returns a bit mask for the byte at that index. They can be used to significantly increase the entropy level and thus hide the messages more effectively, as there's no one predetermined pattern that is used for all messages.

See src/binary.rs for more details.

Examples

Hiding a message within a binary file:

use asbs::{binary, Conceal};
use std::fs::File;

// Define the bit pattern
let pattern = |i| Some(1u8 << (i % 3));

// Define the payload
let payload = b"a very secret message";

// Create a carrier with the given payload length, pattern, and output file
let mut carrier = binary::Carrier::with_embedded_len(
    payload.len(),
    pattern,
    File::create("package")?,
);

// Write the payload hidden within the given cover file
carrier.conceal(
    payload.as_slice(),
    File::open("cover")?,
)?;

Extracting a hidden message from a binary file:

use asbs::{binary, Reveal};
use std::fs::File;

// Define the bit pattern
let pattern = |i| Some(1u8 << (i % 3));

// Create a package with the given pattern and input file
let mut package = binary::Package::with_embedded_len(
    pattern,
    File::open("package")?,
);

// Write the extracted message into a file
package.reveal(File::create("message")?)?;

License

The library is licensed under either the MIT License or the Apache-2.0 License, at your option.

Authors

Artemy Astakhov (contact at aeverless dot dev)

Commit count: 8

cargo fmt