There are multiple ways to send a secret message. The best known and usually used, especially over the internet, is by encrypting the message and later decrypting it.
But it’s not the only possibilty. Steganography is the process of hiding information within another carrier medium, fooling everyone else into thinking that the carrier is the only message.
The basic principle ist simple:
- Add a start and end tag to our message.
- Convert the message to a byte string using UTF8.
- Overwriting the least significant bits in each pixel with our byte string until the whole message is stored.
Let’s look at the last step if we want to use the two least significant bits:
As an example we want to store 10
in a channel that currently stores 10100111
. First we apply a bit mask with the ‘and’ operation, then we apply our data with an ‘or’ operation. This pixel data is then written back into the image.