I am trying to encrypt an image using RSA algorithm
inImg = imread('lena.jpg');s = size(inImg);% Encryption:
enImg = ones(s);for i = 1:s enImg(i)= i_encrypt(inImg(i),n,e);end% Function:
function en = i_encrypt(in,n,e)en=1;for i=e:-1:1 en=rem(en*in,n);end
Here n is the modulus, e is the key
However after all these steps all the pixels have the value of 1. Even if the value isn't one, the displayed image is an all white image. Can u please tel me where I have gone wrong.
Best Answer