75

I recently came across an odd JPEG file: Resolution 400x600 and a filesize of 2.9 MB. I got suspicious and suspected that there is some additional information hidden. I tried some straight forward things: open the file with some archive tools; tried to read its content with an editor, but I couldn't locate anything interresting.

Now my questions: What else can I do? Are there any tools available that analyze images for hidden data? Perhaps a tool that scans for known file headers?

3
  • 2
    I agree that is strange, but keep in mind it might have been encoded with very lax JPEG settings.
    – Konrad
    Feb 14, 2011 at 15:59
  • 2
    Not an answer to the asked question, but to the actual situation you had: It might not be hidden data, but hidden binary code, e.g. GIFAR. See also http://security.stackexchange.com/q/600/33.
    – AviD
    Feb 14, 2011 at 19:15
  • 2
    @Konrad, I doubt it. Even at three bits per pixel (24-bit color), a basic bitmap would be only approx 720,000 bytes. (400*600*3). I'd bet a trip to the Chinese buffet that there's something there not related to the obvious image. @Chris: Please post your findings, or even the file if you'll part with it.
    – pboin
    Feb 15, 2011 at 20:57

5 Answers 5

53

To detect Steganography it really comes down to statistical analysis (not a subject I know very well).
But here are a few pages that may help you out.

6
  • 11
    A small matter of semantics, here: Steganography on its own isn't encryption, it's obfuscation. While the hidden data may in fact be encrypted, it is not a necessary part of steganography for it to be so.
    – Iszi
    Feb 14, 2011 at 16:12
  • 1
    You are right Iszi I'll correct that. Feb 14, 2011 at 16:13
  • 1
    Another vote for Stegdetect here. It works really well.
    – Rory Alsop
    Feb 14, 2011 at 17:54
  • 1
    Does Stegdetect still work or is it broken? i'm getting lots of compilation errors on ubuntu 14.04
    – razzak
    Sep 1, 2014 at 0:43
  • 1
    Stegdetect isn't continued any longer and the homepage is down.
    – AdHominem
    Feb 11, 2016 at 11:38
15

I'll second the reccomendation for Stegdetect: here's another good source for information http://www.outguess.org/detection.php as well as downloads for stegbreak and XSteg

You can go right to the source for the research on this if you're interested; Neil Provos's page is here http://www.citi.umich.edu/u/provos/stego/

12

There's some great general references in the other answers here, so I'll just give some input specific to your situation:

When hiding data in pictures without changing the file size, you put it in the low-order bits; this can be detected by opening in an editor with a histogram and looking for jagged edges. But this sounds like a concantenation of a file to the image; *chan denizens often use this technique for distributing illicit files. Looking for file signatures after the first one--say, using 'grep -a' with a list of known filetype magic numbers--should reveal this technique. The combination of encryption and steganography is beyond the scope of this comment :D

1
  • encryption and steganography are not really required to hide from this kind of search. one could compress all stuff into *.tar.gz archive for example, then remove its header (the part which doesn't contain any information which is really needed to decompress it back). Oct 6, 2015 at 12:22
6

It's probably just a file appended to the end of the JPEG. Look for the EOF or the start of a known header such as PK RAR PE etc

4

Please note that my comment below is regarding LSB (Least Significant Bit) steganography and not jpeg (DCT) or appended data steganography.

"Steganography doesn't modify the file size significantly" this is incorrect. If I take a jpeg compressed image and apply LSB steganography then the resultant image size on disk will increase 'significantly' since images using LSB steganography MUST be saved in a lossless format such as bmp tiff or png. I have written software that takes any image format (such as jpeg) and hides data within it and saves out to png. It is often the case that I can open a jpeg of size 60Kb and be able to hide over 100Kb of data within it. The resultant png would look identical to the original jpeg but have a file size of 800Kb+

When analyzing images for LSB steganography content you MUST have either the original image for comparison OR have knowledge of the encoding method. Without either of these you will NEVER determine if an image contains hidden LSB data. Consider there there are a multitude of ways to implement LSB steganography and an infinite number of images to choose as a source, it's no trivial task to determine any steganographic content. That said... ALL images containing LSB steganographic content must be saved lossless (without compression). Therefore they may stand out as larger in size (bytes) than might otherwise be expected. Jpeg is a lossy algorithm (even with 0% compression) which is why images using LSB steganography cannot be saved as jpeg images, therefore your large jpeg image is unlikely to hold LSB steganography, however this does not rule out other steganographic options.

2
  • 2
    You can detect LSB steganography through statistical analysis if you know the LSB pattern typical of the image source. For example, if the image is a cartoon with large areas of solid color, you know something's up if the LSB varies from pixel to pixel. Similarly, if the image is from a camera with a bias in its pixel values, a uniform distribution of LSB values is an indication of steganography.
    – Mark
    Aug 21, 2014 at 1:44
  • 3
    this is wrong. one may encode secrets directly in DCT coefficients of JPEG, and pack the result as usual Jul 1, 2017 at 6:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .