I was pointed to a video today, about how to "hide" files in JPEGs. It's a fairly simple step-by-step example on how to hide files within another file (though it does a few assumptions of know-how). It may seem a little strange that this process works, and it is the same way that the IRC.Bmp worm works. However, the reason is pretty simple. For a binary (i.e., not text) file to be "valid" in a lot of cases, it does not need to start in a particular way - as an HTML and XML file might - but it only needs to have a certain particular "header" within it somewhere. This header is used to indicate what kind of file it is, the length of the data involved and what it contains, or such information. These types of files follow a fairly specific structure, and thus it is possible to add data before or after the known structure - because a program looking for that particular information will only look at that particular structure, since that's all it needs. In other words, when you open that JPEG/RAR file shown in the video with WinRAR, all WinRAR looks for is where the information about this supposed archive is, and when it does, reads only the information it needs, ignoring the rest that's in the file. Similarly, when you view the JPEG/RAR as an image, the image viewer only looks for the JPEG header and image data, and displays that, ignoring the rest of the file. Using this method, you can easily hide files of different types (Putting two files of the same type won't work quite the same way!*) in each-other. There isn't much point to doing it (you might as well archive/compress them or encrypt them), but you can. * Although I haven't tried, I assume this would lead to the first or second file being completely irretrievable using conventional methods, which may also be your goal; You could then re-extract the file using, for example, a Hex editor.
(Comments currently disabled; Please comment on social media for now or using the contact form.)