A high-performance, steganography tool developed from scratch in C++. Unlike traditional tools that simply overwrite the Least Significant Bits (LSB) sequentially, this project employs Adaptive Edge Detection to hide data in the "noisy" parts of an image (edges, textures) while leaving smooth areas (like the sky) untouched.
Note: This project uses Zero External Libraries (No OpenCV, No Boost). It relies entirely on native C++ memory management, bitwise operations, and raw binary file manipulation.
- Adaptive Steganography: Uses a heuristic gradient analysis algorithm to identify complex areas of the image. Data is injected only into pixels with high local variance, making the changes statistically invisible to the human eye.
- Payload Encryption: All data is encrypted using XOR Encryption with a user-defined password before injection.
- Randomized Distribution: Pixels are not filled sequentially (1, 2, 3...). A Pseudo-Random Number Generator (PRNG) seeded with the password scatters the data across the image.
- Self-Destruct Mechanism: Upon successful extraction, the tool wipes the hidden data from the carrier image (sets bits to 1), leaving no trace behind.
- Collision Prevention Engine: Implements a custom mapping system to ensure "Header" bits and "Payload" bits never overwrite each other, even when using random shuffling + adaptive selection simultaneously.
- Binary Injection: Supports hiding ANY file type (
.mp3,.pdf,.exe,.jpg, etc.). - Smart Metadata: Automatically embeds the original filename and file size into a hidden header. You don't need to remember settings to extract the file.
Here is a demonstration of the tool's capability to hide data invisibly and destroy the carrier upon extraction.
Technical Note on the Demo: In demonstration videos, a 4-bit depth might be used to intentionally visualize the noise distribution (making the hidden data visible as "static"). In real-world/production scenarios, using 1 or 2 bits renders the changes completely invisible to the human eye.
Since the project has no external dependencies, you only need a C++ compiler (GCC, Clang, or MSVC).
g++ steganography.cpp -o stego.exeg++ steganography.cpp -o stegoRun the program and select Option 1.
Plaintext === STEALTH STEGANOGRAPHY ===
- Hide File
- Extract File Selection: 1
Carrier Image: nature.bmp File to Hide: secret_plans.pdf Quality (1-5 bits): 3 Password: my_secure_password Carrier Image: Must be a .bmp (Bitmap) file (24-bit).
Quality:
- 1-3 bits: Recommended. Activates Adaptive Mode (High Stealth, Perfect for Text/PDFs).
- 4-5 bits: High Capacity Mode. Slight visual artifacts might be visible.
- Note: Using higher bits increases capacity but reduces stealth.
Run the program and select Option 2.
Plaintext Selection: 2 Carrier Image: nature.bmp Password: my_secure_password The tool will verify the password.
It will locate the hidden header.
It will extract the file, restore its original name (e.g., GIZLI_secret_plans.pdf), and wipe the data from the image.
Before the actual file data, a 12-byte header is embedded using a fixed seed (Global Shuffle). [ SIGNATURE (7 bytes) ] + [ BIT_DEPTH (1 byte) ] + [ FILE_SIZE (4 bytes) ]
Instead of relying on simple bit checks, the algorithm calculates the Luminance (Brightness) gradient between pixels. This mimics human vision sensitivity (where Green contributes more to brightness than Blue) to accurately find edges.
// Simplified Logic
// L = 0.299*R + 0.587*G + 0.114*B (Standard Grayscale Formula)
int currentLum = getLuminance(pixel[i]);
int prevLum = getLuminance(pixel[i-1]);
int contrast = abs(currentLum - prevLum);
if (contrast > THRESHOLD) {
// High contrast area (Edge/Texture).
// The human eye cannot detect noise here. Safe to hide data.
addToPool(i);
}When mixing "Global Shuffling" (for the header) and "Adaptive Shuffling" (for the body), there is a risk of writing to the same pixel twice. The v6 engine implements a Used Pixel Map (vector) to track and skip already occupied pixels, ensuring data integrity.
File Format: Currently supports 24-bit .bmp images only (to avoid compression artifacts found in JPEG).
Capacity: Dependent on image resolution. A 1920x1080 image can hold approx 750KB - 2MB of data depending on the bit depth selected.
This project is open-source and available under the MIT License.
Developed by Mustafa Cagatay Ozdem as a showcase of Low-Level C++ and Cybersecurity concepts.

