How to hide information with steganography in Ubuntu?

Steganography

Sometimes we need to encrypt highly confidential data on our systems so that no other person using our system can say that we have withheld information.

One way to do this is by hiding secret files and messages within other existing files, as images and audio.

This too it is very useful when you want to transmit a private message or send a file over the network to someone else without compromising your safety.

They can simply embed the confidential data, along with a password or passkey so that only a trusted person can open that file.

This type of encryption where you safely hide one file in another is called steganography..

Steganography is preferred over cryptography because later an adversary will know that something was hidden in a text or file. They can even break code and get information through hard work.

In Steganography, however, the third person would not even be aware of the fact that a seemingly harmless image or audio file carries a secret message or file embedded in it.

Installing Steghide on Ubuntu 18.10 and derivatives

Steghide is a command line utility that allows you to hide confidential data within various types of image and audio files.

Steghide works from the console on Windows and GNU / Linux, and it is an open source project that only occupies about 3Mb unzipped, and does not require installation, so it can be used on pendrives.

Although in this case we are going to install the latest version of this tool, You can do it by looking for it directly in the Ubuntu software center or from the terminal you can do it by executing the following command:

sudo apt-get install steghide

File encryption with steghide

To encrypt a confidential file, they need to have the file they want to encrypt and the image or audio file in which they want to hide it.

Steghide supports encryption on AU, BMP, JPEG, and WAV file types.

Steghide

Now to take an example we want to hide a file within an image. The syntax that we must use is the following:

sudo steghide embed -ef examplefile.txt -cf sample.jpg

In this case we are indicating that the file must be encrypted from the current folder to the current folder.

In case the initial confidential file is located elsewhere on your system, they must provide its full path.

Similarly, if your image file is located elsewhere, you must specify its full path via this command.

Basically the command is composed as follows:

sudo steghide embed -ef /ruta/de/archivo/a/ocultar -cf /ruta/de/imagen/o/audio/que/contendrá/el/archivo

Immediately after this, the application will ask for a password required to embed the confidential file.

This password is what will be used to extract or decrypt the file.

In this example, we have embedded a text file in a JPEG file. After the encryption is done, you can delete your initial confidential file and just keep the image file that will later be used for decryption.

File extraction

Now to extract the information hidden within the file, we are going to use the following command

sudo steghide -sf image.jpg

Where we indicate the path of the image or audio file that contains our hidden information, when doing this we will be asked to provide the password toDoing so will extract the information that we hide within the files.

How to uninstall Steghide from Ubuntu and derivatives?

Finally, for those who were not satisfied with the tool or simply want to eliminate it from their system, we can take the next step so that Steghide is completely eliminated.

We must open a terminal with Ctrl + Alt + T and in it we are going to execute the following command:

sudo apt-get remove steghide

And ready.

As a last comment, we can make use of Steghide along with some other tools such as cryptomator And even with OnionShare to be able to share the information within our files with other people in a secure manner.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.