Hide Your Files Inside an Image in Debian Using Simple Steganography

Steganography is the science of hiding information. Here we will use Steganography to hide different files inside an image file in Debian. This process works in other Linux-based distros too.

For this purpose we need an image file in JPEG format and the files you want to hide. In my case, here I’ll use some files to hide and an image file titled image.jpg . I have made a sub-directory in Documents directory for that purpose. I have named it test. Now I have one image file named image.jpg and one folder named files_to_hide that contains all the files to hide. Now I have to compress the folder that contains all my files to hide in ZIP format. The changed folder’s name would be files_to_hide.zip

Now open the terminal window and point it to your folder that contains file_to_hide folder and that image file. In my case I have created the folder test which contains files_to_hide, it’s zip format files_to_hide.zip and image file image.jpg.

Then I executed the command as following:

cd Documents/
cd test

Now list all your files inside Test folder.

ls

In my case the result looked like this:

files_to_hide files_to_hide.zip image.jpg

Now you have to hide files_to_hide.zip inside image.zip and so do as I do:

cat image.jpg files_to_hide.zip > img.jpg

Here, what I have done is simple. cat command indicates the program used for this process of concatenation for the two files: one zip and one image file. And at last I have merged them into another file, named img.jpg. Here you can use any name you want.

Now you’ll see a file img.jpg has been created inside the folder test. Now delete the rests. Because your image file img.jpg now contains all other files inside it.

This img.jpg file can be viewed as the ordinary image file and no one will suspect it being an extraordinary file. Now you can unzip it whenever you want. Just do the following:

unzip img.zip

This will extract the files_to_hide folder.

Pretty slick, huh?