Introduction: 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:
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.
in the palette editor, click 'add from foreground'
do this for all 8 colors:
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)
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.