If you’ve ever watched the movie National Treasure (actor Nicolas Cage plays historian and code-breaker Ben Gates searching for rumored treasures dating back to the founding of America), you may remember the scene where he and his cohorts use lemon juice and a blow dryer to uncover the secret message hidden on the back of the Declaration of Independence. His revealed find gives him the encoded information that ultimately leads him to a magnificent treasure trove.

Not so dramatic in real life. Or is it? In the digital world, the art of hiding secret data in plain sight can be found in the science of something called steganography. Used for both admirable and nefarious reasons (think, securing passwords versus sneaking malware into your computer system), steganography hides confidential digital content within other non-secret data like image, audio, text and video files, making the presence of the information imperceptible to an observer. Here, we’ll take a look at how text can be concealed in the images we view.

Hiding text in an image is accomplished by manipulating the pixels that make up an image, the individual color blocks that form what we see as a picture or photo. Each pixel is constructed of bits, the smallest unit of data that a computer can store and process. By modifying the least significant bit (LSB) of each pixel, the rightmost bit in a binary number pattern (note the last bolded number 1 in 10111001), steganography provides a simple yet effective technique for concealing data. The graphic, right, illustrates the manipulation of an image’s pixel.  

 The basic idea behind this method involves the manipulation of the LSBs of the pixel values in an image to encode the secret message. Here’s a simplified overview of how it works: First, the text message to be hidden is converted into a binary format. This conversion translates each character of the message into its binary equivalent (i.e. 10101100). Next, a digital image is chosen as the carrier or host for the secret message. As stated above, this image is made up of pixels, and each pixel is represented by a combination of bits. In a colored image (using the RGB color model), each pixel has three values corresponding to its Red, Green, and Blue components, and each of these values is typically represented by 8 bits. Finally, to hide the message, the LSB of one or more color values in each pixel is altered. For example, if the bit from the text message is ‘1’, and the LSB of the pixel’s color value is ‘0’, the LSB will be changed to ‘1’. This replacement process is repeated, encoding consecutive bits of the text message into the LSBs of the pixel values across the image.

 Because only the LSBs of the pixels are altered, the change in the pixel’s color value is minimal and, in turn, is basically undetectable by the human eye. This ensures that the carrier image does not appear visibly altered when the secret message is embedded. The effectiveness of the Least Significant Bit method of steganography largely depends on the size of the text message and the image’s resolution. A larger image contains much more binary data that can hide a longer message without noticeable changes. Due to its straightforward implementation and its ability to conceal text data that is difficult to detect without prior knowledge of its existence, LSB steganography remains a popular choice for manipulating images, whether to secure source codes, transfer malware and computer viruses, or disguise a map for uncovering treasures lying just beneath the surface.