How to hide data secretly inside picture files using Steganography
By Koder at Tue, 03/03/2009 - 08:37
You can hide data secretly inside picture files like jpg, png and gif. These files appear totally normal to the naked eye, when you double click on them, they open like the normal picture files would and you can see the pictures, however you can secretly embed other files within one picture file with a technique known as Steganography. There are already ready made tools available for all platforms (Windows, Linux and Macs) that make this possible.
|In our example we are going to demonstrate how you can hide another file inside a jpg picture file using command line techniques which are built into Windows. The procedure involves embeding a compressed RAR file inside a jpeg file. Here are the steps: |
- To try collect a group of four simple text files and archive them to the RAR format using any Archiving software of your choice such as Winrar, 7ZIP (free), Winzip etc. Call the archive file as hiddendata.rar
- Find a good quality jpg file, of a normal size (not too big nor too small), rename the file samplepicture.jpg
- Place both the rar file you created above and the samplepicture.jpg in the same directory (eg; C:\Temp)
- Open a Windows command prompt and change to the directory where you stored both files earlier (C:\Temp)
- Now issue this command "copy /B samplepicture.jpg + hiddendata.rar newpicture.jpg"
- The command above simply copies the hiddendata.rar file to samplepicture.jpg in binary more and creates a third picture file called newpicture.jpg
- If you now double click on this newpicture.jpg file, you would find out that it opens up as a normal image
- To retrieve the hidden data (the rar file), simply rename the extension of the third file that got created as a result of previous step (newpicture.jpg) to rar, hence making it newpicture.rar . Now when you open this with Winrar, Wizip or 7Zip, you would find your picture file and the rar file both in there.
So how is this possible ? The answer is quite simple, the jpg format asks the image program to look at the header, the header dicates the length of data, hence the image program ignores everything beyond the data length specified in the header.
I just gave you an example of a jpg file, but essentially using the Steganography technique, you can hide data inside png, gif, mp3, pdf and other files. There are a lot of custom and GUI bassed tools available for every platform, for example :
Hide in Picture (Windows) http://sourceforge.net/projects/hide-in-picture/
JPHS for Windows http://linux01.gwdg.de/~alatham/stego.html
PictEncrypt (For Macs) http://www.net-security.org/software.php?id=660
Built in Cat command in Linux or Unix