- Tutorial
Tutorial¶
Getting Stéganô¶
1 hg clone http://hg.cedricbonhomme.org/stegano/ 2 cd stegano/
Installation¶
python setup.py install
Now you will be able to use Stéganô in your Python program.
Using Stéganô as a Python module¶
1 Python 2.7 (r27:82500, Jul 5 2010, 10:14:47) 2 [GCC 4.3.2] on linux2 3 Type "help", "copyright", "credits" or "license" for more information. 4 >>> from stegano import slsb 5 6 >>> secret = slsb.hide("./pictures/Lenna.png", "Hello world!") 7 >>> secret.save("./Lenna-secret.png") 8 9 >>> slsb.reveal("./Lenna-secret.png") 10 Hello world!
Using Stéganô in command line for your scripts¶
Display help¶
$ slsb --help
Usage: slsb [options]
Options:
--version show program's version number and exit
-h, --help show this help message and exit
--hide Hides a message in an image.
--reveal Reveals the message hided in an image.
-i INPUT_IMAGE_FILE, --input=INPUT_IMAGE_FILE
Input image file.
-o OUTPUT_IMAGE_FILE, --output=OUTPUT_IMAGE_FILE
Output image containing the secret.
-m SECRET_MESSAGE, --secret-message=SECRET_MESSAGE
Your secret message to hide (non binary).
-f SECRET_FILE, --secret-file=SECRET_FILE
Your secret to hide (Text or any binary file).
-b SECRET_BINARY, --binary=SECRET_BINARY
Output for the binary secret (Text or any binary
file).
$ slsb-set --help
Usage: slsb-set [options]
Options:
--version show program's version number and exit
-h, --help show this help message and exit
--hide Hides a message in an image.
--reveal Reveals the message hided in an image.
-i INPUT_IMAGE_FILE, --input=INPUT_IMAGE_FILE
Input image file.
-g GENERATOR_FUNCTION, --generator=GENERATOR_FUNCTION
Generator
-o OUTPUT_IMAGE_FILE, --output=OUTPUT_IMAGE_FILE
Output image containing the secret.
-m SECRET_MESSAGE, --secret-message=SECRET_MESSAGE
Your secret message to hide (non binary).
-f SECRET_FILE, --secret-file=SECRET_FILE
Your secret to hide (Text or any binary file).
-b SECRET_BINARY, --binary=SECRET_BINARY
Output for the binary secret (Text or any binary
file).
Hide and reveal a text message¶
$ slsb --hide -i ./pictures/Lenna.png -o ./pictures/Lenna_enc.png -m 'Hello World!' $ slsb --reveal -i ./pictures/Lenna_enc.png HelloWorld!
Hide and reveal a text message with the LSB method using sets¶
For example if you want to hide a message with the sieve of Eratosthenes:
$ slsb-set --hide -i examples/pictures/Montenach.png -o ~/enc.png --generator eratosthenes -m 'Bonjour' $ slsb-set --reveal -i ~/enc.png --generator eratosthenes Bonjour $ slsb-set --reveal -i ~/enc.png --generator mersenne Impossible to detect message.
Hide and reveal a binary file¶
$ wget http://www.gnu.org/music/free-software-song.ogg $ slsb --hide -i ./pictures/Montenach.png -o ./pictures/Montenach_enc.png -f ./free-software-song.ogg $ rm free-software-song.ogg $ slsb --reveal -i ./pictures/Montenach_enc.png -b ./song.ogg
Hide and reveal a message by using the description field of the image¶
$ ./exif-header.py --hide -i ./Elisha-Cuthbert.jpg -o ./Elisha-Cuthbert_enc.jpg -f ./fileToHide.txt $ ./exif-header.py --reveal -i ./Elisha-Cuthbert_enc.jpg
Steganalysis¶
$ steganalysis-parity -i ./pictures./Lenna_enc.png -o ./pictures/Lenna_enc_st.png
Examples¶
Reveal a text message¶
$ wget http://projects.cedricbonhomme.org/attachments/2/lena-secret.png $ slsb --reveal -i lena-secret.png $ slsb-set --reveal -i lena-secret.png --generator identity
Hide and reveal an audio file¶
$ wget http://www.gnu.org/music/free-software-song.ogg $ slsb --hide -i ./pictures/Montenach.png -o ./pictures/Montenach_enc.png -f ./free-software-song.ogg $ rm free-software-song.ogg $ slsb --reveal -i ./pictures/Montenach_enc.png -b ./cool-song.ogg
Hide and reveal using Exif information¶
elisha-secret.jpg
$ wget http://projects.cedricbonhomme.org/attachments/3/elisha-secret.jpg $ ./exif-header.py --reveal -i ./Elisha-Cuthbert_enc.jpg