How To: A Guide to Steganography, Part 3: How to Hide Text and Images in Pictures

A Guide to Steganography, Part 3: How to Hide Text and Images in Pictures

Welcome to part three in a series about steganography, the art of hiding things in plain sight. We are practicing steganography because it can be a useful skill if you don't have access to encryption software, or need a quick solution to make sure the sender and recipient are the only ones who are able to read your message.

In this Null Byte, we are going to learn how to hide messages and photos inside image files. This means that the hidden bits will literally be in the photo and viewable once the picture is altered in some kind of photo editing software. It works by removing the least significant parts of the picture and swapping them out. If done right, the change is unnoticeable to the human eye.

For the tutorial, we will be using a free alternative to Adobe Photoshop—GIMP (GNU Image Manipulation Program). And this can be done under any OS platform. I'm using Arch Linux.

Step 1 Download/Install GIMP and Find an Image

First, let's get the necessary software. All commands in bold are entered into a terminal emulator. This is not necessary for Windows users.

  1. Download GIMP from their website.
  2. Extract the package. cmd:
    tar zxvf <package-name>
  3. Do the usual Linux install procedure. cmd:
    ./configure && make && sudo make install
  4. Find an image to embed the message into.

Step 2 Hiding an Image within an Image

Lets modify the image we've selected in GIMP.

  1. Open your image in GIMP.
  2. Click Windows > Dockable Dialogs > Palettes. The image quality should degrade.
  3. Add a new Palette by clicking the blank document icon on the lower-left.
  4. Add 8 new colors by right clicking and bringing them from the foreground.
  5. Colors in order: ff0000:00ff00:0000ff:ffff00:ff00ff:00ffff:ffffff:000000
  6. Click Image > Mode > Indexed. Use our palette.
  7. Click Windows > Dockable Dialogs > Colormap.
  8. Change every color's FF to 02. The image should be almost black.
  9. Now click Image > Mode > RGB.
  10. Open a second image, and paste the first image we made into it.
  11. On the GIMP toolbar, anchor the image and select Difference from the mode menu.
  12. Click on Image > Flatten Image.
  13. Save as an uncompressed PNG file.

To view the image, open it up in GIMP and just turn the contrast levels up and down until you find a "sweet spot" that allows you to see the hidden image underneath.

Step 3 Hiding Text in an Image

To see how to modify an image with hidden text, follow along with me in the video tutorial below. This should also help with any questions from the image method above, as they follow the same principals.

For viewing the text within the image, it's the same process as viewing the hidden image. Just mess with the contrast until you find the sweet spot that allows you to read the text.

If anyone has questions, feel free to ask them in the IRC or in the Forums! Follow me on Twitter for my latest updates.

Just updated your iPhone? You'll find new emoji, enhanced security, podcast transcripts, Apple Cash virtual numbers, and other useful features. There are even new additions hidden within Safari. Find out what's new and changed on your iPhone with the iOS 17.4 update.

Photo by Idhren

Be the First to Comment

Share Your Thoughts

  • Hot
  • Latest