How to Hide One Image in Another (An Introduction to Steganography)

164K5615

Intro: How to Hide One Image in Another (An Introduction to Steganography)

This instructible will demonstrate basic steganography by showing you how to hide one image in another.

For these instructions you will need:
Gimp
one image to hide,
one image to hide the other.

STEP 1: A Little Bit About Steganography

Steganography is the act of hiding information in something else. It is favorable over encryption because encryption only obscures the meaning of the information, steganography hides the very existence of the information, also, encrypted data tends to attract attention, which often proves fatal to any agent. This art (for lack of a better phrase) has been around for centuries, and has many forms, one common low-tech method is simple invisible ink, another, ancient method involved tattooing the information on the top of someone's head and allowing hair to grow over it. My favorite example is the artwork of Lord Baden-Powell, in which he hid the maps and plans of an enemy base in drawings of insects and leaves while posing as a naturalist.

The method i will show you hides an image by modifying each pixel in it's host. It only changes the least significant bits of each pixel, this means it makes tiny changes that are unnoticeable to a person.

STEP 2: Prepare the Image to Hide Part 1

In this step the image will be converted to 8 colors to reduce the amount of data needed to store it.

Open the image in gimp, and open the Palettes dialog box. (Dialogs > palettes)
Add a new palette, name it what you want.

STEP 3: Preparation Part 2

Add the 8 colors.
Double click on the foreground color and type FF0000 into the html box.
click okay
in the palette editor, click 'add from foreground'

do this for all 8 colors:

FF0000
00FF00
0000FF
FFFF00
FF00FF
00FFFF
FFFFFF
000000

Click save:

STEP 4: Preparation Part 3

Now we'll convert the image to a format you can hide.

Click Image > Mode > indexed

select 'Use custom Palette' and select the palette you created.
Enable dithering. i recommend Floyd-steinberg. (try both ones to see which works best, hit control-z to undo and try again)
Click convert.

STEP 5: Make the Image Unrecognizeable...

Click Dialogs > colormap
Double click each color and replace FF with 02 in the html box and click okay.
The image will get darker with each color until it goes black entirely.

Click Image > mode > RGB (this is CRITICAL)

Note: Using 01 would be better (less of a change), but i chose 02 just to make sure it works. try both to be sure.

STEP 6: Hide It!

Open the image to hide in.
Add a new layer from the layer dialog. name it what you want (or don't)
In the other (now black image) click edit > copy
and paste it into the new layer of the other image and click the anchor button in the layers dialog.
Now select Difference from the Mode menu.
Click image > flatten image.

Now the image is hidden. save it, but use a LOSSLESS format. that means use bmp or uncompressed png. If you compress the image, the hidden data will be corrupted and lost.

STEP 7: Get It Back!

to recover the hidden image:
Open the container image.
add a new layer.
paste the original container image in the new layer and anchor it.
In the layers dialog select Difference in the mode menu. the image will turn black.
click Image > flatten image
click Colors > brightness/contrast.
set both sliders to maximum and click okay.
your image will be visible again!

Obviously the recipient of the hidden image will require a copy of the original.
Also, it's okay if you loose track of which is which, as long as one is the original.

STEP 8: Conclusion.

This was just a demonstration good for little more than impressing people. but this same method, done differently, can store any file small enough to fit. This can be used for good or evil. If you plan on using this, the best way to send the information is via the internet in the open. this is called a dead drop. (just leaving the information somewhere for anyone, hopefully it's target, to find)
Be warned, most sites, like myspace and instructables, compress their images to save space, which will destroy the hidden image.

Attached are some images to play with. have fun!







Obligatory disclaimer: This is for instructional purposes only, I am not responsible for the actions of the reader. sensitive information should not be sent using this method as it is very easy to detect and decode. Don't be stupid.

14 Comments

Hi I just want to say that also am trying to hide a picture in google sheets and i don,t know how to hide it because it big so can you tell me how to make it small and put in sheet 1 i need help for that and i going to show what i mean

We just release our first android app which implements seteganography to test text messages. In next release it will also support images in images as weel files in images. It is also possible to hide secrets on audio or video files, but that is not schedule yet.
https://play.google.com/store/apps/details?id=pt.s...

Great instructable!
Had no problem following the steps in Photoshop.
I even managed to make a 32 color image by using "FF C0 80 40 00" for different colors and then lowering them to "04 03 02 01 00".
The only thing that I didn't get to work was the last part, using brightness/contrast. Image was still black. But the "Atuo Contrast" button solved it.
Awesome!

Great Read! This is a great art in modern days. I think the most common usage of this technique is in Image Stegnography.
Please have a look here: http://www.imagesteganography.com
and THIS is what those random sample pictures that come with windows are for.
Neat! I remember running across a piece of software ages ago that encrypted information into images. I imagine it worked in a similar way, only a bit faster than doing it by hand. ;)
I show how to do it by hand to teach how it works. I find it easer to learn by doing.
Oh! I totally agree. :)
very cool! I've left comments on a couple other instructables recommending this over encryption but never thought to go out and do an instructable on it.
I would recommend this with encryption.