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.

hide file in jpg

  • 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”.

add to archive

  • Now you should have a folder that looks something like this with files, a JPG image, and a compressed archive:

hidden rar

  • 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“.

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:

hide files in jpg

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.

winrar

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

Comments

66 Responses to “How to hide files in JPEG pictures”

  1. Jimmy said on :

    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.


  2. akishore said on :

    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.


  3. po3tree said on :

    Neat trick. Worked just fine for me using using WinZip. I was able to open the jpg archive using the “Open With” function. Thanks.


  4. Jonoro said on :

    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?


  5. Puhazh said on :

    It will work fine with WinRAR


  6. xumxum said on :

    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.


  7. Me said on :

    If you are using a NTFS file system you should look at Alternate Data Streams also.. http://www.heysoft.de/nt/ntfs-ads.htm


  8. Juan said on :

    Something like this for Linux? thanks.


  9. Peter said on :

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


  10. L7D said on :

    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.


  11. no_one said on :

    @Peter
    I think its
    JPEG header
    JPEG data
    JPEG end
    +
    RAR end
    RAR data
    RAR header

    Great tip BTW. Works great with 7-zip


  12. Adrian Leslie said on :

    If anyone makes changes to the .jpg file using MSPaint, anything you attach to the end of the .jpg gets wiped out.


  13. Adrian Leslie said on :

    However, I was wondering if .mpg, .wmv, and .avi files might show promise instead of .jpg files.


  14. DigitalMind said on :

    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!


  15. astaswastika said on :

    yeah this works man..
    and this is very simple..

    thanks!


  16. Richard said on :

    Pretty nice trick! Works with WinRAR.


  17. Allan said on :

    This is brilliant! Alternate Data Streams being put to awesome use!


  18. kurt said on :

    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.


  19. Johnny_Tsunami said on :

    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.


  20. Johnny_Tsunami said on :

    I can confirm that my technique does in fact work. Damn, I’m good.


  21. Abhishek Sagar said on :

    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.


  22. Mandeep` said on :

    it wrks….

    thnx a lot for sharing this…

    :)


  23. Husla3x said on :

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


  24. Angel said on :

    Nice trick… :-)


  25. hmm said on :

    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)


  26. Cforce said on :

    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 :D


  27. xenomorf said on :

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


  28. xenomorf said on :

    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.


  29. zerosteve said on :

    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!


  30. Dacia said on :

    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!!!


  31. john said on :

    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.


  32. kpl said on :

    Is there a way to divide those files back?


  33. Richard Fdisk said on :

    Don’t forget to delete the originals after, or they’ll all still be in the folder together with the new file


  34. DEADcamel said on :

    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.


  35. skillmachine said on :

    I made a zip file using TugZip and it worked perfectly fine. p.s. i recommend tugzip
    great program!


  36. Obama said on :

    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.


  37. John Davis said on :

    Ultimate Anonymity ( http://www.ultimate-Anonymity.com ) offers a super cool program that will let you hide files within images.


  38. Marcus said on :

    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.


  39. SiCC said on :

    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.


  40. chak2007 said on :

    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


  41. Yo_mama said on :

    Confirmed it works in WinRAR with smaller .jpg sizes, but not with large .jpg sizes (1700×2338 size .jpg did not work).


  42. ubersoldat said on :

    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


  43. rob said on :

    now i’m all paranoid… if i wrote this article i would have hidden files in all the screenshot PNGs.

    great article. thanks.


  44. mallchin said on :

    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?


  45. abc said on :

    PowerArchiver confirmed to work.


  46. Dan Jones said on :

    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


  47. john said on :

    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.


  48. computerninja said on :

    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.


  49. thetrilogy said on :

    Any ideas how to do this with terminal in os x?


  50. mallchin said on :

    OSX will work the same as Linux


  51. Robert Sander said on :

    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.


  52. sixtimes said on :

    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.


  53. Andy said on :

    - Absolutely fantastic -


  54. nale said on :

    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


  55. Tux said on :

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


  56. Bruce Weaver said on :

    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?


  57. Marvick said on :

    Thanks a lot, real cool tips! It works for me, I use WinRAR.


  58. nale said on :

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


  59. Dzinepress said on :

    awesome tips with amazing tools.


  60. TechTac the Fresh makem said on :

    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.


  61. prashant said on :

    hey its working fine but how do I get the EXE file back out of the JPEG and run it!?


  62. 123 said on :

    Is there any other file type you can do this to other than jpegs?


  63. Thiha Soe said on :

    Oh! Surprise…I had never thought to hide files like that. I really want to thank you!


  64. ariel said on :

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


  65. goldenchild said on :

    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.


  66. Hellebender said on :

    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!


Please post your comments/suggestions!