I have a previous post on how to hide files inside an image file in Windows. If you have not read or watched the video yet, it is right here.
Anyway, a comment on that post gave a tip on how to do the same thing on Linux. Of course I tried it and it worked! According to Sebastian of mathemaniac.org, the concept here is really simple. An image file like JPG is read from the beginning of the file and terminated with an ‘End of Image’ marker. An archive file like ZIP has their metadata stored at the end of the file. Put them together and the image will be read as a valid image file and the appended ZIP file will be read as an archive.
Here is how to do it in Linux:
Get an image file and an archive of the files that you want to hide. In this example, I have cat beer_and_cig.jpg and hideme.zip file. The zip file contains an MP3 song that I have stored inside the archive. To create the archive-image file, run this command:
cat beer_and_cig.jpg hideme.zip > ucantseeme.jpg
What this does is the ‘cat‘ command reads the image file first, then reads the zip file and puts them together in the file named ucantseeme.jpg.
To test the integrity of the image file, try this:
# unzip -t ucantseeme.jpg
warning [ucantseeme.jpg]: 4751 extra bytes at beginning or within zipfile
(attempting to process anyway)
testing: Feist - 09 - One Two Three Four.mp3 OK
No errors detected in compressed data of ucantseeme.jpg.
Notice the warning message? The test saw that there were few bytes at the beginning, which means it saw the image file first but the archive is intact and no errors were found.
20 Comments to “Tip: Hiding Files Inside An Image in Linux”
Subscribe to Email Feeds
- Vim: How to Copy Multiple Lines
- Required Packages for Oracle 11gR2 on Red Hat Enterprise Linux 6
- How Replace Space with Newline in Vim
- 12 Little Things That You As An Ateneo Hearter Can Do To Help Your Country | Yoo Jin and Akeem's Blog on Bayanihan Linux: True Blue Pinoy Linux
- [RESOLVED]Can you do this in aspx page | ASP Questions & Answers on Tip: How to Decode CSR
- How to Add or Remove Library Path in RHEL | PinoyTux Weblog on What are Libraries in Linux?
- 博文：《RHEL4 安装yum》 - 苗乡小鱼的博客 on Howto: Install yum On RHEL 4
- Hiding Files Inside An Image in Linux | SACHIN JINDAL'S BLOG on Hide Files Inside An Image File