A command-line application developed in C that securely hides and extracts secret text files inside 24-bit BMP images using the Least Significant Bit (LSB) steganography technique.
This project demonstrates image steganography by embedding a secret text file into a BMP image without causing any noticeable visual changes. It uses bitwise operations to modify the Least Significant Bit (LSB) of image pixels while preserving the original image quality.
The application supports both encoding (hiding data) and decoding (extracting hidden data) through command-line arguments.
- Hide a text file inside a 24-bit BMP image
- Recover the hidden text file from the encoded image
- Preserves the BMP header to maintain image integrity
- Uses a magic string to validate encoded images
- Stores and retrieves:
- Secret file extension
- Secret file size
- Secret file data
- Checks image capacity before encoding
- Command-line interface for encoding and decoding
- Modular implementation using multiple source and header files
- C Programming
- File Handling (fopen, fread, fwrite, fseek, ftell)
- Bitwise Operations
- Structures
- Command-Line Arguments
- BMP Image Processing
Secret.txt
│
▼
Validate Input Files
│
▼
Check Image Capacity
│
▼
Copy BMP Header
│
▼
Encode Magic String
│
▼
Encode File Extension
│
▼
Encode File Size
│
▼
Encode Secret Data
│
▼
Create stego.bmp
stego.bmp
│
▼
Verify Magic String
│
▼
Decode Extension
│
▼
Decode File Size
│
▼
Decode Secret Data
│
▼
Recover Secret File
gcc *.c./a.out -e beautiful.bmp secret.txt stego.bmp./a.out -d stego.bmp output.txtRead and validate is successful
All files are opened
Checking capacity is successful
BMP Header copied
Magic string encoded
Secret file extension encoded
Secret file size encoded
Secret file data encoded
Encoding successful
Magic string validated
Secret file extension decoded
Secret file size decoded
Message decoded successfully
Recovered Message:
My password is SECRET ;)
Courage Is Contagious!