Steganography Example | How to Hide Data Inside Image

Person sitting in from of his computer and hiding data inside image using steganography example

Introduction

Have you ever suspected secretly sharing important information in an image without anyone suspecting a thing? One of the most fascinating methods is steganography, a technique that hides data within other files, including images. In this blog we’re going to deep dive into how to hide data inside the image, extracting data from images with a steganography example.

What is Steganography ?

Let’s Understand what is steganography. Steganography involves concealing data within various types of media. Unlike cryptography, which is concerned with encrypting messages for secure transmission, steganography aims to obscure the very existence of the message being conveyed. By hiding data inside an image, the information becomes concealed, and only those who have appropriate knowledge and tools can extract that information.

Steps to Hide & Extracting Data Inside an Image (Steganography Example)

There are a lot of open source tools that exist in Linux such as steghide, EXIF, etc. Using that we can perform hiding data inside images and extracting data inside images. Each tool contains its features you can access their help manual using the –help or -h flag.

Don’t Forget to Subscribe To Our Newsletter for daily security tips & updates.

Using Steghide Tool For Showcasing steganography example

Installation: Steghide is already available in kali linux repository. You can install on your system using command “apt-get install steghide”

installing steghide tool for showing steganography example

Steps For Hiding Data Inside Image:
  • Create any file and add secret inside that file, as you can see in the below image.
creating a file and adding fake secret password for showing steganography example

Don’t concern yourself with above screenshot password it is just a fake password 🙂
  • Now download image in which you want to hide this file. I am using any temporary image named as image.jpg.

listing tmp directory files

  • Now let’s add secret.txt file inside image.jpg using command “steghide embed -cf image.jpg -ef secret.txt -sf final.jpg”

Here,
embed = embed data
-cf = embed into the file
-ef = embed the file
-sf = write result to

After running above command it going to ask you to Enter Passphrase. Use any passphrase you want, just don’t forget this passphrase because it going to required when we going to extract the data from final.jpg.

embed secret file inside image

In the above screenshot you can see we get a file name final.jpg, If we send it to someone who don’t know anything about steganography he/she going to treat that image as normal image. Only person who had appropriate knowledge and know how to use tools can able to extract secret data from this file.

final.jpg after open:

building steganography example image

Steps For Extracting Data From final.jpg

If you face any suspicious image and you want to find if there is any embed file, In that condition you can use command “steghide info <filename>”.

Note: there are lot of images embed images available whom don’t have any passphrase. For finding info you had you know passphrase. But what if you don’t have passphrase ? In that condition there are lot of open-source tool available for cracking those passphrase.

After providing passphrase for finding info you can see embedded file and some information too, as you can see in the below image.

finding info of final.jpg file

Let’s extract this secret.txt file from final.jpg using command “steghide extract -sf extracted.jpg”

For this i removed before created secret.txt file else it going to show us overwrite file.

removing old secret file and extracting final.jpg

Let’s read the extracted secret.txt file.

embed secret found

Boom!! We Successfully Extracted HackTheBox Account Password.

Conclusion:

Discovering steganography opens up a world of secret communication possibilities, letting you hide important information in plain sight. Whether it’s for private messages or protecting sensitive data, steganography offers diverse uses that can make a real difference. Learning how to hide data in images gives you a powerful tool to keep your information safe in ways you never thought possible.

Don’t Forget to Subscribe To Our Newsletter for daily security content, tips & updates. For Subscribing visit Contact Page
Read More Blog Follow us on Instagram, Linkedin, Facebook.

Leave a Comment

Your email address will not be published. Required fields are marked *