- Calculate the public and private keys
- Program will provide three example images with different pixels density, if user not choose any of the example picture, the program will choose a bench mark image.
- Once choose any of image, program will convert image to uint8 array.
- Random number will be added to each element of the image array
- Program will use the public key to encrypt the image
- Program will use the private key to decrypt the image
- The original, encrypted and decrypted image will be display in the output
The p is 17 the q is 19
The x calculated is: 288
The e is: 13
The n calculated is: 323
Public key is: 323 13
The d calculated is: 133
Private key is: 323 133
Of course you can choose your own parameters.
This code only able to process greyscal images This code requires:
- vpi package Variable Precision Integer Arithmetic by John D'Errico https://uk.mathworks.com/matlabcentral/fileexchange/22725-variable-precision-integer-arithmetic
- Image processing toolbox
Notice:
- The running time may be at least 3 minutes, the parameters choosen above may result 7 minutes running time.
- This program is unable to process color pictures but grey level pictures only.
- The suggested parameters should smaller than the example given above, otherwise the encryptted picture may be pitch black.