Optical image encryption using gamma distribution phase masks in the gyrator domain

Optical information encryption technology has received extensive attention from researchers in recent years because of its advantages of parallel and high-speed processing capability, as well as the controllability of phase components. An encryption method for grayscale images with a pair of random phase masks based on gamma distribution in the gyrator domain is proposed. In this scheme, two random distribution phase-images using random parameters according to the definition of the gamma probability distribution function are generated. They are loaded onto spatial light modulators as random phase masks used in the encryption process. The input grayscale image transmitted through the first random phase mask. And then they are encoded by the first gyrator transform. The resulting information is again encrypted by a second gamma distribution random phase mask at the gyrator frequency plane. The final results are encoded by the second gyrator transform. Numerical simulations are presented to confirm the security, validity, and flexibility of the proposed idea. The gyrator transform rotation angle sensitivity test is also simulated. The occlusion and noise attacks analysis establish the scheme’s robustness. In gyrator transform-based optical image encryption cipher system, encrypting the input image with different parameters of gamma distribution RPMs will significantly change the statistical distribution of phase in the ciphertext. It means that the phase distribution in the ciphertext will not obey the law of random scattering medium. Therefore, it has potential to resist the attack based on the phase retrieval algorithm. Therefore, the security and flexibility of encryption can be improved by using gamma distribution RPMs.


Introduction
Optical information encryption technology has received extensive attention from researchers in recent years because of its advantages of parallel and high-speed processing capability, as well as the controllability of phase components.One of the earliest and most widely studied optical encryption method for image encryption was the double random phase encoding (DRPE) system which was proposed by Refregier and Javidi [1][2][3][4][5].This architecture is based on a 4-f imaging system and together with a pair of independent random phase keys (PRKs), which one in the input plane and another in the Fourier plane for encryption amplitude image.After more than 20 years of development, the family of optical information encryption systems has been greatly expanded.They provide many degrees of freedom with which optical beam may be encoded, including amplitude, phase, wavelength, and polarization.Now, there are still many examples showing that optical security and encoding techniques have continued to attract the attention of researchers [6][7][8].
In this paper, an image encryption and decryption based on DRPE and gamma distribution phase masks in GT domain is introduced.In this scheme, two random distribution phase-images are generated using random parameters according to the definition of the gamma probability distribution function.They are loaded onto spatial light modulators (SLMs) as RPKs used in encryption process.A grayscale image is encrypted with a first RPK placed at the input plane and then performed the first GT.The resulting spectrum is again encrypted into second RPK placed at the GT spectrum plane and then executed the second GT.The construction parameters of RPKs and rotation angles of GT are introduced for encryption.Therefore, the security and flexibility of the DRPE system are enhanced.
The paper is organized as follows: In Section 2, we present a brief mathematical description of GT, gamma distribution, and the encryption scheme.In Section 3, we present the results based on computer simulations for validation and evaluation of the scheme's performance.Finally, the conclusions of the study are summarized in Section 4.

Gyrator transform
The GT is a linear canonical integral transform and similar to the FrFT.It produces rotation in the twisted position spatial frequency planes.For a two-dimensional function f(x, y), the GT with rotation angle ξ is written as where the kernel is defined as Here, (u, v) and (u, v) are the coordinates on the input and output plane.G(u, v) is the output of the GT.GT has the following special properties: The properties of the GT are summarized as follows: (1) When ξ = 0, it corresponds to the identity transform.(2) For ξ = ± π/2, the GT reduces to a FT/inverse FT with a rotation of the coordinates at π/2. (3) The inverse transform of G ξ is expressed as G −ξ or G 2π − ξ .(4) The GT is periodic with 2π and additive with respect to rotation angle, G ξ 1 G ξ 2 ¼ G ξ 1 þξ 2 .The GT can be implemented by an optimized flexible optical system having planoconvex cylindrical lenses with a fixed distance between them.The angle ξ is changed by proper rotation of two lenses.The digital GT can be implemented with two-dimensional discrete fast Fourier transform.

Gamma distribution
In probability theory and statistics, the gamma distribution is a two-parameter family of continuous probability distributions.The exponential distribution, Erlang distribution, and chi-squared distribution are special cases of the gamma distribution with different parameters [45].A random variable X that is gamma distribution with shape parameter α and rate parameter β is denoted The corresponding probability density function (PDF) in the shape-rate parameterization is where X > 0, α, β > 0 and Γ(α) is the upper incomplete gamma function.The upper incomplete gamma function is defined as The formula for the gamma cumulative probability function (CDF) is where γ(α, βX) is the lower incomplete gamma function which is defined as If X is Γ(α, β) random variable and the shape parameter α is large relative to the scale parameter 1/β, then X approximately has a normal random variable with mean μ = α/β and variance σ 2 = α/β 2 .Figure 1 is the plot of the gamma PDF for different pairs of parameters (α, β).We also define a linear function to map the value of a random variable to the corresponding interval, as follows where a is referred to as the slope of the line, and b as the intercept.

Encryption setup
An optoelectronic hybrid setup of the proposed method is depicted in Fig. 2. In this scheme, the GT optical setup is constructed by using three generalized lenses with fixed distances between them.The left dotted block consists of lenses L 1 , L 2 and L 1 denotes the first optical GT and the right one consists of lenses L 0 1 , L 0 2 and L 0 1 represents the second optical GT.The spatial distribution of pixel value of the original image is changed digitally by the first discrete Fourier transform (DFT), attached to a gamma distribution random phase mask (RPM1), displayed on the first SLM in the input plane, and then optically transformed by the first GT.The spatial distribution of pixel value of the transformed image is changed digitally by the second DFT, attached to another gamma distribution RPM2, displayed on the second SLM in GT plane, and then optically transformed by the second GT.The encrypted complex amplitude is superimposed on the plane reference beam to produce a holographic interference fringe, which is captured and recorded as an off-axis hologram by charged couple device (CCD) camera, and digitally processed by a computer system.The encrypted complex amplitude function can be expressed as where φ 1 (x, y) and φ 2 (x, y) are the phase functions with gamma probability distribution.ξ 1 and ξ 2 are rotation angles for the first and second GT.The decryption system has the same structure as the encryption system but uses a conjugated RPM.For real number input, the decrypted image is obtained by a reverse of the encryption process with GT at the rotation −ξ 1 , −ξ 2 and conjugation of the second RPM.In this scheme, the alignment accuracy is limited by the pixel size of 20μm and thus a large space-bandwidth product is obtained [21].

Results and discussion
Numerical simulations have been performed on a Matlab R2016a.A pepper image having 512 × 512 pixels and 8bits gray levels is regarded as an original image as shown in Fig. 3.
In the first case, the gamma distribution parameters are α = 2 and β = 1 for RPM1 and RPM2.In order to limit most of the phase values within the required range, according to Eq. ( 8 and 5c.However, the probability distributions of encrypted phase images are significant different between two schemes.In the uniform RPM scheme, phase probability distribution obeys uniform distribution.In this case, it obeys the phase distribution model of random scattering medium.
However, in the gamma RPM scheme, phase probability distribution does not follow uniform distribution, Gaussian distribution or Rayleigh distribution, according to the results of hypothesis testing.And output phase distribution depends on the parameter selection of gamma PDF.In fact, the proposed method is a more general way of configuring RPMs.The introduction of random distribution parameters and linear functions makes this method more flexible.On the other hand, it means that the phase distribution in the ciphertext has broken the scattering law of the random medium.It has potential to obstruct phase retrieval algorithm which is based on the hypothesis of uniform distribution of phase in the ciphertext.
To evaluate the performance of the proposed method quantitatively, there are several statistical indicators are introduced.The mean square error (MSE) and the peak signal-to-noise ratio (PSNR) are defined as where I o (x, y) and I(x, y) are original and encrypted/ decrypted image respectively.M × N represents the pixels size of the image and R = 255 is the maximum fluctuation in the input data type.The value of MSE represents the difference between input and output images at the aspect of pixel data.The quality of the decrypted result is also addressed by illustrating a retrieved image in order to assist the MSE function in vision.The decrypted result with all correct keys has the minimum of MSE which is very close to zero.The MSE values between the input image and its corresponding encrypted image is 6.1073 × 10 3 whereas the PSNR value is 10.2723.At the same time, the MSE value between the input image and its decrypted image with all correct keys is 4.2097 × 10 −27 while the PSNR value is 311.8883.These results reveal that the original image is totally encrypted into a noise-like image and which can be reconstructed with all right key.Further, the MSE curves between the input and their corresponding recovered images are plotted as a function of transform angles of GT1 and GT2 in gamma distribution RPM scheme and uniform RPM scheme, respectively in Figs. 6 and 7.In both the plots, MSE approaches zero when the images are decrypted with correct transform angles, whereas it increases sharply in case of a departure from the correct angles.The MSE curve of the rotation angle is not sensitive to different RPM probability models, which can be seen from the comparison results in Figs. 6 and 7.They are regarded as two sets of relatively independent encryption parameters.
The results also show that the GT scheme is very sensitive to the variations in GT angles.
Additionally, we examine the robustness of the proposed algorithm against occlusion and noise attacks.In this test, the gamma distribution parameters are (α, β) = (2, 1) for both of RPMs.And the linear transformation parameters are set to (a, b) = (1, 1) for RPM1 and (a, b) = (2, 0) for RPM2.The encrypted amplitude and phase images are occluded from 20% to 80% sizes which are shown in Fig. 8a-h.The occluded pixels are replaced by zero in this test.And corresponding recovered images are displayed in Fig. 8i-l, respectively.The calculated MSE values between input and its corresponding retrieved images with all the right keys from the encrypted image with 20%, 40%, 60%, 80% occlusions are 1.1310 × 10 3 , 3.2962 × 10 3 , In the cases of 20% and 40% occluded encrypted images, their respective decrypted images with all right keys can be recognized obviously.However, the decrypted images with all correct keys from 60% and 80% occluded encrypted images, are not easily recognizable because of data loss.The proposed system shows robustness against occlusion attacks.At the aspect of robustness analysis, the encrypted image will be checked by noise attack.The additive noise model is expressed as follow, where E(x, y) and E ′ (x, y) represent the ciphertexts before and after adding noise.Besides, the parameter p can be regarded as a coefficient representing noise intensity.N μ;σ 2 ðx; yÞ denotes Gaussian random data with the mean value μ and variance σ 2 .In this test, the encrypted amplitude and phase images are added Gaussian noise with different parameters.All the relevant encryption parameters are the same as in the occlusion test.The results are shown in Fig. 9a-l.From left to right columns, the noise parameters are (p, μ, σ 2 ) = (0.5, 0, 0.5), (p, μ, σ 2 ) = (1, 0, 0.5), (p, μ, σ 2 ) = (0.5, 0, 2) and (p, μ, σ 2 ) = (1, 0, 2), respectively.The MSE values from left to right each columns are 0.5236 × 10 3 , 1.8422 × 10 3 , 4.7273 × 10 3 and 6.5206 × 10 3 , respectively.The corresponding PSNR values from left to right columns are 20.9408,15.4775, 11.3847 and 9.9879.In the first three cases, the original image is retrieved and recognized.The quality of the retrieval image is sensitive to the encrypted phase image.The proposed system has robustness against noise attacks.

Conclusions
We have proposed an encryption scheme for grayscale images with a pair of random phase masks based on gamma distribution in the gyrator domain.The gamma distribution phase mask is preferred over the uniform distribution phase mask in order to introduce parameters that enlarge the key space.In addition to enhancing the system security, the use of gamma distribution RPM also helps in the flexibility of encryption.More importantly, the encrypted image with different parameters of gamma distribution RPMs will have different statistical distribution of phase in the ciphertext.It means that the phase distribution in the ciphertext will not obey the law of random scattering medium.Therefore, it has potential to resist the attack based on the phase retrieval algorithm.The scheme has been validated and its efficacy has been quantitatively evaluated from the computed values of MSE between input and decrypted images.The amplitude and phase pattern distribution of the encrypted image varies with the gamma distribution parameters.We have also examined the scheme's sensitivity for GT transform orders.Numerical simulations confirm that the scheme is flexible for different gamma distribution parameters.The occlusion and noise attacks analysis establish the scheme's robustness.

Fig. 2 Fig. 3
Fig. 2 Optoelectronic hybrid architecture of the proposed system

Fig. 4 Fig. 5 28 Fig. 6
Fig. 4 Results of proposed image encryption and decryption: a Encrypted amplitude image; b Encrypted phase image; c histogram of encrypted amplitude; d histogram of encrypted phase; e first gamma distributed RPM; f second gamma distributed RPM; g decrypted image with all the correct keys

Fig. 9
Fig.9Robustness test of the proposed method against Gaussian noise attack.a, b, c, d Gaussian-noised encrypted amplitude images with different parameters; e, f, g, h Gaussian-noised encrypted phase images with different parameters; i, j, k, l retrieved images with all the correct keys from encrypted amplitude and phase images from (a, e), (b, f), (c, g) and (d, h)