4.3. Pixels, bits, and steganography


Each single point in a digital image is called a pixel. An image is composed of so many pixels that you cannot distinguish them unless you zoom in the image. Only after a great magnification you are able to see squares of different colors. Each of these colored squares is a pixel.

Computers use the RGB model to specify a color. RGB stands for Red, Green, and Blue. The combination of these three colors –called channels in computation language– can produce any other color. So, for coloring a pixel, the proportion of red, green, and blue must be specified.

Computers use an 8-bit scale from 0 to 255 for each channel. In other words, there are 28 = 256 different intensities for each of the three basic colors. The greater the number, the brighter the color. By combining the three channels you can create up to 256×256×256 = 28×28×28 = 224 colors. That's more than 16 million colors! Here are some examples:

Color Name (R,G,B)

red (255,0,0)

yellow (255,255,0)

light blue (135,206,250)

black (0,0,0)

pink (255,192,203)

But computers prefer to only use 0's and 1's instead of numbers up to 255. That's not a problem because every natural number can be written as a binary number, i.e. using 0 and 1 (by the way, that's a bit). For instance the values for each channel in the light blue of the image above are indeed

(135, 206, 250) = (10000111, 11001110, 11111010)

Thus, one of these light blue pixels would correspond to the previous long string of 24 bits.

We have written in bold the so-called least significant bits, which are the right-most digits for each channel.

They are said to be “least significant” because swapping 0 and 1 in those positions does not alter the color appreciably: it is like changing just one unit over 256 in the channels.

We are almost done! Now we can erase the least significant bits of a photo and write instead the binary string for a secret message. For example to hide the message “HELLO WORLD” in a digital image, we must do the following:

1. Associate the letters H-E-L-L-O-W-O-R-L-D with numbers, as done for instance in the usual ASCII convention, based on which a unique binary string corresponds to each letter:

H=01001000; E=01000101; L=01001100; O=01001111; W=01010111; R=01010010; D=01000100

So our “HELLO WORLD” would read:

01001000 01000101 01001100 01001100 01001111 01010111 01001111 0101001001001100 01000100

2. Choose a beautiful digital picture and overwrite the first non significant bits of your photo with the previous string. Nobody will notice that you have substituted a bunch of pixels by others with almost the same color.

This practice of concealing a message within a digital file (such as a digital image) is called steganography. And it is a quite common method to transfer information used by intelligence services and terrorist groups.

Do you find it difficult to implement? It is not. As a matter of fact there are many tools on the Web to do it. Just choose a photo and insert a text in it. Run the software and voilà.

The odds of someone finding your secret message are very rare, but take into account that steganography is not a cryptography method (such as the one-time pad used by Che Guevara and Fidel, §20). This is because the message is not ciphered, although you could do it before you hide the message inside the 0's and 1's of the digital file (only for paranoids!).