How to hide files in JPEG pictures
Posted on April 16, 2008 at 5:34 am
If you’re looking to hide files on your PC hard drive, you may have read about ways to encrypt folders or change the attributes on a file so that they cannot be accessed by prying eyes. However, a lot of times hiding files or folders in that way requires that you install some sort of software on your computer, which could then be spotted by someone else.
I’ve actually written quite a few articles on how you can hide files and folders in Windows XP and Vista before, but here I’m going to show you a new way to hide files that is very counter-intuitive and therefore pretty safe! Using a simple trick in Windows, you can actually hide a file inside of the JPG picture file!
You can actually hide any type of file inside of an image file, including txt, exe, mp3, avi, or whatever else. Not only that, you can actually store many files inside of single JPG file, not just one! This can come in very handy if you need to hide files and don’t want to bother with encryption and all that other technical stuff.
Hide File in Picture
In order to accomplish this task, you will need to have either WinZip or WinRAR installed on your computer. You can download either of these two off the Internet and use them without having to pay anything. Here are the steps for creating your hidden stash:
- Create a folder on your hard drive, i.e. C:\Test and put in all of the files that you want to hide into that folder. Also, place the image that you will be using to hide the files in.
![]()
- Now select all of the files that you want to hide, right-click on them, and choose the option to add them to a compressed ZIP or RAR file. Only select the files you want to hide, not the picture. Name it whatever you want, i,e. “Hidden.rar”.
![]()
- Now you should have a folder that looks something like this with files, a JPG image, and a compressed archive:
![]()
- Now here’s the fun part! Click on Start, and then click on Run. Type in “CMD” without the quotes and press Enter. You should now see the command prompt window open. Type in “CD \” to get to the root directory. Then type CD and the directory name that you created, i.e. “CD Test“.
![]()
- Now type in the following line: “copy /b DSC06578.JPG + Hidden.rar DSC06578.jpg” and press Enter. Do not use the quotes. You should get a response like below:
![]()
Just make sure that you check the file extension on the compressed file, whether it is .ZIP or .RAR as you have to type out the entire file name with extension in the command. I have heard that some people say that they have had problems doing this with a .ZIP extension, so if that doesn’t work, make sure to compress to a .RAR file.
And that’s it! The picture file will have been updated with the compressed archive inside! You can actually check the file size of the picture and see that it has increased by the same amount as the size of the archive.
You can access your hidden file in two ways. Firstly, simply change the extension to .RAR and open the file using WinRAR. Secondly, you can just right-click on the JPG image and choose Open With and then scroll down to WinRAR. Either way, you’ll see your hidden files show up that you can then extract out.
![]()
That’s it! That is all it takes to hide files inside JPG picture files! It’s a great way simply because not many people know it’s possible and no one even thinks about a picture as having to the ability to “hide” files. Enjoy!
[tags]hide files, hide file in picture, hide file in pictures, hiding files in pictures, hide file in image[/tags]
» Filed Under Computer Tips
Related Posts
- Another way to hide files and folders in Windows XP
- How to hide files and folders in Windows XP – The easy way
- How to create a secured and locked folder in Windows XP
- How to create an "Invisible" hidden drive in Windows
- Create HTML table listing of Windows directories and files
Comments
81 Responses to “How to hide files in JPEG pictures”
-
Pingbacks
-
How to Protect and Lock Folders in Windows Says:
[...] Hide Files Inside JPEG Images [...]
December 8th, 2009 at 5:44 am























There in fact is a problem with Winzip on reopening the jpeg file – so Winzip doesn’t work.
I tried 7-zip and it works – both zip and unzip. Thanx for this simple DOS tip.
Hi Jimmy, thanks for confirming. I tried and it had some issues, but I thought it could be a problem on my side. Guess not! Good to know that 7-zip works also..anyone else try a different zip program, then let us know if it works.
Neat trick. Worked just fine for me using using WinZip. I was able to open the jpg archive using the “Open With” function. Thanks.
Hey, Jimmy, how exactly did you get this to work with 7-zip? I’ve tried and tried and haven’t been able to split the files. My process(es) have been 1) change extension to .7z or .zip (tried both ways) to which I got the “invalid archive” error prompt 2) open with gives the same.
Any suggestions on that one?
It will work fine with WinRAR
works great, love the idea. tried with winzip. Don’t forget the /b switch in the copy cmd, without it I got a can’t open zip file, with it works like charm.
If you are using a NTFS file system you should look at Alternate Data Streams also.. http://www.heysoft.de/nt/ntfs-ads.htm
Something like this for Linux? thanks.
@xumxum
The reason it doesn’t work without the /b is because otherwise it is just the regular copy command. /b signifies creating a new file whose contents are those of the two (or more) combined.
@Juan
This is actually just a concatenation of two files.
Linux has a command cat to do just that:
$> cat f1 f2 > f3
I assume the reason this works is because the JPEG ends before the RAR starts:
The file contents are something along the lines of:
JPEG header
JPEG data
JPEG end
+
RAR header
RAR data
RAR end
The graphics program reads until the JPEG ends, and the RAR program searches for the RAR header and reads from there. Whether or not the de-compressor searches for the header (and doesn’t just start at the beginning) determines whether or not the file can be read.
I may be wrong though.
Always new that was possible… I never knew how, i just had to Un-encrpt (?) a file because there was a virus encrypted the same exact way to an installation file. devils.
@Peter
I think its
JPEG header
JPEG data
JPEG end
+
RAR end
RAR data
RAR header
Great tip BTW. Works great with 7-zip
If anyone makes changes to the .jpg file using MSPaint, anything you attach to the end of the .jpg gets wiped out.
However, I was wondering if .mpg, .wmv, and .avi files might show promise instead of .jpg files.
I used this trick for a mystery GEO-CACHE in my area. (I hid the coordinates as a text file inside a jpg picture filled with numbers, people are looking for patterns in the image even though it has nothing to do with it!)
People are having a hard time decoding it.
Thanks!
yeah this works man..
and this is very simple..
thanks!
Pretty nice trick! Works with WinRAR.
This is brilliant! Alternate Data Streams being put to awesome use!
I believe the /b is for binary, instead of text. That way it will use what is already there and not misinterpret unprintable chars or otherwise make changes.
I just had a sick idea. Would this work as a way to share files online? You could upload the image to imageshack or whatevs, and others could dl the file.
I can confirm that my technique does in fact work. Damn, I’m good.
This even works with exe files. I tried
C:\>copy /b bang.jpg + pu.exe some.jpg
bang.jpg
pu.exe
1 file(s) copied.
now the only thing i am trying to do is figure out how to get the exe to run in the background when the jpeg file is accessed.
it wrks….
thnx a lot for sharing this…
Really cool tip. I would never have thought of that one. I guess all these other guys can’t say thanks and would have thought of it.
Nice trick…
there is a easier way to hide files if you dont want to put them inside a jpeg and only want to hide them.
1. just put the files in a rar archive and enable password and encrypted file names in advanced tab. so nobody can see even the names of the files you want to hide.
2. then you can change the extension (maybe to .dll and put it in windows/system32 folder nobody will find them)
Has anyone successfully executed a .exe or .bat in the background while opening the picture?
This could be an awesome prank to hide a shutdown command inside the picture xD
hello.. i can’t get it right. after i finished with the copy in cmd, i tried to open my picture but it won’t open. it ‘the is either an unknown format or damaged’.
help me..
oowhh…sorry guys. my fault. it seems like larger size pictures don’t work. the first one i used was a picture with size 1600×1200. then i used a picture with size 600×900. the result is that I successfully combined and opened it using WinRar.
Thanks for the info.
If you use this technique in combination with encrypting and password protecting your archive then you can REALLY keep the files from other people. In winrar, if you dont have the password you cant even see the files. I LOVE this trick. Thanks!
Excellent. Had to send my laptop for service last week and didn’t want sensitive files visible. Since I have tons of photos on the hard drive, it was very easy to hide all those files inside various JPGs. Brilliant!!!
Dacia – It seems that Garry Glitter didn’t know about this trick.
If I wanted to hide pictures or anything else I would simply create a partition and hide it using Partition Magic.
As long as you don’t need to access it too often as it requires rebooting to view it.
If just a few pictures then use the old addage “the best place to hide an elephant is in a herd of elephants”. Simply alter the file extension to .dll and save it in the system directory.
Is there a way to divide those files back?
Don’t forget to delete the originals after, or they’ll all still be in the folder together with the new file
Hi there, I can see only one problem with this method and that is that people usually become very suspicious of a jpeg file that is over 10 MB or so.
I think it would be better to edit the first few seconds out of an avi file which is, for example part of a tv series and make it look like it is just another episode.
This way you can have the file just about any size that you want with out raising suspicion as video files can easily be just about any size.
I made a zip file using TugZip and it worked perfectly fine. p.s. i recommend tugzip
great program!
Actually, there are applications you can use to hide files which are not so obvious to other users. Secondly you can develop your own program using Visual Basic as I have, that is your best bet since whatever you create will not be a commercial software.
Ultimate Anonymity ( http://www.ultimate-Anonymity.com ) offers a super cool program that will let you hide files within images.
Nice tip! Something to add is that if you don’t want to type the entire name of the archive or image the cmd prompt does support tab completion so you can type dsc and press tab and windows will fill out the rest of the characters. However, If you have several pictures in one folder you will need to narrow it down by typing more of the file name before pressing tab.
Nice tip. Some people mentioned ADS [alternate data streams] as an alternative, but keep in mind they do not retain the alternate streams once sent across the Internet. At least this was the case last time I checked, but it has been a while since I have used Windows.
I used truecrypt to encrypt mmy files in AES/Sperpant/ and Twofish, in a cascade, then put them in the .jpg file. haha even the CIA would have a field day trying to figure that one out. Since both files combined are 5mb
Confirmed it works in WinRAR with smaller .jpg sizes, but not with large .jpg sizes (1700×2338 size .jpg did not work).
You can do this in Linux the same way.
1. Create the rar file
2. Do: $cat foo.jpg bar.rar > new.jpg
You get a jpg image. To get your files do
$rar l mypic.jpg
$rar e mypic.jpg
now i’m all paranoid… if i wrote this article i would have hidden files in all the screenshot PNGs.
great article. thanks.
This is much akin to gluing your copy of Playboy to the back of PC Weekly and hoping no-one reads past page 182.
All I can say is… can I borrow last weeks copy of PC Weekly?
PowerArchiver confirmed to work.
Very cool!
Here’s instructions for Linux users:
zip archive.zip file.to.hide1 file.to.hide2 …
cat image.jpg archive.zip > image2.jpg
# to replace the original image
mv image2.jpg image.jpg
# image still works as an image
display image.jpg
# To get hidden files back
unzip image.jpg
Is this how viruses can get in over port 80 from a website? I don’t know how they’d “run,” but I can see how they get in.
DEADcamel has a good point… a jpeg that’s too big is suspicious. I tried this technique with a WMV file however and it worked perfect. WMV still played in media player fine, and 7-zip still opens the file as an archive fine too.
Any ideas how to do this with terminal in os x?
OSX will work the same as Linux
If you really want to hide something, you have to use steganography (http://en.wikipedia.org/wiki/Steganography) combined with encryption.
The above method is very weak.
I have my folder (with image and txts) in an external hard drive. How would I access the root directory in the command prompt? F Drive, for instance.
- Absolutely fantastic -
Actually you can hide any type of file inside any other type of file, not just JPG.
I’ve just added a rar file to a small exe application…and the application works fine after the process! Also, changing extension from exe to rar will open the compressed file inside the exe!
bye
@Robert Sander: Yes, this is a very weak way to hide a file, from the point of view of a computer power-user. This method will work, however, against less experienced and knowledgeable users.
If you really want to hide something from someone using this method as part of your steps, you’re going to want to encrypt and password-protect the files as well. There were some suggestions in previous comments about using the features of WinRAR. I think that’s good advice to cover yourself fully.
Hello,
The command appeared to work but it came back with “Access Denied”. I think my Administrator Settings may be wrong but I’m not sure. I also don’t know how to change them. I’m using Vista. Can you help?
Thanks a lot, real cool tips! It works for me, I use WinRAR.
@Tux: So, it seems you are a power user then. My question is: Do you keep checking exe files (and other file types) to see if there is something hidden inside of it? Maybe not, I guess.
we are talking here about a simple way to do that, so for the power-users that want encryption and other “advanced” options, this is not he right place to comment.
Finally if you are going to add encription and password protection to the file, so there is no need to hide anything inside a JPG file at all, just zip the file and add the password…I think average users know that already.
So my conclusion is: This blog (or whatever) is about “How to hide files in JPEG pictures” nothing else…and I think the site has achieved what is expected for it.
awesome tips with amazing tools.
WIN ZIPith and open?
sooo u used winzip.
your file looks a little diffrent once made than Hidden.rar
to be sure first check the image size.
then run the command as follows:
cd \
cd Test
copy /b DSC06578.JPG + Hidden.rar DSC06578.jpg
This is all still the same up until it is time to open it.
First make sure the file has gotten bigger.
Now open CMD back up as before and run these commands:
cd \
cd Test
unzip DSC06578.JPG
The files are now open.
hey its working fine but how do I get the EXE file back out of the JPEG and run it!?
Is there any other file type you can do this to other than jpegs?
Oh! Surprise…I had never thought to hide files like that. I really want to thank you!
awesome tool. but how do i undo it to get back the original jpg file size? forgot to make a copy of the original jpg file.
This will not work for “certain” images… There is a common chance that certain images contain what looks like PK or ZIP or RAR data. These specific images will give you the results you see with errors.
Unfortunately, it is a matter of trial and error. Don’t assume this will work with every 800 x 600 image, because it worked with another one. It depends on the contents of the image.
For those who know about reading headers, you can simply look for a binary match of any ZIP header in the file. Abort the use of that image if it does contain the same sequence of header info.
There is actually a program that is also an image, and even a long, “Primary number” that is also a program too. (Just requires notepad to make the program with that primary number.)
That is a good way to cause all sorts of trouble… just rename all your files to EXE and try to run them! LOL.
Try unzipping some of your images that don’t have zips added to them. Many will actually unzip, but contain garbled files and data. Don’t use those for zipping, or you will be in for a real unwanted surprise!
hey this is an awesome way to hide files. One problem, how do i extract the files from the image to be able to use them again, i tried the command – from above to open them, but ‘unzip’ is not recognised by windows as a command.
Grateful for your help.
So…this is a great technique if you would like to hide small files..however larger files..not such a good idea. It becomes quite obvious when you have a 12MB jpeg file. There is something simple you can do using winrar to hide larger files. pack your file into a .rar file..make sure to use the encryption and compression features. Once the .rar file is created…simple change the extension to an extension of your choice…such as .dll.
Rename the dll file to a not so obvious name, but something easy to remember. Then simply bury the file in a folder of your choice that contains multiple dll files.. or files of they type of extension you named. So not only would the person have to know the file name…and that the dll file is really not a dll file..but they would also have to know what to change the extension back to…AND then they would also need to know the password to unpack it. Have fun!
Thanks for sharing, It is a neat trick.
For all those asking about more security, either don’t have the sensitive material on that comp or else burn or transfer to flash drive and hide behind the pic of your grandmother.
…Or you can just use this nifty utility Concealar to hide files:
concealar.googlepages.com
thanks for the trick … but i can’t see the picture after the hiding of the file … it says no preview available
awesome trick,i just love it and its not just with this post i love each and every post of yours.
thank you
Great suggestions and examples, especially for a newbie like myself who lacks a natural sense of web design.
oh..!!..That a serious trick..!!..Loved it ..! its very good trick to hide your important doc’s in a jpg..!
if worried about file size, you could always hide the file in a working photoshop pic/file which would account for having a lager file size
thanks for this article about hiding files inside pictures, after surfing the net for a long time, I found what I wanted. thanks again.
Its a great trick…!!!
This can be used to attach EXE files hidden behind an image and then send it via GMAIL… which don’t allow sending of EXE files through the mail!!
This is a good idea. I have another, this only works in windows. First, in windows go to ubuntu.com and download the iso. after it is done downloading, burn it to cd at the lowest burn speed. after it is done, restart the computer with the newly burned disk in the drive. Right at POST press to bring up the boot manager select the cd drive. at the next screen just press twice.
Once you are in linux, mount the drive with your hidden files on it. Go to the folder called: System Volume Information, and make a new folder called hidden. go to where your files and press and go back to your hidden folder and press . Restart the computer with the disk put away in a safe place, and try to open the System Volume Information folder in windows, guess what? You can’t!
The folder has the file record on it. As long as you don’t mess with any files other than your own in that folder, your files will be uncorrupted. Don’t let anybody use the disk that you made, though because it has the power to look at the files that you want hidden.
Thanks i could not do it with winRAR but it worked with 7-zip thanks a lot for the tip
:D:D:D:D
I’ve got problem with WindowsRar and the .rar format but I packed Hide.rar in the .jpg and renamed it to .7z and it work like a charm!
This is the coolest trick I have ever heard of!! Thanks for sharing man…