This repository contains a web application for image encryption and comparison.
The app allows users to upload an image and generate an encrypted version. This encryption is done using an XOR operation between the original image and a keystream. The keystream is generated using a chaos-based function.
Additionally, the app includes tools to compare the decrypted image with the original. Users can calculate the RMSE (Root Mean Square Error) and PSNR (Peak Signal-to-Noise Ratio) between the images, giving insight into the accuracy of the decryption process.
The app is built with HTML, CSS, JavaScript, and Flask, creating a simple yet effective interface for encryption and comparison tasks.
First, clone this repo to your local machine. Then, create a new Conda environment with its dependencies by executing the following command in the terminal or console.
conda env create --file requirements.yml
After the environment is created, activate it with:
conda activate chaos-im-enc
To launch the web application, execute the following command in the terminal/console.
Ensure that your current working directory is set to the cloned repo.
python backend.py
Once the Debugger is activated!
message appear in the terminal, open the browser (Chrome, Firefox, Safari, etc.) and go to localhost:5000
. The web application is now ready to use!
The tutorial video on how to use the web app is provided below.
Demo.mp4
Below are the diagram on how the encryption and decryption works.
Assume that
the output is give as follows.
From the previous equation, the original image can be restored by the following equation.
The behavior of a chaos function is determined by its initial value. The chaos functions used in this repo are as follows.
Gauss Iterated Map
Circle Map
Circle-Gauss Iterated Composition Map