Steghide Tool

arpit arora
6 min readDec 1, 2022

--

Today we’ll learn about Steghide. There are various steganography tools available but the part that differentiates it is that it uses a variety of algorithms to encrypt the data. Moreover, Steghide supports to hide data behind any image(jpg/jpeg/png/gif/bmp), audio (mp3/wav), excel, etc.

Introduction to Steganography

In digital steganography, electronic communications may incorporate steganographic coding inside of a transport layer, such as a document file, picture file, program or convention. Media records are perfect for steganographic transmission since of their expansive estimate. For instance, a sender might begin with a harmless picture and make few alterations to it in order to hide data, so that, this alteration goes unnoticed for someone who is not particularly seeking out for it.

The upside of steganography over cryptography alone is that the planned mystery message does not stand out to itself as an object of examination. Clearly obvious scrambled messages — regardless of how unbreakable — stimulate intrigue, and may in themselves be implicating in nations where encryption is illicit. In this manner, while cryptography is the act of securing the substance of a message alone, steganography is worried about hiding the way that a mystery message is being sent, just as disguising the substance of the message.

Introduction to Steghide

Steghide is a steganography program that is able to hide data in various kinds of image- and audio-files. The colour- respectively sample-frequencies are not changed thus making the embedding resistant against first-order statis­tical tests. Features include the compression of the embedded data, encryption of the embedded data and automatic integrity checking using a checksum. The JPEG, BMP, WAV and AU file formats are supported for use as cover file. There are no restrictions on the format of the secret data. Steghide uses a graph-theoretic approach to steganography. You do not need to know anything about graph theory to use steghide and you can safely skip the rest of this para­ graph if you are not interested in the technical details. The embedding algorithm roughly works as follows: At first, the secret data is compressed and encrypted. Then a sequence of positions of pixels in the cover file is cre­ated based on a pseudo-random number generator initialized with the passphrase (the secret data will be embedded in the pixels at these positions). Of these positions those that do not need to be changed (because they already con­tain the correct value by chance) are sorted out. Then a graph-theoretic matching algorithm finds pairs of posi­tions such that exchanging their values has the effect of embedding the corresponding part of the secret data. If the algorithm cannot find any more such pairs all exchanges are actually performed. The pixels at the remaining positions (the positions that are not part of such a pair) are also modified to contain the embedded data (but this is done by overwriting them, not by exchanging them with other pixels). The fact that (most of) the embedding is done by exchanging pixel values implies that the first-order statistics (i.e., the number of times a colour occurs in the picture) is not changed. For audio files the algorithm is the same, except that audio samples are used instead of pixels. The default encryption algorithm is Rijndael with a key size of 128 bits (which is AES — the advanced encryption standard) in the cipher block chaining mode. If you do not trust this combination for whatever reason feel free to choose another algorithm/mode combination (information about all possible algorithms and modes is displayed by the encinfo command). The checksum is calculated using the CRC32 algorithm.

Installation

Let’s start with the installation of steghide. In windows, we can download steghide from http://steghide.sourceforge.net/download.php. After downloading we have to simply unzip the files and use it through the cmd. In Linux, open your terminal and type the following command to download Steghide:

Command: apt-get install steghide

Getting Started with Steghide

To start Steghide, the most basic option we use the help command. This command will display us all the options that Steghide provides us.

Embedding Data in The Image

We hide data in the image using Steghide so that only the person who acknowledges it can read that. So, we made a text file named as user.txt in which we wrote our confidential data and image.jpeg is that file in which we are embedding our data. To achieve this, we’ll be executing the following command:

Command: steghide embed -ef <txt filename> -cf <media filename>

Here, ef and cf are termed as embedded file and cover file respectively.

Extraction of Data Via Steghide

Using Steghide adds an extra layer of security by allowing us to use a password for it. Now, to extract the hidden data use the following command: steghide extract -sf <media filename>

Password Protect Files

Now, we can also extract the files using the following command. This command is different is that it specifies a password in the command itself, therefore, we do not need to specify it separately.

Command: steghide embed -ef <txt filename> -cf <media filename> -p <password>

Retrieve Information of Embedded File

If we have an image that is suspected to have data hidden and if so, then which algorithm is used to encrypt the data in the file. Then we will use the following command: steghide info <media filename>

Verbose mode

To get each and every information of a file during its extraction, we can use the verbose mode. The verbose mode gives you the detailed information. We can use the verbose mode by executing the following command:

steghide embed -v -ef <txt filename> -cf <media filename>

Compression mode

Now if we want to compress text file before hiding it then we would use the following command. The compression level can vary from 1 to 9. The first level gives you speed to compress whereas, at 9th level, it will provide you with the best compression techniques.

Command: steghide embed -ef <txt filename> -cf <media filename> -z 2

Anti-Compression Mode

Now if we don’t want to compress a file before hiding it then we will use the following command: steghide embed -ef <txt filename> -cf <media filename> -Z

Embedding file without name

We can also hide a file without naming it. We will use this command:

steghide embed -ef <txt filename> -cf <media filename> -N

Encryption algorithm

We can encrypt the data that we are hiding by using encryption techniques. And this can be easily achieved by just using the following command:

steghide embed -ef <txt filename> -cf <media filename> -e <algorithm name>

Overwriting the existing file

When extracting the file let’s assume, we have already had a file in the same directory with the same name. then we can use the following command to overwrite the existing file if that is desired. And for this use the following command:

steghide extract -sf <media filename> -f

--

--