Skip to content
Shneor, E edited this page Sep 13, 2023 · 2 revisions

Usage

hatch run main --help
usage: __main__.py [-h] [-v] (-p FILE | -x FILE) [--lsb] [--lsb-bits BITS] [--lsb-msb] [--edges] [--noise] [--noise-bits BITS] [--noise-msb] [--not] [--not-bits BITS] [--not-msb]
                   [--ssdb] [--ssdb-pwd PWD] [--concat]

options:
  -h, --help            show this help message and exit
  -v, --verbose         increase output verbosity
  -p FILE, --plain FILE
                        a plain image to hide a message from stdin in, writes PNG to stdout
  -x FILE, --extract FILE
                        extract a message from an image to stdout
  --lsb                 use the least significant bits codec
  --lsb-bits BITS       [lsb codec] number of bits to store per pixel
  --lsb-msb             [lsb codec] use the most significant bits instead
  --edges               use the edges codec
  --noise               encode your message inside random noise
  --noise-bits BITS     [noise codec] number of bits to store per pixel
  --noise-msb           [noise codec] use the most significant bits instead
  --not                 encode a file within a render of your secret message (joke encoding)
  --not-bits BITS       [not codec] number of bits to store per pixel
  --not-msb             [not codec] use the most significant bits instead
  --ssdb                use the seed-spaced data bytes codec
  --ssdb-pwd PWD        [ssdb codec] The password used to encode/decode.
  --concat              appends encoded secret into the image

Syntax

The syntax for encoding a message is:

echo "my secret message" | hatch run main -p path/to/image --codec_flag > path/to/save/new_image

And for decoding a message:

hatch run main -x path/to/image --codec_flag

Examples

LSB Codec

Encode and decode a message using LSB:

echo "Hello World" | hatch run main -p south_tyrol.jpg --lsb > new_south_tyrol.jpg

To decode the message we are going to pass the path of the new file:

hatch run main -x new_south_tyrol.jpg --lsb
Hello World

Noise Codec

To encode a message using the Noise codec:

echo "r[Rz#732@XEm:B'-" | hatch run main -p south_tyrol.jpg --noise > new_south_tyrol.jpg

And to extract the message:

hatch run main -x new_south_tyrol.jpg --noise
r[Rz#732@XEm:B'-
Clone this wiki locally