author photo

How to hide files within an image

February 20th, 2009 |Ajay M | 4,762 views | Featured, Tips and tricks, Windows | Comments (20)

There are quite a lot of methods of encrypting files in the PC and transmit it over the web through e-mails or through different storage media. But the simplest of all without using any encrypting or decrypting tool or without any complex algorithm is to hide the files within an image. And this can be done using the DOS command prompt of Windows. Though this method has it’s pros and cons which we will discuss at the end, it is by far the best method if you do not want others to know what kind of files are carrying.

This encryption method utilizes the command prompt and the copy command in DOS and by using a switch /b it converts virtually any file type into an image. The method is very simple and takes less than 30 seconds. Here are the steps:

- Create a folder on your desktop say Test.

- Put all the files you want to hide inside this Test folder. Say we want to hide file1.txt, file2.mp3 and file3.swf inside an image called wallpaper.jpg. So you need to put all these files inside the Test folder.

hide-files

- We will need winrar or any file compression utility (required to put multiple files into a single file)

- Create a rar archive of all the files (file1.txt, file2.mp3 and file3.swf) into a single file, say we name it as single.rar

all-files

single-rar

- Now we will hide this single.rar inside the wallpaper.jpg file.

- Click on Start and Run and type cmd, click on Ok to open the command prompt in Windows XP.

- Click on Start and type cmd in the search box and hit enter to open the command prompt in Vista.

- In command window, change the directory to the Test folder. Generally the command prompt opens to the user directory. So in command prompt use Cd desktop to go to the desktop folder and then CD Test to go to the text folder. Now we are in our working directory.

- Here type the following command:

copy /b single.rar + wallpaper.jpg encrypted.jpg

final

Single.rar is our combined files in rar format and wallpaper.jpg is the image file where we are going to hde the single.rar file. encrypted.jpg (you can use any name of your choice) is the resultant image file that contains the rar file.

The switch ‘/b’ indcates that we are performing the binary copy.

Using this method we can hide virtually any file type like rar, swf, mp3, txt, exe etc within an image. The image file may be a jpg, png, bmp or gif.

hide-files-proof

Now,  when we double click on encrypted.jpg the file will be open in the default image program. So how are we going to see the rar file that we embedded? well, to see the rar file, just rename the encrypted.jpg to encrypted.rar and you can see the content of the single.rar file.

Advantages:

- Supports hiding any file type withing an image.
- No additional tool/software is required.
- Less time and resource consuming.
- You can hide an exe file into jpg and send it through e-mail like gmail, which does not support sending exe files.

Disadvantages:

- It is not a good method for encrypting any important (top secrets) data.
- The resultant image does not open when a file of higher size is hidden inside it.
- Computer forensic tools like EnCase can easily read the file header and determine the true nature of the file.

If you enjoyed this post, make sure you subscribe to my RSS feed!
Loading

There Are 20 Responses So Far. »

  1. Actually, this technique is called Steganography

  2. hey thanks man, that is a very nice thing.
    do you know we can hide data in a folder which is not shown only by using some key strokes

  3. Hi that’s a good idea certainly for sending files via email, .zip files sometimes get blocked. I tried making a zip file renaming it to .jpg then converted back to .zip and sure enough all the files were intact. On a different not, Not sure if you have heard of Woopra, but just discovered it and may be worth you having a look.

  4. The info you have given here really makes my head spin, keep it going

  5. So if we don’t change the name of the file to .rar or .zip we cannot see the content of the image by double clicking on it?

  6. Very interesting article. I’m amazed at what can be done with a simple image file.

  7. Cool tip. Thanks for sharing. Always good to know.

  8. Haha, that is awesome…. I love techie stuff like this. Makes you feel like a little hacker even though its such a novice trick.

    Should be fun to use on my friends and family.

  9. I am very much aware of Woopra and using it currently.

  10. if you will be more specific about what exactly you want, I think I have a solution for you.

  11. another nice handy tips..
    I still remember the days where I used to modify the header hex to prevent people from opening my files in their right formats, people thought they were corrupted and I just corrected them when I needed them.

  12. That was news for me. But could be a very good idea to avoid spam-filters.

  13. this is useful trick. i hav tested it before. only way ordinary users can suspect is looking at the file size. the file size remains the same as the original which is far bigger than common image size in most cases.

  14. Thats something to think about and very interesting. Thank you for sharing this information:))

  15. Is there a way to send the email so that an exe file starts when opened? I bought a laptop and my son is now using it for school. I think he may be using for something he shouldn’t. I don’t want to get into that but I would like to add a keylogger. He knows more about computers than me and has it password protected and with him all the time. Email without him knowing is my only thought. Any help? You can mail me direct at MrJuice90@yahoo.com Thanks

  16. I think this could be very useful especially for e-mailing. Thanks.

  17. Cool tip. Thanks for sharing. Always good to know.

  18. that’s a nice tip i need to try it myself, thank you for sharing and good luck at your next posts Ajay!

  19. Great, I have follwed your instructions, it works
    You have really made my life easier. In fact i couldn’t send an exe file via Gmail, that doesn’t support sending exe files. I was searching for a software that supports this feature but didn’t found a free one.
    I’expecting more useful tips from you.
    Sorry I can’t write in spanish because I’m learning it just since 6 monthes, I hope you understand it.
    keep up blogging.

  20. Great tip. Thanks for sharing. actually I have find this tips for a long time and find it here. Happy to found your blog.
    Thanks.

  • Announcement

    Now you can write for Techie Zone and get noticed by readers and other bloggers

    Write for us

  • Advertisement

Free Business and Tech Magazines and eBooks

  • Visitors

  • Sign up for News Letter

    Interested in staying up to date with the latest technology news and tips on your online journey? Just fill out the form below to be updated!

    Google Reader or HomepageAdd to My Yahoo!Subscribe with Bloglines Add to netvibes Subscribe through SMS

    counter Programming Blogs - BlogCatalog Blog Directory . Visit blogadda.com to discover Indian blogs monitor site