Again about steganography – overview of the steghide utility

Solution: Several steganographic utilities available under the GNU GPL license will help solve the problem.

The Debian distribution is simply an encyclopedia of the most diverse and extremely useful data manipulation utilities. And there are just a huge number of data hiding programs in it. Here is one of them – a small, but very sophisticated steghide utility for steganographic embedding of data into drawings or sound files.

Steganography – literally means “secret writing” in Greek. This is the science of the hidden transmission of information by keeping the fact of transmission secret. Unlike cryptography, which hides the contents of a secret message, steganography hides its very existence. The steghide program will be discussed further.

installation and operation

In order to install all the steganographic utilities that are in Debian, it took me 4Mb and a few seconds of waiting. With the help of a friend of all debtors, the apt-get install command, it was installed:

– outguess – Universal Steganographic tool;

– stegdetect – Detect and extract steganography messages inside JPEG;

– steghide – A steganography hiding tool;

– snowdrop – plain text watermarking and watermark recovery.

Which is more than enough for any paranoid citizens obsessed with the privacy of their data.

hiding data

I would like to mention the extremely detailed and explanatory steghide manual – a fascinating reading where the parameters are described in detail and briefly described how the program works and what algorithms it uses.

Having enjoyed reading enough, we proceed to directly hide our innermost data in some harmless drawing. For example, in such a (see Fig. 1).

When I was making out an employment contract, I was asked to write my brief autobiography – what is not confidential data? The file has been saved, so I will embed it in the picture – fortunately it is simple text, there is no formatting.

To do this, you need to type the command

$ steghide embed -ef autobio.txt -cf MacOS.jpg -sf MacOShide.jpg

That is, embed the file autobio.txt (key -ef, embed file) inside the drawing MacOS.jpg (the key is cf, cover file), as a result of which we have a drawing with an embedded stego called MacOShide.jpg (the key is sf, stego file). In this case, the program will ask twice for the password:

Enter passphrase:

Re-Enter passphrase:

embedding “autobio.txt” in “MacOS.jpg”… done

writing stego file “MacOShide.jpg”… done

Everything is ready, and in Figure 1 you see (that is, you don’t see 😉 my whole life path in a quarter of a century 🙂

In order to be able to read the hidden text again, we extract it from there:

$ steghide extract -sf MacOShide.jpg -xf autobio2.txt

That is, extract from the MacOShide stego file.jpg hidden information in a file autobio2.txt (the key is xf, extract file). The utility will be concise:

Enter passphrase:

wrote extracted data to “autobio2.txt”.

Done, the file is recorded.

a little research

Anyone who can read mana could learn the same thing by reading the example at the end of man steghide. But it became interesting to me how much the drawing has changed, not visually, but quantitatively. To do this, people engaged in image processing traditionally use the standard deviation between two images. Armed with an exhaustive article by Finap (Fienup, J. Invariant error metrics for image reconstruction, Applied Optics, 32, 1997, 36, 8352-57) and implementing it in MATLAB, we calculate the difference:

Yes, of course, we won’t see such a difference in the image, even if we look closely: the difference is only 0.32%! The differences between the images can be seen without much strain, somewhere at 3-5%.

And, of course, the checksum of the file has changed:

$ md5sum MacOS.jpg

da6d7d25d5560fb22eb9d2f6ca09417f MacOS.jpg

$ md5sum MacOShide.jpg

87a02d9714ed43f49d2aeb37c4e75d94 MacOShide.jpg

So, of course, there are changes, but very small – you won’t notice it by eye, so you can safely forward personal information by e-mail, even if it is viewed by an evil admin.