Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
December 9, 2022 07:05 pm GMT

Steganography : Hide text within an Image file using steghide.

Steganography is the practice (or art) of hiding secret messages in plain view.

Take an image file of a flower, for example. Opening the file shows a flower. Whoopie. However, there might be a hidden message encoded inside the bits and bytes of the image data that is not visible unless certain software is used to decode it.

The same can apply to text files. You could write an innocent readme.txt file that looks like any other text file of instructions when opened normally. With steganography, you could encode a secret message within readme.txt that includes game cheat codes, secret contact information, a cookie recipe, ASCII art, or whatever else you wish to convey to your accomplice who receives the file.

What is steghide ?

steghide is a command line utility available on *nix like platforms. It allows us to hide textual contents inside supported image file.

How to hide text using steghide ?

Let us finally see how we can actually hide our super confidential text using steghide.

First of all create a text file and download an image from an internet.

Text file

Image description

Image

Image description

Image description

Run the command below to encrypt and append the data. You will be asked to type a password twice.

steghide embed -cf <image_file> -ef <file_with_confidential_text>

The -cf option is short for --coverfile which specifies the targeted image file. Whereas the -ef option is short for --embedfile which is the file which needs to be hidden.

Image description
Image description
Here we successfully hide the text file inside our image.

How to extract hidden text using steghide ?

Now that we have appended our text in the file in the section above. Let us see how we can actually retrieve the file from the image.

Now that we have the file let us run the command below to extract the data from the image file. It will prompt for password which you have used to encrypt the text.

In order to extract the textfile from the image ..
lets delete the original text file first

Image description

steghide extract -sf <image_file>

Code language: Bash (bash)
The option -sf is short for --stegfile which is the file which holds the appended data.

Image description

We have successfully extracted the encrypted information from the image.

Image description


Original Link: https://dev.to/shankarsurya035/steganography-hide-text-within-an-image-file-using-steghide-4md9

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To