Tuesday, July 24, 2012

How to Hide Secret Documents inside JPG Images

Turn out that it is actually very easy to hide (or embed) other file inside a JPEG image. You can place video clips, pdf, mp3, Office documents, zipped files, webpage or any other file format inside a JPEG image.
Let's say you want to hide a confidential PDF document. What you can do is convert that file into a regular jpg image so even if anyone double-clicks this file, all he will see is a preview of the image and nothing else. And when you want to work on the actual PDF, just rename the extension from jpg to pdf.
Step 1: You will need two files - the file you want to hide and one jpg image - it can be of any size or dimensions. [If you want to hide multiple files in one jpeg image, just zip them into one file]

Step 2: Copy the above two files to the C: folder and open the command prompt window.

Step 3: Move to the c: root by typing cd\ [enter][if the files are in another folder, you'll have to change the prompt to that folder]

Step 4: The most important step - type the following command:
copy /b myimage.jpg + filetohide.txt my_new_image.jpg

Step 5: To see the original TXT file, just right click--> my_new_image.jpg and open with notepad-->go to end of file you will see your secret message.
Here we illustrated with an .TXT file. If you want to apply this technique to other file formats like XLS, DOC, PPT, AVI, WMV, WAV, SWF, etc, you may have to first compress them in RAR format before executing the copy /b DOS command.
To restore the original file, just open file with winRAR or 7-zip.

6 comments:

  1. A pretty naive question, my txt file name has a space in between. So when i enter the copy command, it says file cannot be found... working great with filename with no spaces.. Also is there a way to make the new zip file password protected ?

    ReplyDelete