steganographyrs is a Rust library that inject a message into an image.
The word steganography means to hide something. The definition is very high level. Hence, it has a variety of ways to accomplish the goal of steganography. This library relies on the least significant bits.
1) Blog Post about using the least significant bits
sh
cargo add steganographyrs
You must have some arguments like the mode you want to execute (encrypt, decrypt). If you want to use AES encryption, you need to provide your secret password with -p
.
You can see all options by using --help
or -h
sh
steganographyrs --help
// or in dev:
cargo run -- help
sh
steganographyrs -e inject -m "My Secret Message" -i testAssets/prestine.png -o out.png
// or in dev:
cargo run -- -e inject -i testAssets/prestine.png -o out.png -m "My Secret Message"
sh
steganographyrs -e inject -p secret -m "My Secret Message" -i testAssets/prestine.png -o out.png
// or in dev:
cargo run -- -e inject -p secret -i testAssets/prestine.png -o out.png -m "My Secret Message"
sh
echo "My Secret Message" | steganographyrs -e inject -p secret -i testAssets/prestine.png -o out.png
sh
cat testAssets/message1.txt | steganographyrs -e inject -p secret -i testAssets/prestine.png -o out.png
// or in dev:
cat testAssets/message1.txt | cargo run -- -e inject -i testAssets/prestine.png -o out.png
sh
steganographyrs -e extract -i testAssets/image_with_secret_message.png
// or in dev:
cargo run -- -e extract -i testAssets/image_with_secret_message.png
The result is sent into the standard output
sh
steganographyrs -e extract -p secret -i testAssets/image_with_secret_message.png
// or in dev:
cargo run -- -e extract -p secret -i testAssets/image_with_secret_message.png
sh
steganographyrs -e extract -p secret -i testAssets/image_with_secret_message.png >> message.txt
// or in dev:
cargo run -- -e extract -p secret -i testAssets/image_with_secret_message.png >> message.txt
sh
steganographyrs -e extract -p secret -i testAssets/image_with_secret_message.png >> message.txt
// or in dev:
cargo run -- -e extract -p secret -i testAssets/image_with_secret_message.png >> message.txt
You use the entry function called steganography
and you can choose the option you want to inject and extract a message by encrypting or not your message into an input image to an output message.
rust
use steganographyrs::steganography;
let result = steganography(steganography_option); // Result is an option that is only filled on the extraction
You need to install the right toolchain:
sh
rustup toolchain install stable
rustup default stable
To perform test coverage you need to install
sh
cargo install grcov
rustup component add llvm-tools-preview
To generate benchmark plots you need to install GnuPlot
```sh sudo apt update sudo apt install gnuplot
which gnuplot ```
To get all options using cargo run
:
cargo run -- -help
sh
cargo test
You must install few components before running coverage:
sh
cargo install grcov
rustup component add llvm-tools-preview
Then, you can run:
sh
./coverage.sh
Further explanation in the Mozilla grcov website
The documentation is generated from the source code using:
sh
cargo doc --open -document-private-items
All commands for the user works but instead of using
steganographyrs -e true -p secret -m "My Secret Message" -i testAssets/prestine.png -o out.png
You need to use:
cargo run -- -e true -p secret -m "My Secret Message" -i testAssets/prestine.png -o out.png
sh
cargo bench
sh
cargo package --allow-dirty
Then go to steganographyrs/target/package/
to see the content
sh
cargo login
cargo publish --dry-run
cargo publish