A 4f optical system consists of two lenses separated by a distance equal to four times their focal length. When placed in a coherent light path, it performs two consecutive Fourier transforms, making it a ideal platform for spatial‐domain and frequency‐domain phase modulation. Double random phase encoding (DRPE) exploits this architecture by applying two independent random phase masks: one in the input plane and another in the Fourier plane.
Let the original image be ( f(x,y) ). The first random phase mask is ( M_1(x,y) = \exp[i,2\pi,n_1(x,y)] ), where ( n_1(x,y) ) is uniformly distributed in ([0,1]). The wavefront immediately after the input plane becomes ( f(x,y)M_1(x,y) ). The first lens performs a Fourier transform, yielding an intermediate field at the Fourier plane:
[ F(u,v) = \mathcal{F}{ f(x,y),M_1(x,y) } ]
At this plane a second random phase mask ( M_2(u,v) = \exp[i,2\pi,n_2(u,v)] ) is introduced. The resulting field ( F(u,v)M_2(u,v) ) is then Fourier transformed by the second lens to produce the encrypted image at the output plane:
[ \psi(x',y') = \mathcal{F}^{-1}{ \mathcal{F}{ f(x,y)M_1(x,y) },M_2(u,v) } ]
Only the intensity ( |\psi(x',y')|^2 ) is typically recorded. Decryption requires the exact complex conjugate of each phase mask. The procedure reverses the optical path: the encrypted image is multiplied by ( M_2^(u,v) ) in the Fourier plane and subsequently by ( M_1^(x,y) ) in the input plane.
Implementation Considerations
Because the masks have continuous random phase values, the key space is enormous, providing resistance to brute‐force attacks. The algorithm also exhibits robustness against moderate noise and cropping, since phase information is distributed across the entire plane. An example MATLAB simulation can clarify the encoding process, though practical optical implementations differ in that they capture intensity only. The following snippet demonstrates a digital equivalent of the DRPE encryption/decryption pipeline.
% Read and preprocess the input
img = imread('cameraman.tif');
if size(img,3)==3, img = rgb2gray(img); end
img = im2double(img);
[M,N] = size(img);
% Generate two independent random phase masks
rphase1 = exp(1i * 2 * pi * rand(M,N));
rphase2 = exp(1i * 2 * pi * rand(M,N));
% Encryption: input plane modulation + Fourier + frequency plane modulation + inverse Fourier
encrypted_field = img .* rphase1;
encrypted_field = fftshift(fft2(encrypted_field));
encrypted_field = encrypted_field .* rphase2;
encrypted_field = ifft2(ifftshift(encrypted_field));
% For storage, one would save the magnitude |encrypted_field|
% Decryption using the conjugate masks
decryp_field = encrypted_field .* conj(rphase2);
decryp_field = fftshift(fft2(decryp_field));
decryp_field = decryp_field .* conj(rphase1);
decryp_field = ifft2(ifftshift(decryp_field));
recovered = abs(decryp_field); % Amplitude of the decrypted field
% Display
subplot(1,3,1), imshow(img), title('Original')
subplot(1,3,2), imshow(abs(encrypted_field),[]), title('Encrypted magnitude')
subplot(1,3,3), imshow(recovered), title('Decrypted')
The code uses two random phase arrays generated by rand. During encryption, the image is multiplied by the first mask, transformed to the frequency domain, multiplied by the second mask, and inverse transformed. Decryption applies the conjugate masks in reverse order. Because this is a purely digital simulation, both amplitude and phase remain available; in an optical setup, the phase is typically inaccessible.
Security Characteristics
The mask randomness yields a key space that scales with the number of pixels; even a small image presents an astronomically large space. The diffusive nature of the phase encoding makes the encrypted image resemble white noise, concealing any statistical signature of the plaintext. Known‐plaintext attacks are difficult because the masks are unique to each image acquisition, and the system can be hardened by increasing mask complexity or adding additional cascaded stages.