Steganography sec250 FA 2022 (1)

Steganography – hiding data

Data can be hidden in many ways. A common way is to embed the data somehow into an image.

This activity is designed to give you some experience with Steganography

  1. Appending text to an image

One simple method is to combine an image file and a text file into a bigger file.

Find a small image on the Internet and open it in MS Paint. Save it as a 24bit bitmap (bmp) named image.

Record the file size :

Using Notepad, create a small message you wish to encode into the image.

Save it as message.txt

What is the file size?

Open a CMD window and combine the two using copy.

This uses the /b , binary option and + for joining files.

First be sure image.bmp + message.txt are in the same folder and ensure the focus of your command prompt is in that folder. (You can use the cd command in the command prompt to do this, or you can open the folder in file explorer, highlight the path in the location bar and type cmd)

copy /b image.bmp + message.txt stego.bmp

Open stego.bmp with Paint. You should still see the image

Open it with Notepad. At the bottom/end is your message.

This is simple and clever and hides the message inside an image file. However , the text is still visible in it’s normal form and the file size changed

Deliverables

Note: when asked to submit an image you must upload the actual image. If you insert or copy into a word processor the message will almost certainly be lost.

Take a snip of the bottom/end of notepad showing your message.

What is the file size of stego.bmp?

How much has the file size changed from image.bmp?

What is the file size of message.txt?

To determine the sizes of these files to the byte, right-click on the file, and select properties. Report the Size of the file, NOT the Size on disk. Also, use the full decimal representation (i.e. 30,054) NOT 29.3k.

  1. LSB – Least Significant Bit

There are more complex ways of hiding data in images. In these methods, the data is encoded into pixels. The bits of the original file are modified, thereby keeping the file size the same. In a color image, the Red , Green, and Blue colors are each represented by a 1 byte number (0-255). Every byte is made up of 8 bits. However, not all of these 8 bits are necessary to (for example) define if a pixel of an image is red or white. The least significant bit (LSB) has little effect on the actual color we see. For instance , if it was 129 (10000001) , we could not see the difference between 129 and 128 (1000000).

To try out this method, use http://manytools.org/hacker-tools/steganography-encode-text-into-image/

The image file you use should be small (<200KB) Find a small image on the internet or use the previous image

Place your text in the upper window and select your Host image file with the lower selection button. Then hit the Steganogra-fy button and download your new file.

Send it to a neighbor via email and let them decrypt it.

To decrypt , you load the image using the host Image selector and check the decrypt box below that, the hit Steganogra-fy button again.

Deliverables

Submit the encoded image

To Lean More

Data can also be encoded into music and video.

Further description and images can be found here. http://petapixel.com/2015/08/07/a-look-at-photo-steganography-the-hiding-of-secrets-inside-digital-images/.

And here

http://www.forensicswiki.org/wiki/Anti-forensic_techniques

Last updated