Thursday, October 30, 2008

Steganography (Embedding files)

So you have an .mp3 of you singing in the shower that you want to hide to make sure no one hears, ok .... whatever, here's how to hide a file inside another file so both still work. This is a very basic form of Steganography, there are some freeware progs that I will review at a later date that actually encrypt the file as well.

Open a command line at the folder with the files you want to merge.
We are going to use the CLI command Copy /b which copies the files in binary mode.

C:\Temp>copy /b firstfile.jpg + secondfile.mp3 output.jpg

Now you will have the file output.jpg that can be viewed happily as a picture that's actually firstfile.jpg, and when you change the file extension to .mp3 it can be played to hear secondfile.mp3.

If you want to merge more then one file just create a .zip or .rar containing the to be hidden files and merge that with the host file, it will be accessible when you change the file extension just like before.

Linux and Mac users can use the cat command to do the same thing :
$ cat file1 file2 >> newfile
If newfile already exists, file1 and file2 will be added to the end of it.

This technique has limited use as the host file size increases exponentially with the files added, so having a 2gb 640x480 jpg is a bit redundant, but if your playing secret squirrel it can be fun.

0 comments: