silenda

A simple command line tool for hiding ASCII-Strings in (uncompressed) Bitmaps and retrieving them again.

THIS is a C program that allows you to hide messages (ASCII-Strings) in (uncompressed) Bitmap files. The effect will not be noticeable to the human eye. But remember: This is just steganography, this absolutely does not provide any security whatsoever. But it's fun.

[Prerequisites] [Usage] [How it works] [Example]
Prerequisites:
The program should run on Windows, Mac, Linux and other Unices without much of a difference. In the following, I will assume you are running Linux/Unix.

You will, of course, need a C-Compiler (e.g. gcc ). Assuming you have gcc, after downloading you just need to unzip silenda.zip, run
gcc -o encoder encoder.c
gcc -o decoder decoder.c
in that folder and you can use the program.

It works with uncompressed 8bit (grayscale) and 24bit Bitmaps. 32bit should also work. Just bring a picture that's large enough...
Usage:
To push a message into a bitmap you then simply invoke the program with
./encoder InputFileName OutputFileName "text"
and if you provided a correct Bitmap as input file, that should be all.

To extract a message from a previously modified Bitmap, just type
./decoder FileName
and the program will print the message out to command line.

- Have fun
How it works:
It's actually pretty simple. Bitmaps consist of an information header and after that just bytes that directly correspond to one pixel. In case of an 8bit image one byte per pixel, in case of 24bit three bytes (RGB) per pixel, in case of 32bit 4 bytes (XRGB) per pixel. For more information see Wikipedia [german] [english] (one of the few times, that a german article is better than the english one...)

What we do now is: We look up the data offset in the header (where does the actual picture data start?), split up our messages into single characters, split up each character into its 8 bits and hide those bits in the Least Significant Bit of eight consecutive byte-packages of picture information. This will produce a light change in colour, but no human should be able to spot the difference (it's really, really minimal). We also hide a trailing '\0' in the image, the typical end-mark of strings in C (so called null-terminated string)

Retrieval of the message is pretty straight forward, as you would imagine. We look up the picture data offset, reconstruct each character by concatenating the LSB of eight consecutive byte packages, print it out and start over - until we reach '\0'.
Example:
I hid

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

in an 8bit Bitmap of 1533x1024 pixels. [original] [modified]

Can you spot the difference?
License:
Silenda is a simple command line tool for hiding ASCII-Strings in
(uncompressed) Bitmaps and retrieving them again.
Copyright (C) 2010 Alexander Weinhold

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 2 of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.