How to hide data within an image

Updated: 07/31/2022 by Computer Hope

To hide data in an image, you need WinRAR installed on your computer and Microsoft Windows with access to the command prompt. If you do not have WinRAR installed on your computer, you can find a link to download this program through our recommended download section.

Note

Steganography is the art of hiding secret data or a message in another file or object.

Hiding a message or other data

  1. Create a text file with your secret message or hidden data and highlight it, then highlight each of the files you want to secretly add to the image file. For example, we created one text file called message.txt.
  2. Highlight and right-click the file. Select the Add to message.rar option, where "message.rar" is the name of the file you right-clicked.
  3. Open the Windows command line.
  4. Change to the directory (cd command) containing the .rar file and the image you use for the hidden text.
  5. Type a command similar to the example below.
copy /b secret.jpg + message.rar hidden.jpg

In the command above, "secret.jpg" is the image name, "message.rar" is the file name from step two, and "hidden.jpg" contains the hidden message. See the copy command page for additional information about this command.

Once the steps above are completed, you have an image called "hidden.jpg" containing the hidden message. Below is an example of the hidden.jpg we created doing the above steps.

Secret Image

It's a good idea to make sure you're still able to open and view the image before saving it or posting it on the Internet.

Viewing the secret message

To view the hidden message or hidden files, you must have followed the above steps. If the steps above were performed to create the image, follow the steps below to view the data.

Tip

You can use the secret image above for an example image, if needed.

  1. Save the image to the computer, if you're viewing it online.
  2. Open WinRAR by clicking Start, Programs, WinRAR, and then WinRAR.
  3. In WinRAR, click File, then Open archive. In the open window, make sure your files of type option is all files and not only compressed ones.
  4. Browse to the location of the image and double-click the image to open it.
  5. Once open, it should display the file(s) contained in the image that can be extracted from the image.