Hide Files in Images

Steganography is the science of hiding data within data. It is used to secure information from others.
The following formula provides a generic description of the steganographic process:
cover_medium + hidden_data + stego_key = stego_medium
cover_medium is the file in which we will hide the hidden_data, which may also be encrypted using the stego_key.
The resultant file is the stego_medium which has the same type of file as the cover_medium.
There are a lot of methods for this purpose and today we are going to learn one of them.

We are going to learn how to hide files in images.
To do so, we will need two files: an image file as the cover_medium and a zip file that contains the secret files to be hidden (You can encrypt the zip file using a password for extra protection).
Consider having two files image.jpeg and secret.zip
To hide the zip file in the image file we run the following commands:
on Windows: copy /B image.jpeg+secret.zip newfile.jpeg
on Linux: cat image.jpeg secret.zip > newfile.jpeg
Now newfile.jpeg contains the binary data appended from both files.
It looks like an ordinary image file that can be opened via any image viewer.
In order to access the hidden info, just open the same file in any archive manager or change its extension to .zip.
By doing so the image file will change to the zip file where you can access your information.
To re-hide your information just change the extension back to .jpeg.
How this works?
This method works because of a simple fact:
Image files are read top down and compressed files are read bottom up.
This allows image viewers to access only the image data and archive files access only the archive data.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s