This program is designed for hiding and recovering messages in PPM (Portable Pixmap) image files using the Least Significant Bit (LSB) method. It manipulates the LSBs (1, 2, or 4 bits) of the image's pixels to encode and decode secret messages.
hideMessage.c
: Hides a message in a PPM file.recoverMessage.c
: Recovers a message from a PPM file.ppmReadWrite.c
andppmReadWrite.h
: Utilities for reading and writing PPM files.getImageArgs.c
andgetImageArgs.h
: Argument processing utilities.
Hides a message in a PPM file.
Compilation with make can be accomplished with
cd hideMessage/ && make
or compiled manually with
gcc -ansi -pedantic -Wall hideMessage.c -o hideMessage getImageArgs.c ppmReadWrite.c
Usage
./hideMessage -b [LSB bits] [message file] [original PPM file]
[LSB bits]: Number of LSBs to use (1, 2, or 4).
[message file]: Text file containing the message to hide.
[original PPM file]: PPM image file in which to hide the message.
Extracts a hidden message from a PPM file. Compilation
Compilation with make can be accomplished with
cd recoverMessage/ && make
or compiled manually with
gcc -ansi -pedantic -Wall recoverMessage.c -o recoverMessage getImageArgs.c ppmReadWrite.c
Usage
./recoverMessage -b [LSB bits] [PPM file with hidden message]
[LSB bits]: Number of LSBs used in the hidden message (1, 2, or 4).
[PPM file with hidden message]: PPM image file from which to recover the message.
Example
To hide a message:
./hide -b 2 message.txt will.ppm
To recover a message:
./recover -b 2 will_hidden.ppm