Skip to content

LudoProvost/sudoku-matrix-encryption

Repository files navigation

Encryption / decryption algorithm using the Sudoku matrix

Lossless image encryption and decryption algorithms. This project could not have been accomplished without the amazing paper by Yue Wu et al.1 cited in the reference section below.

More about the algorithm

Block diagram of the proposed image encryption schema1

blockdiagram

Flow chart of the Sudoku reference matrix generator1

flowchart

Examples of encryption and decryption of images

Original image Encryption Decryption
cameraman cameraman_encrypt cameraman_decrypt
peppers peppers_encrypt peppers_decrypt

How to use

  1. In the same direct as main.py, create 3 folders and name them as follows: images, decrypted, and encrypted.
    • images : This is the folder where you put the images you want to encrypt or decrypt.
    • decrypted : This is the folder in which decrypted images will be saved to after running the decryption algorithm.
    • encrypted : This is the folder in which encrypted images will be saved to after running the encryption algorithm.
  2. In main.py, change the image_name variable on line 14 to the file name of the image you want to decrypt/encrypt. This image should be in the images folder.
  3. In main.py, change the encrypting variable on line 13 to False for decryption or to True for encryption
  4. (OPTIONAL) the x_0 and r variables on lines 11 and 12 are used by the algorithm to determine the initial value of the logistic map, which means that an image can not be decrypted successfully if those variables are not the same values as the values used to encrypt the image.

For more information on the algorithm and its capabilities, please refer to the paper in the reference below.

Reference

Footnotes

  1. Image Encryption using the Sudoku Matrix by Yue Wu et al. 2 3

Releases

No releases published

Packages

No packages published

Languages