
Hide 🕵️♂️ your files of any type inside a image of your choice using steganography
Hide any type of files inside a image of your choice
| File to hide | Cover image | Cover with file hidden |
|---|---|---|
![]() | ![]() | ![]() |
| This is the file that we want to hide inside the image | This is the image that we want to hide the file inside | This is the cover image with the file inside |
The Basics of Digital Storage
Everything on your computer, from .exe files to .jpg images, is stored as bits. Bits are just 1s and 0s. For instance:
A = 01000001B = 01000010So, a 1-gigabyte file is really 8,5 billion 1s and 0s all lined up in a row. This is called binary and is the basis of all digital storage.
Pixels and Colors
Images consist of pixels. Each pixel's color comes from the RGB (Red, Green, Blue) format. Each RGB channel ranges from 0 to 255, allowing for 256 values. This range is equivalent to 8 bits (2^8 = 256), so each channel can be represented by 1 byte.
Example: A red pixel is (0xFF, 0x00, 0x00) or in bits 11111111 00000000 00000000.
Hiding a File in an Image
Hiding file inside a image is actually simpler than it sounds. All we need to do is:
For example, if we take the first 2 bits from a file and replace them in a pixel's channel, a red pixel (11111111 00000000 00000000) can change to (11111111 00000000 00000011) without a visible difference.
Repeat this process for each pixel and every bit in the file, and voilà, the file is hidden in the image!
Try it Yourself
Check out the provided Python repository for an easy-to-understand implementation of this process.
# Clone the repository
git clone https://github.com/JoshuaKasa/van-gonography.git
# Change the working directory to van-gonography
cd van-gonography
# Install the required dependencies
pip install -r requirements.txt
For running the program in the UI mode (simpler and easier to use but also less useful for developers) just run the following command:
python vangonography.py
For running the program in the CLI mode (more complicated but with a bit more functionalities) just run the following command:
python vangonography.py -cli
You can then use the following arguments along with it:
usage: vangonography.py [-h] [-ood] [-l] [-cli] [-o OUTPUT_DIR] [-v] [--encrypt] [--decrypt] [--key KEY] [--json JSON_FILE] [--stealth] [-s] [-e] [-d] [-c COVER_IMAGE]
[-f HIDDEN_FILE]
Van Gonography is a steganography tool that hides files in images.
options:
-h, --help show this help message and exit
Optional arguments:
-ood Open file after decoding from image (default: False)
-l, --log Log file for the program (default: False)
-cli Run the program in CLI mode, this means there's not gonna be any menu (default: False)
-o OUTPUT_DIR, --output OUTPUT_DIR
Output directory for the modified image or revealed file
-v, --version Show the version number and exit
--encrypt Encrypt the data before hiding it (default: False)
--decrypt Decrypt the data after revealing it (default: False)
--key KEY Key to decrypt the data (default: None)
--json JSON_FILE JSON file containing the arguments (default: None)
--stealth Hides the file in stealth mode (default: False)