Color image encryption based on chaotic compressed sensing and two-dimensional fractional Fourier transform

Combining the advantages of structured random measurement matrix and chaotic structure, this paper introduces a color image encryption algorithm based on a structural chaotic measurement matrix and random phase mask. The Chebyshev chaotic sequence is used in the algorithm to generate the flip permutation matrix, the sampling subset and the chaotic cyclic matrix for constructing the structure perceptual matrix and the random phase mask. The original image is compressed and encrypted simultaneously by compressed sensing, and re-encrypted by two-dimensional fractional Fourier transform. Simulation experiments show the effectiveness and reliability of the algorithm.

Fractional Fourier transform. In order to improve the security of the system, the Fourier transform is improved to a fractional Fourier transform, and the required angle is used as a key to increase the key space and key sensitivity. First, the mathematical definition of one-dimensional fractional Fourier transform is introduced 44 : where the kernel function k p (x, u), where F p {f (x)}(·) is the p-order Fractional Fourier transform of signal f (x) , and p is the fractional order of Fractional Fourier transform. x and u respectively represent the input domain coordinates and the p-order fractional domain coordinates. θ represents the rotation angle of the time-frequency plane, δ(·) represents the impulse function, and n is a positive integer.
The two-dimensional fractional Fourier transform is a generalization of the one-dimensional fractional Fourier transform. In the field of optics, a two-dimensional fractional Fourier transform is realized by optical instruments, which is defined as follows 45 : f (x, y) is the original signal, k p1,p2 (x, y, u, v) is a kernel function, k p1,p2 (x, y, u, v) = k p1 (x, u) × k p2 (y, v) = 2 tan β − iyv sin β ]p1, p2 is expressed as a transformation order in the x, y directions, and α, β represents a rotation angle.
(1) f = s (4) min �s� 0 s.t. y = As f (x, y)k p1,p2 (x, y, u, v)dxdy Image encryption and decryption process Algorithm 1 (1) The Chebyshev chaotic system generates a chaotic sequence R 1 , and records the position sequence Y corresponding to the sequence R 1 . (2) The sequence R 1 is sorted in ascending order, and the corresponding position sequence Y becomes chaotic sequence Y 1 as the order changes.  Encryption process. First, the Discrete Walsh transform (DWT) standard orthogonal basis sparse representation is performed on the three components of the color image from two directions: The three components of the color image are processed separately, and no other formats need to be converted.
The sparse signal is then measured using a chaotic sequence constructed by Chebyshev to construct a measurement matrix . The measurement matrix is defined as follows: Among them, N is the width of the image, M = CR × N . The coefficient N M is normalized to DCE such that the energy of the measured value is close to the energy of the original signal. D is a random sampling operator, which is a random sample of the m rows of CE according to a subset {1, 2, . . . , n} . In this paper, a chaotic systembased permutation algorithm is proposed for sampling. The essence of the permutation algorithm is to randomly select m rows using pseudo-random sequences generated by chaotic systems (algorithm 1).
C is a cyclic matrix based on chaotic sequences. The size of C is N × N , defined as follows.
where r (i−1) is the ith element of the chaotic sequence R 1 , υ(r) is the variance of the matrix C , 1 √ nυ(r) is for normalizing C , C is for passing important information in f to the measured value, and chaos-based cyclic matrix C is only required for n Element storage, which reduces memory requirements.
E is a diagonal matrix in which diagonal elements are determined by chaotic sequences.  www.nature.com/scientificreports/ r (i) is the i element of the sequence R 1 . According to the nature of the Chebyshev sequence, the probability that the diagonal element E i,i in E is equal to 1 or − 1 is the same. So E is equivalent to a pseudo-randomizer that can change the sign of the signal. Since the sampling subset D , the diagonal matrix E , and the chaotic sequence circulant matrix C are all generated by the Chebyshev chaotic map, the is a certain measurement matrix. To generate different measurement matrices, only the initial conditions of the Chebyshev system need to be changed.
Compressed sensing process is as follows: The reconstruction algorithm (OMP or SL 0 ) can be used to recover , and finally the original signal is obtained by performing the inverse operation of the sparse coefficient and the sparse basis. Finally, the measured image is subjected to two-dimensional fractional Fourier transform encryption using two random phase masks, which are generated based on the chaotic sequence. If the fractional Fourier transform is used directly, the data will explode, so CS has a major role in overcoming this defect.
The detailed encryption operations are as follows: Step 1: The color image can be divided into three images according to the RGB component, respectively denoted as f R , f G , f B ∈ R N×N . They are respectively sparsed by the sparse base in the wavelet transform domain to obtain f 1 , f 2 , f 3 . Then perform Arnold scrambling on f 1 , if the absolute value of the element is less than TS, change the element value to 0, get Step 2: Generating measurement matrix , the specific process is as follows: Given α 1 , r 1 , r 2 , r 3 as the initial condition, the Chebyshev chaotic map is taken. The chaotic sequence R i = {r 0 , r 1 , ..., r N−1 }, i = 1, 2, 3 is generated, and the matrix C i ∈ R N×N is obtained according to Eq. (10) by R i . Obtain the matrix E i ∈ R N×N according to Eq. (11), obtain the sampling subset D i according to the algorithm 1, and finally obtain the i according to Eq. (9).
Step 3: The measurement matrix is measured in the three (stained) images of Eq. (8), which is compressed sensing. The measurement matrix i measures the three thinned images in Eq. (8), that is, the compressed sensing. The three measured values are obtained as y R , y G , y B ∈ R m×N .
Step 4: Next, the two measured images are subjected to two-dimensional fractional Fourier transform encryption.
Take the three measured images as an image F , the size is m × 3N , divide F into two parts from the middle, the left part is y 1 , the right part is y 2 , their size is m × 3 2 N , and the two parts are combined into a complex number, y 1 is the real part, y 2 is the imaginary part.
I(x, y) is a complex image. According to Eqs. (14)- (18), as, r 11 , r 22 , r 33 is calculated as the initial value to iterate the chaotic system L + m × N times, and the previous L times are discarded to obtain the chaotic sequence L i , i = 1, 2, 3.
L 1 , L 2 is used as a random phase mask for fractional Fourier transform, and the image is encrypted as: L 1 (x, y), L 2 (x, y) is a two-phase random mask, and α 1 , α 2 , β 1 , β 2 ∈ [−2, 2] is a fractional order in the x, y direction, respectively.
Step 5: Perform global scrambling, ascending L 3 , record the changed position w , w as the address code to reorder the image C to achieve scrambling effect. Convert the image C into a one-dimensional matrix in the order of the columns, and scramble the one-dimensional matrix according to the following rules.
y = s T = As T (13) I(x, y) = y 1 (x, y) + y 2 (x, y)i    www.nature.com/scientificreports/ Then, the scrambled matrix is converted into a two-dimensional matrix, and after being scrambled, the ciphertext is finally output as C 2 .
Decryption process. The decryption step is the inverse process of encryption.
Step 1: The anti-scrambling process, imitating step 5 of the encryption process, generates a chaotic sequence L i , i = 1, 2, 3 according to the key as, r 11 , r 22 , r 33 , sorts L 3 to obtain an address code w , converts C 2 into a onedimensional matrix C 1 , and the assignment direction becomes: Convert to two-dimensional matrix C.
Step 2: Decrypt out I(x, y): Calculate the resulting complex-valued image and get two parts, Step 3: Think of y 1 , y 2 as an image, then divide it into three images, use SL 0 algorithm to reconstruct the image, Arnold inverse scrambling and then perform wavelet inverse transform to obtain f R , f G , f B ∈ R N×N . Finally, the decrypted color image f is obtained.

Simulation results and performance analysis
Simulation result. In order to verify the feasibility and effectiveness of the encryption scheme, the security performance tests in this paper include key space, key sensitivity, correlation analysis, histogram analysis and various common attack tests. As shown in Fig. 2, matlab simulation experiments were performed using "House", "Baboon", "Pepper" and "Airplane" color images of size 256 × 256 × 3 , the corresponding TS are 10, 20, 10, 10. Figure

PSNR analysis.
Restoring an image includes decoding and reconstruction, using FrFT to decode under the correct key, and solving the l1 norm minimized reconstructed image is only similar to the plaintext image, so the quality of the decrypted image is evaluated using PSNR, and the formula is as follows: Of which, f (i, j),f (i, j) denotes the original image and the decrypted image respectively. Under the correct key, the decrypted image is as shown in Fig. 2. The PSNR of the five images is 38.8780, 37.9466, 28.5954, 37.6960, 38.0903, respectively. Therefore, the image decrypted by this algorithm is good. Figure 3 shows the PSNR values of different CRs of Lena, Pepper, House and Airplane images. The larger the CR, the larger the PSNR value, and the better the reconstruction effect. Table 1 shows the reconstruction effect of Pepper image of different CR. It can be seen from Table 1 that the compression performance of this algorithm is good. Taking the Lena as an example, the Table 2 lists the reconstruction performance comparison between this algorithm and other algorithms. With the same CR from the Table 2, the reconstruction quality of this algorithm is better.

Histogram analysis. Histogram analysis of important indicators of image security after image encryption 47 .
As shown in Fig. 4a1-a3, b1-b3, c1-c3 represents the R, G, and B components of the three color images of "Lena", "House" and "Baboon", respectively, a 4 -c 4 , a 5 -c 5 respectively represent the amplitude and phase after the three images are encrypted. Obviously, the histograms of the R, G, and B components of the three original images are different from each other, but different images are encrypted with very similar histograms, that is, the attacker cannot obtain useful messages from the ciphertext histogram.

Adjacent pixel correlation.
Randomly select the plaintext images R, G, B three channels and the amplitude and phase of the ciphertext on 2000 pairs of pixels for correlation testing 48 . The simulation results are shown in Fig. 5, from a 1 -a 3 , d 1 -d 3 , it is found that the correlation of the plaintext images in the horizontal, vertical, and diagonal directions is concentrated, showing a clear linear relationship, from b 1 -b 3 , c 1 -c 3 , e 1 -a 3 , f 1 -f 3 found that Scientific Reports | (2020) 10:18556 | https://doi.org/10.1038/s41598-020-75562-z www.nature.com/scientificreports/   Table 3.
Of which, It can be seen from Table 3 that the correlation coefficients of the plain image in the horizontal, vertical, and diagonal adjacent pixels are large. After encryption, the correlation coefficients of the ciphertext in the horizontal, vertical, and diagonal adjacent pixels are small and both at 1%. The algorithm proposed in this paper can effectively reduce the correlation of adjacent pixels. It can be seen from Table 4 that the encrypted correlation (27)         www.nature.com/scientificreports/ coefficient of this paper is lower than that most algorithms, so the encryption scheme of this paper can resist statistical analysis.
Information entropy. Test image randomness using entropy. If the entropy value is closer to 8, it means that the pixels of the image are more uniform. The formula for calculating entropy is as follows: where g represents a set of pixels. P(g i ) is the probability of occurrence of g, and L is the total number of g i . Table 5 shows the entropy corresponding to different images and comparison with other algorithms. The table shows that the encrypted image is close to 8, which means that it is safe against entropy attacks. Moreover, our algorithm is larger than the entropy value of the literature 9,10,12 , which shows that our algorithm is effective.

Key space analysis.
When an attacker uses a violent attack, this requires enough key space to prevent the attacker from obtaining any information without the correct key 36 . In this algorithm, take lena picture as an example, the control parameters of the Chebyshev chaotic system are α = 8 , the initial value formation angle key space of the two-dimensional DFrFT is S α 1 = S α 2 = S β 1 = S β 2 = 10 6 ; By calculating, the system key space is S = S α · S r 1 · S r 2 · S r 3 · S a · S b 1 · S b 2 · S t · S α 1 · S α 2 · S β 1 · S β 2 = 10 144 . It is much larger than the key space of each algorithm in Table 6, so the algorithm can resist brute force attacks.

Key sensitivity analysis.
The key sensitivity of the algorithm is very strong, any key small changes, other keys remain unchanged, under the correct encryption algorithm, cannot decrypt the correct plaintext image 49 . The simulation experiment results are shown in Fig. 6a- It can be seen that the key is slightly transformed, the MSE is large, and the original image cannot be seen in the decrypted image. Figure 7f-i show the MSE graph of the deviation of the FrFT order α 1 , α 2 , β 1 , β 2 , and it can be seen that the order is slightly changed, and the MSE is large. Therefore, this algorithm is very sensitive to keys.   Table 7 compares the PSNR value of the decrypted image and the Lena plaintext image when the encrypted image is attacked by GN, SPN, and SN when the compression rate is 50% with the algorithm 25 . It can be seen from the table that this algorithm has a stronger ability to resist noise attack. Add random noise of different intensities to the Lena ciphertext image, as shown in Eq. (29). The Table 8 is the PSNR value of the decrypted image and the plaintext image with random noise added with different intensities. It can be seen that the quality of the restored image by this algorithm is relatively high under the same intensity.
(29) I = I + k × Noise doubt that the quality of the decrypted image will decrease. Figure 9 shows three different clipping methods and their recovery results. Experiments show that although the decrypted image is a rough version of the original image, the main information of the original image can still be represented by the correct key. Experiments have shown that encryption algorithms can resist tailoring attacks. Table 9 is a comparison of the PSNR of Lena's decrypted image and plaintext image with other algorithms. The image is restored after 5%, 10%, and 20%     Here M and N respectively represent the width and height of the image, and d 1 and d 2 are the two ciphertext images after the original plaintext image has been changed by one pixel value. If d 1 (i, j) = d 2 (i, j) , then D(i, j) = 1 , otherwise, D(i, j) = 0 . We add 1 to any pixel value, calculate 100 groups, and take the average to get Table 10. It can be seen from Table 10 that the NPCR obtained by the encryption scheme is about 99.60%, and the UACI is greater than 33%. Table 11 is the comparison result between this algorithm and other algorithms. We can find that although our results are not the best, they can resist differential attacks.

The influence of different sparse and reconstruction methods on encryption and decryption results.
To analyze the impact of sparse methods and reconstruction methods, we use DWT and DCT sparse 256 × 256 Pepper, and use OMP and SL to reconstruct image. As shown in Fig. 10, (a) is an encrypted image using DWT, (b) is an encrypted image using DCT, (c) is an image reconstructed using DWT sparse and SL0, and www.nature.com/scientificreports/ (d) is an image reconstructed using DWT sparse and OMP, (e) is an image reconstructed using DCT sparse and SL0, (f) is an image reconstructed using DCT sparse and OMP. It can be seen from the figure that using DWT sparse, the reconstructed visual quality is better. Figure 11 shows the relationship between the reconstruction effect and the threshold TS. It can be seen that when TS = 10, using DWT sparse, the PSNR value of SL0 reconstruction is the largest.

Time analysis.
In practical applications, both safety performance and time must be considered. As shown in Tables 12 and 13, this paper analyzes the encryption and decryption time of different sizes of images and different CRs. It can be seen from the table that for the same image, different CRs have a slight impact on the time. For 256 × 256 images, the encryption time range is 1.5-2, and for 512 × 512 images, the encryption time range is 5-6. For 256 × 256 images, the decryption time range is 3-5, for 512 × 512 images, the decryption time range is 10-15.
The reason for the increase in the decryption time is that the reconstruction process takes a long time to find the optimal solution. When CR is equal, as the image size increases, the encryption and decryption process takes more time. Therefore, in practice, CR and time are comprehensively considered for selection. Table 14 compares the time with other algorithms. As shown in the table, our algorithm takes the shortest time.

Conclusion
This paper combines the advantages of structured random perceptual matrix and chaos to obtain a structured sensing matrix measurement image. A compression-based and two-dimensional fractional Fourier image encryption is proposed. This paper first compresses and encrypts through CS, and then re-encrypts through 2D FrFT. The inverse scrambling matrix, the chaotic cyclic matrix, the sampling subset and the double random phase mask are generated by the Chebyshev chaotic sequence, that is, the chaotic system controls the encryption process. Simulation experiments show that the proposed algorithm has good resilience and robustness. It can not only resist statistical analysis, noise attack and tailoring attacks, but also has a large key space and is sensitive to keys. Therefore, the algorithm has good performance and security.