We hide the secret in the picture. Steganography

6 May 2023 3 minutes Author: Cyber Witcher

How to hide an archive in a picture on Linux with built-in tools

Steganography is a method of transmitting or storing information, taking into account the secrecy of the very fact of such transmission (storage). It allows you to hide sensitive data inside files with open information, as well as to introduce labels into secret documents, by which systems such as DLP will be able to detect and stop a theft attempt. Using steganography, the message will look like something else, such as an image, an article, a shopping list, a letter, or a sudoku puzzle. Steganography is usually used together with cryptography methods, thus complementing it. The advantage of steganography over pure cryptography is that messages do not draw attention to themselves. If the file can’t be opened so easily, it probably has something valuable in it. Therefore, it is important to hide the very presence of secret information. Messages, the fact of encryption of which is not hidden, arouse suspicion and may be exposed by themselves in those countries in which cryptography is prohibited. Thus, cryptography protects the content of the message, and steganography protects the very fact of the presence of any hidden messages.

The easiest way to do this is to dissolve sensitive data inside some harmless file. Such a task is solved with the help of steganographic utilities. An available method of steganography is the so-called RARJPG. PNG and JPEG files are complex containers with data streams inside that stop being decoded when the end-of-file marker is counted. And the RAR archiver, through self-extracting archives, starts decoding only when it reads its signature in the file. Therefore, binary gluing of JPG and RAR allows you to create a file that is understandable to both graphic software (browsers, viewers, editors) and the archiver – it is enough to change the image extension from JPG to RAR. Such a file can, for example, be uploaded to image sharing services. The article will discuss exactly this method of hiding information in a JPG file. You will learn how to hide some information in an ordinary picture.

We hide a secret

So, first, let’s look at the scheme of this method: secret.txt is the file that we need to hide. That is our secret.

Next, we place it in the secret.zip archive, and the archive itself in the picture picture.jpg and at the output we get the file secret.jpg – a normal picture, but which can be unzipped and the secret file can be extracted from it.

1. To begin with, we look for a picture in which we need to hide the file:

2. We save it:

3. Next, create a secret file and place it in the archive:

4. Next, using the “cat” command, we create our miracle file:

5. Next, using the “cat” command, we create our miracle file. Other files, except the final one, are deleted.

Let’s reveal the secret

1. For this, it is enough to use the command to unzip the file:

2. And we get the result:

Other related articles
Found an error?
If you find an error, take a screenshot and send it to the bot.