printf("Thoughts");

Adventures in C, Linux, and open source


Steg-Image

There are countless ways to obfuscate data, some specifically apply to embedding data in images. This method uses steganography, which involves storing data inside the color information (pixels) of images.

public domain image containing a hidden message
This image contains a hidden message (from pexels.com)

If you run steg-run -d -i demo_img_400_e.png for the above image, you'll get a text string reading "Hello World!"

The technique I'm using here is replacing the N least significant bits (where 1 ≤ N ≤ 8) per byte of each color channel with the data I want to embed. Essentially, if you have an image with four 8-bit color channels (RGBA), you can store (N/2) bytes of data per pixel. Using more bits increases the storage capacity of the image, at the cost of noticeably changing how the image looks visually.
More details about how it works →

While this is really cool, there are several disadvantages that make steganography impractical:


Despite the fragility of the embedded data, there are a few reasons you might use steganography:


Compile it and try it out for yourself