RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX


Keeping Secrets Secret: Steganography with .NET : Page 5

Steganography is a way to protect information by hiding it "in plain sight" within other types of digital content. Steganography complements rather than replaces encryption by adding another layer of security—it's much more difficult to decrypt a message if you don't know that there is a message. See how to leverage .NET to create steganographic techniques that hide encrypted information inside common digital data files.

Building Client Applications
In the sample source code for this article, you'll find two client applications for the stego library: a console and a GUI application. To use the console application, follow this syntax:

   stego.exe [-e <fileToEncode> <message> <password> <outFile>] | [-d <fileToDecode> <password>]
For example, you can create a stego file that uses a file named test.bmp as the cover file, and "goofy" as the password, and hide the message "Hello World!" as follows:

   > stego -e test.bmp "Hello World!" goofy test2.bmp
When you run the preceding command, the console application creates the stego file test2.bmp, which looks the same as test.bmp but contains the hidden message "Hello World!"

Figure 3. StegoGUI Application (Encoding): From the "Encoding" tab folder you can add a hidden message to a .bmp file.
To extract the message from test2.bmp use the -d option, as follows:

   > stego -d test2.bmp goofy
You pass in the name of the stego file and the password as command-line arguments. The result is:

   > Hello World!
Listing 3 shows the code for the console application.

The GUI application lets users encode and decode 24-bit .bmp files using a graphical interface. In Figure 3 you can see the "Encoding" tab folder of the application. Basically, the application lets you specify the file name of the cover, the resulting stego file, and a password, just like the console application.

Figure 4. StegoGUI Application (Decoding): From the "Decoding" tab folder you can extract the hidden message from a .bmp file.
You can extract a hidden message by clicking the "Decoding" tab folder (see Figure 4), and entering the name of the stego file and the password.

This article introduced the most popular algorithms and techniques about steganography and showed how to implement a .NET steganography library that you can easily expand and integrate in your projects. In addition, we implemented two applications (command-line, and GUI) that may be useful for hiding and extracting information to and from 24-bit .bmp files.

Giuseppe Naccarato has a degree in computer science and works as software engineer for an IT company based in Glasgow (UK). His main interests are J2EE- and .NET-related technologies. You can reach Giuseppe via his Web site at http://www.giuseppe-naccarato.com.
Email AuthorEmail Author
Close Icon
Thanks for your registration, follow us on our social networks to keep up-to-date