Implementation of least significant bit steganography for PNG images and WAV audio files in rust-lang.
Aims for compatibility to the Stegano for windows version regarding image en-/decoding
In short, the art of hiding information in something (like a book, a image, a audio or even a video).
You can find more information on my slides or checkout my talk on the rust meetup munich in june, 2020.
To install the stegano cli, you just need to run
❯ cargo install --force stegano-cli(--force just makes it update to the latest stegano-cli if it's already installed)
Note the binary is called stegano (without -cli)
to verify if the installation went thru, you can run which stegano that should output similar to
$HOME/.cargo/bin/steganostegano can be installed from available AUR packages using an AUR helper. For example,
yay -S stegano
❯ stegano --help 10203 00:00:39
Stegano CLI 0.4.0-beta1
Sven Assmann <sven.assmann.it@gmail.com>
Hiding secret data with steganography in PNG images and WAV audio files
USAGE:
stegano [SUBCOMMAND]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
SUBCOMMANDS:
help Prints this message or the help of the given subcommand(s)
hide Hides data in PNG images and WAV audio files
unveil Unveils data from PNG images
unveil-raw Unveils raw data in PNG images❯ stegano hide --help 10204 00:00:44
stegano-hide
Hides data in PNG images and WAV audio files
USAGE:
stegano hide [FLAGS] [OPTIONS] --data <data file> --in <media file> --out <output image file>
FLAGS:
--x-force-content-version-2 Experimental: enforce content version 2 encoding (for backwards compatibility)
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-d, --data <data file> File(s) to hide in the image
-i, --in <media file> Media file such as PNG image or WAV audio file, used readonly.
-m, --message <text message> A text message that will be hidden
-o, --out <output image file> Final image will be stored as fileLet's illustrate how to hide a file like README.md, inside an image Base.png and save it as README.png:
❯ stegano hide --data README.md --in resources/plain/carrier-iamge.png --out README.pngThe final result is then contained in the image README.png.
Pro TIP you can hide multiple files at once
here I'm using the shorthand parameters (--data, -d), (--in, -i), (--out, -o)
❯ stegano hide \
-i resources/plain/carrier-image.png \
-d resources/secrets/Blah.txt \
resources/secrets/Blah-2.txt \
-o secret.pngHidden Feature you can use a .jpg for input and save it as .png
❯ stegano hide \
-i resources/NoSecret.jpg \
-d resources/secrets/Blah.txt \
-o secret.png❯ stegano hide \
-i resources/plain/carrier-audio.wav \
-d resources/secrets/Blah.txt \
resources/secrets/Blah-2.txt \
-o secret.wavNow let's assume we want to hide just a little text message in secret-text.png. So we would run:
❯ stegano hide \
-i resources/NoSecrets.jpg \
-m 'This is a super secret message' \
-o secret-text.png❯ stegano unveil --help 10213 00:07:31
stegano-unveil
Unveils data from PNG images
USAGE:
stegano unveil --in <image source file> --out <output folder>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-i, --in <image source file> Source image that contains secret data
-o, --out <output folder> Final data will be stored in that folderLet's unveil the README.md that we've hidden (just above) in README.png
❯ stegano unveil --in README.png --out ./
❯ file README.md 10215 00:10:50
README.md: UTF-8 Unicode textNow let's unveil the message from above secret-text.png. So we would run:
❯ stegano unveil \
-i secret-text.png \
-o message
❯ cat message/secret-message.txt
This is a super secret message❯ stegano unveil-raw --help 10216 00:10:58
stegano-unveil-raw
Unveils raw data in PNG images
USAGE:
stegano unveil-raw --in <image source file> --out <output file>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-i, --in <image source file> Source image that contains secret data
-o, --out <output file> Raw data will be stored as binary fileLet's unveil the raw data of the README.md that we've hidden just above in README.png
❯ stegano unveil-raw --in README.png --out README.binThe file README.bin contains all raw binary data unfiltered decoded by the LSB decoding algorithm.
That is for the curious people, and not so much interesting for regular usage.
To contribute to stegano-rs, please see open an issue on github and note that at this very time the architecture and the API is still in flux and might change.
- GNU GPL v3 license
- Copyright 2019 - 2020 © Sven Assmann.