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

Picture of 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

Picture of 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

Picture of 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

Picture of 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...

Picture of 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!

Picture of 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!

Picture of 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.

Comments

meirinberg (author)2016-11-29

Similar to @IsidroV, I created an iPhone/iPad app that implements a similar method of steganography. My app allows you to hide one photo within another. It's free, so please check it out:

https://itunes.apple.com/us/app/veil-hide-and-reve...

justme23 (author)2015-12-04

Thanks man

IsidroV (author)2014-10-02

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...

ChristoferWeber (author)2014-01-30

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!

lpilot (author)2013-11-30

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

gutty (author)2010-08-20

and THIS is what those random sample pictures that come with windows are for.

nutsandbolts_64 (author)2010-05-21

 There's a simpler way to do steganography. It's a software, yes. It looks weak, yes. But it's simple to use. I'll post an Instructable on how to make steganography using the aforementioned software right now.

jeff-o (author)2008-11-04

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. ;)

joe57005 (author)jeff-o2008-11-05

I show how to do it by hand to teach how it works. I find it easer to learn by doing.

jeff-o (author)joe570052008-11-05

Oh! I totally agree. :)

Kaelessin (author)2008-11-04

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.

joe57005 (author)Kaelessin2008-11-04

I would recommend this with encryption.

About This Instructable

140,114views

51favorites

Bio: My name is Joe. I enjoy long walks on the beach, pina colladas, getting caught in the rain, playing with dead things, playing with fire ... More »
More by joe57005:How to hide one image in another (An introduction to steganography)How to fake a miniature model.Treo 650 IR Mod
Add instructable to: