Getting Started
This guide provides instructions for setting up and using the VisualCrypto repository.
Installation
Follow these steps to set up the repository:
1. Clone the Repository
git clone https://github.com/coduri/VisualCrypto.git
cd VisualCrypto
2. Install Dependencies
Ensure you have Python installed, then run:
pip install -r requirements.txt
Usage
You can interact with the repository in two ways:
- By running scripts directly
- Through the web app interface
1. Running Scripts (CLI Approach)
To encrypt or decrypt an image using Python scripts:
-
Navigate to the
scripts/
directory:
cd scripts
-
Choose an encryption scheme:
- Visual Cryptography
cd visual_cryptography
- Random Grid
cd random_grid
- Visual Cryptography
-
Ensure the input image and output directories are correctly set in the script:
image_path = '../images/test.png' output_path = '../images/output/'
-
Run the script:
The generated shares and reconstructed images will be stored inpython3 vc_grayscale_halftone.py
scripts/images/output/
.
2. Using the Web App (GUI Approach)
The repository includes a Flask-based web application for a more user-friendly interaction.
-
Set the Python Path:
Before running the application, you need to set the
PYTHONPATH
environment variable. This ensures that Python can correctly locate the project directory and its dependencies. Without this step, launching the web application may result in ModuleNotFoundError or import issues.To set the
PYTHONPATH
, use the following command, replacing<path-to-repo>
with the absolute path to your project directory:export PYTHONPATH=<path-to-repo>
Example
export PYTHONPATH=/Users/yourusername/Desktop/VisualCrypto
-
Start the Flask Application
python3 web_app/app.py
-
Access the Web Interface: open your browser and go to:
http://127.0.0.1:5000/
You can now encrypt and decrypt images using the web interface.