Skip to content

katstews/Stego-tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

Stego-tree

Heres a little backstory. I was doing some Steganography research and came upon this wiki article that said this image of a tree has a cat inside it! WHAT? Ofcourse I was curious and wanted to try to see if I could do it. Looked online and couldn't find zip, I did find a SO forum, but it was useless lol. So it became my mission to figure out how to extract the cat. The description made it sound really simple, and hey it actually was!

"Image of a tree with a steganographically hidden image. The hidden image is revealed by removing all but the two least significant bits of each color component and a subsequent normalization. The hidden image is shown below."

Screenshot 2023-10-18 at 10 57 58 AM

Uh yeah that cool and all, but how tf do I do that?

So suprisingly, googling didn't actually take that long (THANK GOD). I was super worried I wouldn't find a soultion, but then I came upon a god send of an article on "Steganography" and how it actually works inserting an image inside an image. (https://towardsdatascience.com/steganography-hiding-an-image-inside-another-77ca66b2acb1) Bless you Kelvin Salton do Prado.

So basically, every pixel has 3 layers of color on top of it. Red, Green, and Blue. You need this 3 colors to create a pixel, and a pixel could a wide variety of colors.
Screenshot 2023-10-18 at 11 06 02 AM

R, G, and B will all be a different decimal value, which we will represent in binary form. We know that binary number is made up of 8 bits, and the rightmost bit is the least signif bit and the leftmost is the most signif bit. Meaning if we change the last bit, the value will not change that much. At most, by ONE.
Screenshot 2023-10-18 at 11 10 15 AM
As the image above, if we changed the last big of 10110001 -> 10110000, it would be the val 176.

We are going to take advantage of that and manipulate the least significant bit in the pixel map to insert our image there.

Screenshot 2023-10-18 at 11 11 35 AM
The code in the repo follow the image right above. Knowing that we keep the last two least signifcant bits in the tree png, we are going to take those values and tack on 6 0's, to create a new byte. And at the end we are going to create a whole new image, and it should be the cat!

Hola Cato!
cato

About

Heres how you can decode that silly tree in Wikipedias Steganography section

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages