% Routine 4.3 encryption B = rand(m,n); % choose a blurring matrix save blur B % blur the image via circular convolution: Xhat = fft2(X); Bhat = fft2(B); Yhat = Bhat.*Xhat; Y = ifft2(Yhat); Y = real(Y); Y = round(Y); % % to see how scambled the data, rescale: Z= Y/(m*n); a = min(min(Z)); Z = Z - a; b = max(max(Z)); Z = Z*64/b; image(Z) % display the encrypted image colormap gray axis off