Steganography: hide messages or files inside images
Steganography is the practice of conceiling a message or a file within another file and you can use it to hide text or entire files inside an image. I will show you how to do it using widely available Linux programs.
Table of Contents
stegano
Available on Snap and AUR, this basic CLI tool allows to encrypt and decrypt text and files within images. You just need two commands: stegano hide
and stegano unveil
. Stegano works with PNG images and WAV audio files.
stegano hide -d text-to-hide.txt -i original.png -o image-with-secret.png
# "folder/" must be created before
stegano unveil -i image-with-secret.png -o folder/
Run stegano --help
for more info.
Steghide
Available on Debian repositories, this steganography program is able to hide data inside PNG, JPEG, WAV and AU files. steghide
allows to select the encryption algorithm and a passphrase to decrypt. To hide (“embed”) a file or message, type:
steghide emded -ef text-to-hide.txt -cf original.jpg -sf image-with-secret.jpg
To decrypt (extract) an encrypted image:
steghide extract -sf image-with-secret.jpg
- It will prompt you for the passphrase you wrote when encrypting the image.
- This command will create a file with the original name of the hidden file. You can include
-xf <filename>
to specify a different filename.
Run man steghide
for more info.
OpenStego
Similar to Steghide, this CLI and GUI Java-based tool can also create invisible watermarks (signatures) to detect unauthorized file copying.
To embed a file into an image:
openstego embed -mf text-to-hide.txt -cf original.png -sf image-with-secret.png
To extract a file from an image:
openstego extract -sf image-with-secret.png -xd /path/to/folder
To generate a signature for watermarking:
openstego gensig -gf mysignature.sig
To embed the signature into a file:
openstego embedmark -gf mysignature.sig -cf original.png -sf output.png
Run openstego help
for more info.
Stegosuite
Stegosuite is a graphical program available on Debian repositories to hide text or files inside images. Interface is super simple: just open the program, click File -> Open...
and select your image. Then, add a message or do a right-click on the box below 0 embedded files
and click Add file...
. Finally, add a password and press Embed
. The new encrypted image will be created in the same directory as the original image.
To decrypt (extract) an image, do almost the same: open the image (File -> Open...
), type the password and click Extract
.
If you have any suggestion, feel free to contact me via social media or email.
Latest tutorials and articles:
Featured content: