Implementation of image encryption and decryption using Rubix's Cube Principle. This algorithm is based on the paper which can be found at https://www.hindawi.com/journals/jece/2012/173931/
You need to have Python2 on your system. Follow instructions at https://www.python.org/downloads/
You also need to install numpy and Image libraries.
On Ubuntu
sudo apt-get install python-numpy
sudo apt-get install python-imaging
-
To encrypt an image, first place that image in the
input/
folder -
Then run
python encrypt.py <image_name>
The encrypted image can be found at theencrypted_images/
folder.
The keys generated during encryption is stored in thekeys.txt
file.
(Note: The number of iterations of encryption to be performed can be adjusted by changing theITER_MAX
value in theencrypt.py
file. Larger values will make encryption more secure but it is more time consuming) -
To decrypt the image, run
python decrypt.py <image_name>
And Then enter the value of the Keys (Kr, Kc and ITER_MAX)
The decrypted image can be found at thedecrypted_images/
folder.
- To encrypt the image
pic3.png
stored in theinput
folder
Run
python encrypt.py pic3.png
The encrypted Picture can be found at encrypted_images/pic3.png
The keys are stored in keys.txt
- To decrypt the image
Run
python decrypt.py pic3.png
and enter the key values (Kr, Kc and ITER_MAX)
The decrypted Picture can be found at decrypted_images/pic3.png