Steganography is for Lovers

Zak Cole
5 min readOct 23, 2019

--

While steganography can be considered a form of cryptography, these two methods aren’t necessarily synonymous. The main difference is that when a message is cryptographically secured, it’s generally very obvious that the payload has been altered. Modern cryptography is entirely mathematical — hashing algorithms turn plaintext messages into indecipherable strings that can only be interpreted using a secret key.

Steganography, on the other hand, is an art. For as long as people have been able to communicate, there has been a need to relay secret messages across public channels in plain sight. Steganographic methods allow a sender to hide a secret message within a public message in a way that prevents outside observers from identifying that the public message contains a secret at all.

In this article, we’re going to go over some examples of classic steganography and wrap it up with a tutorial on how you can store structured data within any basic PNG, JPG, or GIF image.

Weapons of War

Sending messages that contain hidden meanings in ways that aren’t entirely obvious to those outside the conversation can be an act of revolution. Steganography can save lives. During the Vietnam War, Admiral Jeremiah Denton, captured as a prisoner of war, was forced to participate in an interview that would be used as propaganda by the Vietnamese. During this televised interview, Admiral Denton repeatedly blinked his eyes in a way that spelled out T-O-R-T-U-R-E in morse code. This steganographic message was interpreted by the US Office of Naval Intelligence and confirmed for the first time that POWs were indeed being tortured in North Vietnam.

An early example of steganography dates back to late 5th century Greece during the Ionian revolt when Histiaeus shaved a slaves head and tattooed a message on his scalp. Once the dude’s hair grew back, Histiaeus sent him to one of his homeboy’s houses with the instruction of shaving the slave’s head again. When he did, he found a message which told him to start a revolt against the Persians.

Thanks, I hate it.

From Histiaeus to Vietnam to present day — cryptography, including steganography, has been a tool of war and we in the Web3 space understand this to be a necessary component in defending our privacy and building the decentralized world of the future. As society grows increasingly digital, understanding these methods of maintaining our privacy is going to become a necessity in the fight to preserve human rights and spread awareness of our movement.

Steganography Today

Thanks to the personal computer, modern stenography presents a broad spectrum of opportunity: messages can be encoded within the lowest bits of video files, messages can be broken up into fragments and shared in the comment sections across a network of blogs, and images can even be concealed within audio files. An example of the later can be seen in the Aphex Twin track Equation where mapping the track on a spectrogram reveals the face of Richard D. James, as illustrated in the image above.

Practical Steganography: How To Store Data In An Image

At face value, the above may appear to be an innocuous photo of two real homeboys, but upon further inspection, this PNG image could actually contain a ZIP file full of their most precious assets. The conversion of a ZIP file into a PNG that you can then share via iMessage, email, on a thumb drive, or any other medium that doesn’t resample the image isn’t difficult. In the following section, I’ll walk you through the process. If you’re on a Mac computer, you can even follow along and try it out on your own!

First, identify which photo you want to use. I’ve already selected the image of Jonny and Joseph, which I’ve stored as a PNG file called love.png. I then put all my secret data into a single file and compressed it. In the example below, I stored my data in a file called “bicboi” which, when compressed, produced the archive file “bicboi.zip.”

For convenience sake, it’s best to put the image and the ZIP file into the same directory. In the example below, I’ve created a new directory that I named “shh” which stored all my secret assets.

From my terminal, I cd into the shh directory and run the following command:

cat love.png bicboi.zip > truelove.png

This command produced an additional PNG file in the directory called “truelove.png.” By comparing the newly created truelove.png image to the original love.png image, I can see that there’s a size difference of ~700KB and that’s because truelove.png now contains bicboi.zip inside of it.

To the casual observer, there’s no way to tell that truelove.png contains a payload at all. When Jonny and Joe are separated from one another, they can now securely share assets between one another, even under the presence of prying eyes.

Unzipping the PNG can be done in the terminal using the unzip command.

Try this out on your own and share your secrets with your friends! It’s like a labyrinth of secrets and you, dear reader, are David Bowie.

Conclusion

I hope you’ve learned a bit from this brief article. Cryptography is an important, powerful, and broad field. Methods such as steganography present significant value for people living within oppressive regimes. As proponents of decentralized technologies, it is our responsibility to educate our community and help enable others with the ability to participate in the system we’re creating together. Remember! This isn’t just technology, but a movement, and radically free information makes a radically free world. Since we can’t do it alone, we must build the tools that make it easy for like minded people to join this movement. Like the systems we build, there is power in numbers.

--

--