Hiding a file in an image in Windows

If you are on a Windows computer and decide to protect a file with sensitive data, you can encrypt the file, password protect it or rely on steganography (hiding a file in an image). This technique is especially useful because unless someone knows that you have hidden a file in the picture, they might look at the picture and think nothing of it. 

Wikipedia has pretty good information on steganography. The link for that is here http://en.wikipedia.org/wiki/Steganography

The process is pretty straightforward and short. This article will show you how to hide and retrieve those files. You will need any software that creates zip or rar files like WinZip OR WinRAR, the files you wish to hide, and an image to hide the files inside.


1. Create a new folder (this is where you will put together the hidden files). I kept mine with the default name, "New folder"

2. In a separate file, select all the files you intend to hide and compress them into a ".rar" file.
This can be done by right clicking the highlighted files and clicking "add to archive" in the WinRAR group (the option might look different if you are using different software to compress files). I called my file "hide.rar".
3. Place the .rar file and your image (mine is called skydive) into the folder from step 1
4. Open the command prompt
To do this press the Windows key + S then type "cmd" and press enter

5. Use the command prompt to get to the folder with the files and picture. 
6. Type "copy /b (your picture) + (your rar file) (new picture OR old picture)" then press Enter
    I would type copy /b skydive.jpg+hide.rar secret.jpg 

* If you want to hide the files into the original picture, use the original picture's name but if you want to, make a copy of the original picture and keep the files in that copy. Just type a new name with the same file type as the original picture. I decided to make a copy and named it secret.jpg. Make sure you keep file types consistent when making new files. 

If all went well, you will see a message that reads  "(your picture) (your rar file) 1 file(s) copied."
Now if we look at the folder, we will see a new jpg called secret. It is not obvious just by looking at the file, but our rar file is hidden in that picture.



To retrieve the hidden files, use WinRAR to open the file. You can do this by right clicking the file and selecting "open with WinRAR." After that, you can uncompress the .rar file and view your documents. 

Comments (2)

Rich RumbleSecurity Samurai
Top Expert 2006

Rar and Jpg are about the only compatible ways to do this now, used to be Gif and Zip.

Again this used to be true for ZIP, but is no longer (link above)
"There are two tiny facts about GIF files and ZIP files you might like to know about: GIF files have their length defined at the start of the file; any bytes after are ignored. ZIP files have a table at the end; anything at the start of the file is ignored. The result is that a file can be both a GIF and a ZIP, just change the extension."
Also note that when doing this (Rar+jpg), 3rd party programs do not understand the RAR file, only WinRAR can open the RAR file, not winzip, 7zip, or others.


Thanks for the extra info Rich.

Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.