After doing an Instagram API, i though it would be great to do some experiments. Let’s hide info in my Instagram’s pictures. Before starting, let me explain the concepts.
Q: What is Steganography?
A: Steganography is the science of concealing a hidden message in plain sight in order to avoid detection.
There are many mechanisms to hide information in images, for example LSB Steganography:
An HTTP Request could contain hidden information in the headers like:
Instagram and Steganography
First of all we are going to hide a file inside of an image, since i don’t want to code my own mechanism, there are available binaries you can use to hide your information in images, and other StegoAnalysis Tools.
I have created a text file named
secret.txt that contains the following string:
This is a hidden message!
You can also hide text without any file. This file can be encrypted or not, that depends in the security you want to add to the hidden information.
Now that we have hidden our information, lets compare both original and modified image:
There is no evidence of information, although you can notice variation in its size:
Let’s upload our modified image to Instagram using the Instagram API i did. Here i have a very easy script:
Let’s check the debug, and see if the modified photo that contains our file with the secret message hidden is uploaded to Instagram.
Since Instagram doesnt allow the aspect ratio of the image, im going to resize/crop it and try again:
There we go! Now lets check our modified photo on Instagram:
The modified photo was uploaded correctly. However, I forgot that Instagram makes compression of images server-side, so I had to change steganography mechanism in order to prevent data loss from compression.
And finally… we did it!
And these are the files extracted from the image. Only
secret.txt was extracted the other files are just hashes to verify file integrity.
And the file’s content:
I hope you enjoyed this brief post, if I have more time, I’ll write more stuff!
Have a good weekend! :)