HOW TO HIDE A DATA INSIDE AN IMAGE


HOW TO HIDE A DATA INSIDE AN IMAGE


STEGANOGRAPHY

In this blog im going to tell you how to hide a message inside an image.
Requirements:
Before going to the procedure lets take a look ,

A) How does steganography work?
There are several methods for hiding data inside regular files. One of the most common and easy to understand is a method called LSB.

> It changes the last few bits in a byte to encode the message. This is especially useful when working with images where the red, green and blue colors of each pixel are encoded using 8 bits or 1 byte from 0 to 255 in decimal or in binary from 00000000 to 11111111.

> Changing the last two bits in a completely red pixel from 11111111 to 11111101 changes the value of red from 255 to 253. For the naked eye, this difference is imperceptible, while the message will be encoded inside the picture.



𝕃𝔼𝕋𝕊 𝕊𝕋𝔸ℝ𝕋 :


1) Embedding hidden data/message in a file
Using Steghide tool is very easy. To install the application through the kali-Linux terminal, use the apt command .

apt-get install steghide

2) When the program is installed, enter the following command to embed data in a file:

  • steghide embed -ef secretFile -cf coverFile -sf outputFile -z compressionLevel -e scheme

🦑 The above arguments follows:

  • -ef specifies the path to the file you want to hide. You can embed a file of any type in another file, including Python scripts and shell files.
  • -cf is the file where the data is embedded. Supported file types are BMP, JPEG, WAV, and AU.
  • -sf is an optional argument that defines the resulting file. If you do not specify it, the original file where the data is inserted will be overwritten with the new file.
  • -z determines the compression level between 1 and 9. If you do not want to compress your file, use the -Z argument.
  • -e specifies the type of encryption. if you wish to put a password for the file you can specify the password while the process. If you prefer not to use encryption, type -e none.


> In this example, im going to hide the text/message inside the cat image. The original file is not overwritten or compressed,here encryption is not used.

steghide embed -ef secret.txt -cf StegoCat.jpg -e none -Z

> An example of working with Steghide through a terminal

🦑 When you run the Steghide command, you will be asked to set a password, which will later allow you to unlock the embedded data. Enter the password twice to confirm. After that, you can hide the data in image and audio files.

> Comparison of the original image and the image with the embedded text. The difference cannot be determined.

3) Retrieve hidden data from a file
Retrieving hidden data from a file is even easier than embedding the text.The following command applies:

$ steghide extract -sf stegoFile -xf outputFile

> displayed in the terminal window.

After entering the command, you will need to enter

Hiding information in images is very simple.
  • The benefits of steganography are that you can hide data right in front of other people's eyes, but they will not see it. The minimum difference in the files is not visible by eye, at least if you do not look closely under the microscope.

Post a Comment

0 Comments