An Image Encryption Scheme Based on Logistic Quantum Chaos

This paper proposes an image encryption scheme based on logistic quantum chaos. Firstly, we use compressive sensing algorithms to compress plaintext images and quantum logistic and Hadamard matrix to generate the measurement matrix. Secondly, the improved flexible representation of the quantum images (FRQI) encoding method is utilized for encoding the compressed image. The pixel value scrambling operation of the encoded image is realized by rotating the qubit around the axis. Finally, the quantum pixel is encoded into the pixel value in the classical computer, and the bit-level diffusion and scrambling are performed on it. Numerical analysis and simulation results show that our proposed scheme has the large keyspace and strong key sensitivity. The proposed scheme can also resist standard attack methods such as differential attacks and statistical analysis.


Introduction
Digital images are important information carriers and are widely used in various fields, such as social networks, education and medical systems [1,2]. Images can carry much redundant information, and it is easy to cause inadvertent privacy leakage in the transmission process, which eventually brings huge economic loss to users [3]. Especially in recent years, there have been many private information leakage incidents, which have aroused widespread discussion and concern among the public. Therefore, the research on image security is receiving more and more attention from scholars [1,4,5]. Image encryption can protect users' private information from being leaked. However, traditional encryption methods such as AES, DES, 3DES, RC and BlowFish cannot protect image security because these algorithms cannot eliminate the characteristics of adjacent pixel correlation and information redundancy of ciphertext images [6]. Because the image has a high correlation between adjacent pixels and data redundancy, these characteristics lead to the unsatisfactory results of traditional encryption methods and are easy to be attacked [7,8]. Given the limitations of traditional encryption methods, many scholars have also proposed corresponding image encryption algorithms [9][10][11][12]. Image encryption algorithms based on chaotic systems have become a research hotspot.
The chaotic system is a nonlinear dynamic system and is difficult to predict. Meanwhile, it is sensitive to initial parameters and ergodic. Based on the above characteristics, Matthews first proposed an encryption algorithm based on chaos in 1989 [13]. Hua et al. proposed a high efficiency scrambling and diffusion image encryption algorithm for the problem of the privacy leaks of medical images [1]. The robustness of the algorithm is excellent, and the encrypted medical images can effectively resist image noise attacks. Liu et al. used Markov chains to improve the chaotic sequence distribution of the coupled lattice mapping (CML) [14], making the improved sequence distribution uniform. The improved sequence in this scheme can pass 15 test suites of NIST 800. However, the time complexity in this work increases with the introduction of nodes, and the efficiency may decrease exponentially. Goggin et al. used the recoil rotor model to measure the classical logistic system in 1990 and obtained the three-dimensional quantum logistic mapping [15]. Many scholars have proposed an image encryption algorithm based on quantum chaos based on Goggin's work [16,17].
With the introduction of quantum computers [18], quantum image representation, as a critical information format, has also attracted widespread attention from researchers in recent years [16,[19][20][21]. Quantum computers are pretty different from traditional computers in storage and calculation methods. In terms of calculation methods, taking 2D digital images as an example, the calculation of images by classic computers is matrix operations, and the calculation of images by quantum computers is the evolution of unitary operators. Therefore, many researchers have proposed corresponding algorithms to represent images on quantum computers [21][22][23][24]. Yao et al. proposed an algorithm to encode 2D classical images into pure quantum states [23]. They assumed that the quantum state's probability amplitude represents the pixel value of the image on the quantum computer, and the quantum ground state represents the pixel's position. In 2003, Venegas-Andraca et al. first proposed the image quantum encoding algorithm based on qubit lattice [19,25]. They assume that a qubit stores each pixel value of the input 2D image. Therefore, at least 2n bits are required to store the pixel value for the input image. However, this storage method does not realize the quantum acceleration function. In 2011, Le et al. designed a flexible representation of quantum images (FRQI) based on the qubit lattice theory [21]. They took the pixel value and position in the form of a quantum state tensor product. The qubits required in the encoding process are reduced from 2n bits to n bits, which improves storage efficiency. Zhang et al. also proposed the NEQR quantum image encoding method. Both NEQR and FRQI use the base state |k to represent the pixel position, but it is worth noting that FRQI takes the pixel value during the encoding process [26]. The information is stored in the probability range, while NEQR stores the pixel value information in the ground state. Moreover, because NEQR's quantum state is orthogonal and distinguishable in each ground state, the NEQR has a secondary acceleration in the quantum image preparation process, and the compression rate of the quantum image is 1.5 times higher than FRQI. The researchers propose the corresponding quantum image processing technology and machine learning algorithm for quantum images based on the quantum image representation algorithm. In [27], Ma et al. encode image information using qubits and implement image dilation and erosion operations in quantum computers. In Reference [28], the authors use competitive learning and quantum computing to develop a new classification algorithm that can classify inputs even when they are incomplete. Zhou et al. used novel enhanced quantum representation (NEQR) to encode images and performed Arnold transformation on the pixel values of quantum images to achieve pixel-level scrambling, but they did not eliminate the security threat of Arnold transformation [16].
Compressed sensing can break through the limitations of the Nyquist sampling theorem and use sparse data to restore the original signal [29][30][31][32]. Researchers have applied it to image encryption and machine learning [29,33]. Combining chaotic systems and compressed sensing theory to propose image encryption algorithms is a field worthy of in-depth study. In the image encryption process, the length of the encryption time largely depends on the data dimension. If the data dimension can be reduced, the encryption time of the encryption system can be decreased. At present, many researchers have proposed chaos theory and compressive sensing algorithms. For example, Chai et al. used 2D compressed sensing algorithms to encrypt images into cryptographic images with visual significance [29]. Wang et al. used a parallel compressed sensing algorithm to encrypt images, in encryption time and excellent encryption effect [4].
In order to ensure that the quantum image can be securely transmitted and used in the future quantum computer era, we convert the classical image into a quantum state and then encrypt it. This paper proposes an image encryption scheme based on logistic quantum chaos. The contributions of this paper are summarized as follows:

1.
We use quantum logistic mapping and the Hadamard matrix to generate the measurement matrix. This new matrix can improve encryption scheme security in the compressed sensing process in this paper.

2.
We use the FRQI quantum encoding method to perform quantum encoding on the compressed image, which can significantly reduce the amount of encoded data without affecting the encryption result.

3.
We combined the Bloch spherical surface to propose a new pixel value scrambling method. This new operation can reduce time complexity and improve system security in the encryption process.

4.
We use the improved FRQI to encode the classical image. In the new quantum image representation scheme, the pixels of the classical image are only related to one rotation angle of the Bloch sphere. On the premise that the other rotation angle is unchanged, it is easier to encrypt the quantum image, and the complexity of the new quantum representation scheme is the same as that of FRQI.
The structure of this paper is as follows: In Section 2, we give the corresponding essential work. In Section 3, we describe the encryption and decryption process of the proposed algorithm. Section 4 analyzes the image security after encryption, and Section 5 concludes this paper.

Compressive Sensing (CS)
Suppose the N × 1 dimensional signal f is a non-sparse signal [31]. We need to find an N × N dimensional orthogonal basis transform base matrix Ψ N×N so that f has a sparse representation in the transform domain Ψ. Namely: (1) Therefore, the CS process can be expressed as: The Φ is the measurement matrix. A represents the sensing matrix, which is an M × N dimensional matrix.
Since the dimension M of the measurement vector y is much lower than the dimension N of the observed signal x, (1) is an underdetermined system, making y impossible to accurately calculate the target signal f. However, CS theory proves that if the perception matrix A can meet the Restricted Isometry Property (RIP) condition [32], the original signal can be recovered from the measured signal.
Therefore, the measurement matrix needs to meet: The δ k represents isometry constant. Reconstruct the original problem accurately by transforming it into an l 1 norm problem.
The ||x|| 1 represents the l 1 norm of the vector x.
The image reconstruction algorithm can use orthogonal matching pursuit (OMP) [4,33,34], matching pursuit (MP) [35], subspace tracking (ST) or basis tracking algorithm. In order to effectively restore the original image from the measured matrix, in this paper, we use the OMP method to reconstruct the compressed image.

Quantum Logistic Mapping
In 1990, Goggin [15,17] used the recoil rotor model to quantify the Logistic chaotic system. The Goggin method uses the coupling dissipative quantum system and the harmonic oscillator path to produce the new quantum system. Finally, Goggin obtained the 3D quantum modified logistic system corresponding to δaδa according to the Heisenberg dynamic motion equation δa [17]. The mathematical definition of the three-dimensional quantum logistic system is as follows: In (5), x = a , y = δa † δa , z = δaδa , δa describes the quantum fluctuations about a and δa → 0. The r represents the control parameter, β is the dissipation parameter and x n * , z n * is the conjugate complex number of x n , z n , and in the chaotic state when

Quantum Encoding of Images
This section will use the quantum encoding method proposed in reference [22] to encode images and continue to encrypt images after encoding. The specific encoding method is as follows: The θ and φ are the Bloch vector angles. The position of the k-th (k = 0, 1, . . . , 2 2n−1 ) pixel is described as | k . The gray value is | c k . The x k is a pseudo-random number in [0, 1]. In this article, we use the quantum logistic equation to generate x k .
The quantum state of the encoded image satisfies the normalization condition [22]: At the same time, reference [22] gives a fast implementation of image quantum coding, the specific description is as follows: Step 1: Define quantum revolving door R k (θ k , ϕ k ): Step 2: Define a controlled revolving door CR k (θ k , ϕ k ): Step 3: Prepare the initial state of the qubit |0 ⊗2n+1 .
Step 4: To calculate the intermediate state, use the two-dimensional Hadamard matrix and the identity matrix |H .
Step 5: Perform CR k (θ k , ϕ k ) on the intermediate state: Step 6: In order to obtain the encoded quantum image, perform CR k (θ k , ϕ k ) continuously on the intermediate state:

Algorithm Description
In this section, we select Lena.bmp as plaintext, in which M = 256 and N = 256, where M and N are the length and width of plaintext, respectively. Quantum logistic function's parameters are: x = 0.5, y = 0.0032, z = 0.12, r = 3.99, β = 7. The iterative number of quantum logistic is related to the size of plaintext images. Orthogonal matching pursuit (OMP) algorithm is used to reconstruct the image after compressive sensing.

Compressed Sensing Process
In the encryption process, the plaintext image is represented by I.
Step 1: The two-dimensional wavelet transforms to the plaintext image I, transformation model is haar transform model. After the two-dimensional wavelet transforms, we can obtain the decomposition coefficients c and length s for each layer. . (14) N is the layer of the two-dimensional wavelet transform, and we set N = 4 in step 1. H, V and D are three directions of plaintext image. The A and H are low frequency and the high frequency of each layer, respectively. The low frequency contains the feature of the plaintext image, and the high frequency contains the details of the plaintext image. To ensure the quality of the reconstructed image, we only compress the high-frequency data, and the low-frequency data of the plaintext image will not be compressed.
Step 1.1: Use QR decomposition to low-frequency data cA, N is the two-dimensional wavelet transform layer number and N = 1, 2, 3, 4. Both q and r are matrices.
Step 1.2: Extract the diagonal data in the r and append it to the end of matrix q as one of the decryption keys. The matrix r after being extracted data replaces the cA as a part of the plaintext image to encrypt.
The vector temp is a temporary vector, and i is the position index of the matrix r.
Step 1.3: Grouping high-frequency data: Equation (17) can be used to obtain high-frequency data of each layer cB, and then cB is transformed to the matrix according to the length of the decomposition coefficient s for each layer. Namely, Step 2: To ensure the high reconstruction quality of the plaintext image, the highfrequency data after wavelet decomposition needs to be sparse operation. We use Algorithm 1 to sparse the high-frequency data matrix.

Algorithm 1 Calculating the sparsity threshold
Input: cB = cB h,v,d+r . Output: sparsity matrix STD i . 1: Set sparse rate: 0.10 ≤ iSTD ≤ 0.15; 2: Obtain length and width of the matrix: s h,v,d . 3: Sparsify each row of the matrix, std = 0; // sparsity threshold iSTD = sparsity(cB, std); // sparsity rate 4: while std < 0.1 and 0.10 ≤ iSTD ≤ 0.15 std = std + 1 × 10 −4 iSTD = sparsity(cB, std); end 5: pos = find(abs(cB)< std); 6: cB(pos) = 0; Step 3: After sparsification, the overall sparsity may reach the iSTD, but some data may be concentrated within a particular region. Therefore, it is necessary to displace the data and distribute these pixel points evenly throughout the sparse matrix. Use Equation (19) to confuse the matrix, Both start and space are the confusing start and end positions, respectively. The index represents the position of the original matrix, which is a part of the decryption key. The josephTraverse is the confusion function.
Step 4: Building the measurement matrix Φ. Repeat Algorithm 2 until each layer's high-frequency and low-frequency data have corresponding Hadamard measurement matrices Φ ij M×N/2 i .
Step 5: Use Equations (20) and (21) to compressive high-frequency and low-frequency data, Splice all matrices into the compressed matrix x after compressive sensing.
Step 6: Quantizing the compressed matrix x can facilitate bit-level encryption and quantum pixel conversion operations. ).

Quantum Pixel-Level Encryption
Step 7: Use Equations (9)-(13) to quantum code the image x after compressive sensing, the size of x is M/2 × N and the coding result is recorded as I(θ, ϕ).
Step 8: Scrambling operations in quantum pixel level. From Section 2.3, we know that each pixel value is only related to θ k and not related to ϕ . Therefore, we can let ϕ remain unchanged and rotate θ k to change the gray value.
Calculate the rotation angle ∆θ k : q 1 , q 2 , q 3 are pseudo-random sequences generated by the quantum logistic system. q 1 is involved in the quantum encoding generation of images.
Let the Bloch sphere coordinates of |c k be (x k , y k , z k ) to make |c k rotate toward the Bloch sphere to the point (0, 0, −1). The rotation axis should be: The rotation matrix is, I is the unit matrix, and i is the imaginary unit. σ represents the Bubbleley matrix σ = (σ x , σ y , σ z ): Controlled revolving doors: The rotation on the sphere can be defined as:

Bit-Level Encryption
Step 9: Quantum encoding image is scrambled in bit-level. Calculate the pixel value c according to ∆θ k . Use Equation (25) to scramble pixel value c .
X is the pseudo-random value generated by the iterative quantum logistic system. The ⊕ is the bitwise-XOR operation.
Step 10: Semi-ciphertext C is scrambled by the josephTraverse function in bit level.
[C, index] = josephTraverse(C, start, space) At this point, the encryption process is all over. The encryption process flowchart is shown in Figure 1. Figures 2-4 show the encryption and decryption results of the proposed scheme.

Decryption Process
The decryption process is the reverse process of the encryption process. The details are as follows: Step 1: Use the ijosephTraverse function to inverse scrambling on the ciphertext C.
The index is the coordinate before josephTraverse. C is the decryption result.
The X is the pseudo-random value generated by the iterative quantum logistic system. The ⊕ is the bitwise-XOR operation.
Step 3: Decrypt the quantum coding image. The rotation matrices used in the encryption process are all unitary matrices and conform to the basic principles of quantum mechanics [21]. Therefore, we only need to change rotation matrices to conjugate transpose to decrypt the ciphertext in the decryption process.
M k is rotation matrices. Let M + k be the conjugate transpose matrix of M k . According to unity, we can obtain M + k : Calculate the decryption-controlled revolving door C k,1 according to Equation (29). Use Equation (36) to decrypt quantum coding ciphertext image: Before decrypting at the bit level, the decrypted ciphertext image |I(θ, ϕ) needs to be converted into a gray value by quantum measurement. In order to achieve quantum measurement, we define the measurement symbol K, The gray value of the n-th pixel c n : Step 4: Inversely scramble the image c n .
Step 5: Use OMP to reconstruct the image of the decrypted compressive sensing semi-plaintext image.
Step 6: Use inverse wavelet transform to restore the plaintext image P. The decryption process flowchart is shown in Figure 5.

Keyspace Analysis
An excellent image encryption algorithm should have a large enough keyspace to resist the brute force attack analysis [36]. In theory, the keyspace needs to reach the power of 2 100 to resist the brute force attack analysis of the attacker [37]. In our proposed algorithm, our algorithm key consists of two parts:

1.
Quantum logistic parameters: x, y, z, r, β and the number of max iterations; the number of wavelets transforms layers N, the start position and interval distance of the josephTraverse algorithm; the quantum logistic parameter in the quantum encoding process and the rotation angle θ.

2.
The q matrix and the josephTraverse generated the index during the encryption process.
This result is much larger than the standard requirement of 2 100 , so the encryption algorithm we propose can resist brute force attack analysis. As shown in Table 1, compared with the research in references [4,17,33,[38][39][40], our image encryption algorithm has a large enough keyspace to withstand all types of brute force attacks.

Key Sensitivity Analysis
In Figure 6, we use Lena256 as the encryption object to test the key sensitivity of our encryption system. During the test, we used the original key as: Key = [x = 0.5, y = 0.0032, z = 0.12, r = 3.99, β = 7, q, index]. We add 10 −10 to the above keys respectively and use the modified key to decrypt the ciphertext in the decryption process. The decryption result is shown in Figure 6. From Figure 6, we can see that even if the key changes 10 −10 , the wrong key cannot decrypt the ciphertext correctly, proving our encryption scheme is highly sensitive to the key.

Adjacent Pixel Correlation
There is a strong correlation between adjacent pixels of a plaintext image, and an attacker can crack the algorithm by analyzing the correlation between adjacent pixels. Therefore, the correlation between pixels needs to be reduced to avoid statistical attacks in the design of the encryption algorithm. In this article, we use Equation (40) to calculate the correlation between adjacent pixels: In Equation (40), cov(x, y) = 1 x i . x and y are adjacent pixel values. N is the total number of pixels selected from the image. We select 17 images of different sizes as plaintext for encryption. Randomly select 10,000 pairs of adjacent pixel values, and calculate its correlation in three different directions: vertical, horizontal and diagonal. The specific calculation results are shown in Table 2, and the corresponding adjacent pixel correlation distribution is shown in Figure 8. Finally, we choose Lena's ciphertext image to show the horizontal, vertical and diagonal pixel distribution in Figure 9. We can see that all the pixel values in the plaintext Lena is concentrated near a certain line, (a), (c) and (e) of Figure 9. However, in the pixel distribution of the ciphertext, the pixel values are evenly distributed throughout the space in (b), (d) and (f) of Figure 9, proving that the proposed encryption algorithm can resist statistical attack analysis.
At the same time, we also compare our proposed algorithm with other similar encryption algorithms using an image of Lena256. Table 3 shows that our algorithm correlation coefficient of adjacent pixels is better than similar encryption algorithms.

Information Entropy
In 1948, Shannon proposed [41] the concept of information entropy, which is the degree of confusion in the information source. The concept of information entropy can describe the uncertainty of the ciphertext. In an ideal state, the closer the information entropy is to 8, the better the encryption effect.
We calculate the information entropy of 17 ciphertext images of different sizes, shown in Table 4. From Table 4, we can see that the information entropy of the 17 ciphertext images is close to the ideal value of 8. These results indicate that the ciphertext images are very messy and can resist the statistical attack analysis of the attacker.

Size
Test Image Entropy Table 4 uses Lena256 as the information entropy test object to compare with other similar encryption algorithms. From the comparison results in Table 5, the information entropy of our proposed algorithm is better than similar algorithms. -Reference [4] 7.9968 Reference [38] 7.9985 Reference [39] 7.9977 Reference [40] 7.9986 Reference [17] 7.9993

Robustness Analysis
Robustness is an important indicator that shows whether a cryptographic system can resist interference. In Section 4.4, we use noise attacks and blocking attacks to verify the robust performance of our proposed cryptographic system.

Noise Attack Analysis
Common noise types include Gaussian noise, Poisson noise, multiplicative noise and salt and pepper noise. Salt and pepper noise has the most significant impact on the ciphertext image among all the noises. We add salt and pepper noise to the ciphertext image in Section 4.4.1 and decrypt the ciphertext after adding noise. Figure 10 shows the decrypted image with different noise intensities. From Figure 10, we can see that when the salt and pepper noise intensity reaches 0.1, the decryption result can also be distinguished with the naked eye, proving that our algorithm can resist noise attacks.

Crop Attack Analysis
We crop the 8 × 8, 16 × 16 and 32 × 32 information of the ciphertext image for testing. The quality of the decrypted image will decrease as the block size increases. In Figures 11-13, we show the ciphertext image cropped with different sizes of block and the corresponding decrypted image. From the experimental results, it can be seen that when the crop size is 32 × 32, the decryption result has the greatest impact, but even when the decryption result is the worst, we can still understand the information carried by the decrypted image, which proves that our algorithm, to a certain extent, can withstand tailoring attacks.

Resistance to Difference Analysis
Differential attack refers to a cryptanalysis technique that obtains the encryption key by analyzing the difference between two ciphertexts after making small changes on the plaintext. The number of pixels changes rate (NPCR) and unified average changing intensity (NACI) are generally used as evaluation indicators when measuring whether a cryptographic system can resist differential attacks. The ideal values of the two indicators are NPCR ≥ 99.6093% and UACI ≥ 33.4635%.
W and H represent the image's width and height, respectively. c 1 and c 2 are two ciphertext pixels of images. i and j are the same position index of the c 1 and c 2 .
We calculated the NPCR and UACI of 15 ciphertext images with 1bit data changed in Table 6. We can see that our NPCR and UACI are close to their respective ideal values, proving that our algorithm can resist differential attacks. Table 7 uses Lena256 as the NPCR and UACI test object to compare with other similar encryption algorithms. From the comparison results, the NPCR and UACI of our proposed algorithm are better than similar algorithms.

Size
NPCR UACI Table 7. Compare with another algorithm.

Time Complexity Analysis
Time complexity analysis is a critical indicator to measure an encryption algorithm [42]. The primary encryption time consumption concentrates on wavelet transform (Step 1), sparse (Step 2), iterative quantum logistic system (Steps 2-5), normalization (Step 6), joseph-Traverse (Steps 3, 5), image quantum coding (Step 7) and quantum scrambling (Step 8) in the encryption process. In the compressive sensing process (wavelet transform (Step 1) and sparse (Step 2)), the time complexity of constructing the measurement matrix for compressed sensing is O(nlogn). In the quantum encoding stage, we use the same number of quantum gates in the encoding method as FRQI, so the computational complexity of the two is the same, that is, O(log 2 (n)), and the time complexity during the axis rotation phase is easy to calculate as O(n 2 ). The total time complexity of bit-level scrambling and diffusion does not exceed O(n 2 ) in Steps 2-5, Step 6 and Steps 3 and 5. The proposed encryption algorithm has better performance than classical algorithms in computational complexity.

Conclusions
This paper uses the FRQI quantum coding method on the classical computer. Firstly, we use compressive sensing algorithms to compress plaintext images to reduce data dimensions for shortening the time of quantum encoding. Secondly, FRQI is used to encode the compressed image and the scrambling operation by rotating the qubit around the axis. Finally, the bit-level diffusion and scrambling in the classical computer is performed. The computational complexity is not high in the whole encryption process. However, there is no way to achieve quantum parallelism in the simulation of classical computers, resulting in low computational efficiency. Although we compress the image data in the encryption process, the encryption time is still unsatisfactory. Because the existing quantum image coding methods and image storage models are currently in the theoretical research stage, the coding efficiency is not satisfactory. In addition, numerical simulation and theoretical analysis show that our proposed algorithm has better performance when compared with similar algorithms. Therefore, our scheme can guarantee the security of the image during transmission in the future quantum era.