To run this:
-
pip3 install -r requimements.txt -
python steganography.py --helpOutput:
usage: steganography.py [-h] [-t TEXT] [-e ENCODE] [-d DECODE] Steganography encoder/decoder, this Python scripts encode data within images. optional arguments: -h, --help show this help message and exit -t TEXT, --text TEXT The text data to encode into the image, this only should be specified for encoding -e ENCODE, --encode ENCODE Encode the following image -d DECODE, --decode DECODE Decode the following image -
To encode some data to the image
image.PNG:python steganography.py -e image.PNG -t "This is some secret data."This will write another image
image_encoded.PNGwith data encoded in it and outputs:[*] Maximum bytes to encode: 125028 [*] Encoding data... [+] Saved encoded image. -
To decode the data containing the image
encoded_image.PNG, use:python steganography.py -d encoded_image.PNGOutputs:
[+] Decoding... [+] Decoded data: This is some secret data. -
To encode the
foo.pdffile into theimage.PNGimage, usingsteganography_advanced.pyscript:$ python steganography_advanced.py -e image.PNG -f foo.pdf -b 1Output:
[*] Maximum bytes to encode: 125028 [*] Data size: 84158 [*] Encoding data... [+] Saved encoded image. -
Now decoding it into a file
foo_decoded.pdf:python steganography_advanced.py -d image_encoded.PNG -f foo_decoded.pdf -b 1 [+] Decoding... [+] File decoded, foo_decoded.pdf is saved successfully.