Giter Site home page Giter Site logo

joshuakasa / van-gonography Goto Github PK

View Code? Open in Web Editor NEW
392.0 9.0 28.0 3.19 MB

Hide 🕵️‍♂️ your files of any type inside a image of your choice using steganography

License: MIT License

Python 100.00%
cli criptography data-hiding hiding hiding-data hiding-in-png python steganography steganography-algorithms terminal terminal-based tools windows python-steganography steganography-python steganography-library encoding hiding-information

van-gonography's Introduction

Hide any type of files inside a image of your choice

Logo


License GitHub last commit Buy Me a Beer


Table of Contents

File to hide Cover image Cover with file hidden
Cute Cat Happy cat Another Cute Cat
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

Features

  • File Hiding: Hide any type of file within an image of your choice, without altering the image's visual appearance.
  • Decoding Capability: Decode hidden files from images.
  • Image Comparison: Visualize the difference between two images.
  • Detailed Logging: Create a log file that records comprehensive information about the program's execution.
  • Command-Line Interface (CLI): Offers a developer-friendly mode with command-line options for more advanced usage.
  • User Interface (UI): Provides an intuitive and easy-to-use mode for non-developers.
  • Open After Decoding: Automatically open the decoded file after extracting it from the image.
  • Cross-Platform: Works on Windows, Linux, and macOS.
  • Free and Open-Source: Van Gonography is completely free and open-source, and will always be.
  • Encryption: Encrypt the hidden file with a password of your choice (coming soon).
  • Compression: Compress the hidden file to reduce its size (coming soon).
  • Multiple Files: Hide multiple files inside an image (coming soon).
  • Stealth Mode: Hide the fact that the image contains a hidden file (coming soon).
  • User settings: Save your preferences for future use.

How it works

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:

  • The letter A = 01000001
  • The letter B = 01000010

So, 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:

  1. Convert the file (in our case what we want to hide) to bits.
  2. Replace some bits in the image's pixels with the file's bits.

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.

Installation

# 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

Usage

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)

Positional arguments (only used in CLI mode):
  -s, --show            Show the difference between two images (default: False)
  -e, --encode          Encode the file in the image (default: False)
  -d, --decode          Decode the file hidden in the image (default: False)
  -c COVER_IMAGE, --cover COVER_IMAGE
                        Image to be used for hiding or revealing, positional only when using decoding, encoding or differentiate
  -f HIDDEN_FILE, --file HIDDEN_FILE
                        File to be hidden

For example, if you want to hide a file called secret.txt inside an image called image.png and you want to save the modified image in a folder called output you would run the following command:

python vangonography.py -cli -e -c [Absolute path to your `image.png` cover image] -f [Absolute path to your `secret.txt` file] -o Output

This will create a directory called Output in the same directory as the program and inside it will be a file called Cover_txt.png which will be the modified image with the hidden file inside it. If you want to decode the file from the image you would run the following command:

python vangonography.py -cli -d -c [Absolute path (or not) to your `Cover_txt.png` cover image] -o Output

If you also want to create a log.log file with all the information about the program you can run the following command:

python vangonography.py -cli -d -c [Absolute path (or not) to your `Cover_txt.png` cover image] -o Output -l

License

MIT © Van Gonography MIT

Contributing

Pull requests are more than welcome, I love seeing people contribute to my projects and I'll make sure to look at every single one of them. Feel free to contribute translations, features, bug fixes or anything else you think it's necessary, even documentation and README files! if you get any errors, please open an issue and I'll try to fix it as soon as possible :)

Want to Contribute?

We welcome contributions from the community! Whether you're a developer, designer, or just an enthusiastic user, there are many ways to get involved.

Ready to contribute? Start by forking the repository and making your first contribution today. Every contribution, no matter how small, makes a difference!

van-gonography's People

Contributors

crusadergot avatar joshuakasa avatar vasundharamaheshwari avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

van-gonography's Issues

need help!

hi, thanks a lot for the development - very cool, I'm a novice data analyst! For some reason, I can't decode the encrypted file. What could be the mistake, can you help?

the code looks like this :

  1. Encoding - python vangonography.py -cli -e -c "C:\Users\vshen\OneDrive\Desktop\qwe.jpg" -f "C:\Users\vshen\OneDrive\The worker стол\IT\DOCER\DOCKER.txt " -o "C:\Users\vshen\OneDrive\Desktop\IT\DOCER" --key KET --encrypt

  2. Decoding:
    python vangonography.py -cli -d -c "C:\Users\vshen\OneDrive\Desktop\IT\DOCER\Cover_txt_encrypted.png" -o "C:\Users\vshen\OneDrive\Desktop\IT\DOCER" --key KET --decode

Miscalculation of Cover Image size needed to Hide a file.

So I hide a 8.36mb video file in a cover image size of 694kb of dimensions 1440 * 1800. I got no "cover image is too small to hide the data" error, but the result file was smaller than hidden file, and on decoding the output video file was also smaller than the original hidden video file and unplayable.

Initially I thought it was the whole video binary data wasn't getting hidden in the cover image. But since I didn't fully understand the code for hiding files in images, I tried and failed to modify it. Then I thought maybe it was because it was a video file and it required special attention, so I used opencv but the same results.

I then used a cover image of size 2.60mb and dimensions 3024 * 4032 to hide the video file of 8.36mb, and it work perfectly. The resulting file was 24.0mb, and on decoding the output file was the same size as the original.

So I concluded it must be some miscalculation on the math for cover image size needed. Since I don't fully understand the math, I am submitting and issue instead of working on it myself. I will work on other things for optimizing the experience for now. Am also thinking of making it web accessible via django🤞.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.