Hiding a file in an image in Windows

Published:
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.
 

HIDING THE FILES


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".
step2.png
steptwo.png
3. Place the .rar file and your image (mine is called skydive) into the folder from step 1
step3.png
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. 
step5.png
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."
step6.png
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.

last.png

RETRIEVING THE HIDDEN FILES



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. 
 
5
1,671 Views

Comments (2)

Rich RumbleSecurity Samurai
CERTIFIED EXPERT
Top Expert 2006

Commented:
Rar and Jpg are about the only compatible ways to do this now, used to be Gif and Zip.
https://www.cs.cmu.edu/~dst/DeCSS/Gallery/Stego/

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.
-rich

Author

Commented:
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.