Quantum Image Encryption Based on Quantum DNA Codec and Pixel-Level Scrambling

In order to increase the security and robustness of quantum images, this study combined the quantum DNA codec with quantum Hilbert scrambling to offer an enhanced quantum image encryption technique. Initially, to accomplish pixel-level diffusion and create enough key space for the picture, a quantum DNA codec was created to encode and decode the pixel color information of the quantum image using its special biological properties. Second, we used quantum Hilbert scrambling to muddle the image position data in order to double the encryption effect. In order to enhance the encryption effect, the altered picture was then employed as a key matrix in a quantum XOR operation with the original image. The inverse transformation of the encryption procedure may be used to decrypt the picture since all the quantum operations employed in this research are reversible. The two-dimensional optical image encryption technique presented in this study may significantly strengthen the anti-attack of quantum picture, according to experimental simulation and result analysis. The correlation chart demonstrates that the average information entropy of the RGB three channels is more than 7.999, the average NPCR and UACI are respectively 99.61% and 33.42%, and the peak value of the ciphertext picture histogram is uniform. It offers more security and robustness than earlier algorithms and can withstand statistical analysis and differential assaults.


Introduction
With the development of internet and communication technology, image has become the most widely used information transmission medium. Compared with text information, images contain more information. As a result, researchers suggest quantum image processing by extending the digital picture to the quantum computing framework [1,2].
Quantum image processing (QIP) is committed to using quantum computing technology to capture, restoration, and other classical image operations. its exponential storage capacity and parallelism give this technology a strong advantage in implementing operations requiring high real-time operations such as image retrieval and processing.
The special behavior of quantum particles is regarded as the rules of quantum physics and the tool of mathematical logic. In 1992, Lucien Hardy proposed Hardy's paradox while proving Bell's theorem [3], and continued to prove the nonlocality of two particles in 1993 [4]. Moreover, Shor [5] and Grover [6] created quantum algorithms using the same quantum computer property for integer factoring and database searching, respectively. These algorithms perform better than their traditional versions in terms of running time. References [5,6], which laid the foundation for diverse applications of quantum computing in the information sciences, served as an inspiration for a great number of researchers [7][8][9][10][11][12][13][14][15][16].
Quantum image encryption can be "unconditionally secure" based on the Heisenberg uncertainty principle because of quantum features such as quantum entanglement, coherence, parallelism, and superposition. Quantum picture encryption employs the "No-Cloning Theorem", derived from the Heisenberg uncertainty principle, to encrypt image data, whereas conventional encryption typically restricts the timeliness of decryption operations. That is, because the basis of replication is measurement, and because measurement often modifies the quantum state, it is impossible to accomplish the process of accurate duplication of any unknown quantum state in quantum mechanics.
To establish image protection in the sphere of digital pictures [17], the genuine and meaningful images are often transformed into meaningless forms. Today's latest research hot topic is the quantum picture encryption technique created by fusing together quantum computing and digital imaging [18][19][20]. There are several quantum image representation techniques now being used [21], including FRQI [22], NEQR [23], MCQI [24], NASS [25,26], QUALPI [27], and others. Image information encryption has caught the attention of academics working in the area of quantum information processing. Recently, several quantum image encryption methods have been created, including a quantum image encryption scheme based on quantum image decomposition [28], an iterative extended Arnold transform-based quantum image encryption method, and a quantum image cyclic shift operation-based quantum image encryption strategy [29].
DNA coding has attracted wide attention because of its advantages such as large storage capacity and strong parallel processing ability. Compared with the traditional cryptography based on mathematical problems, DNA cryptography combines the two fields of mathematics and biology, which greatly enhances the security and robustness of DNA cryptography. In 1994, Adleman carried out the world's first DNA computing experiment [30] and published related results in the journal Science. This result revealed that DNA molecules have computing power in addition to their stable genetic properties, and have since opened up a new information age [31][32][33]. At present, DNA coding is also gradually emerging in the field of encryption [34][35][36][37]. Scholars have proposed a classical image encryption algorithm that combines DNA coding technology with quantum walking [38].
In this research, a DNA coding technique and picture Hilbert scrambling were combined to develop a quantum image encryption scheme. The encryption technique uses Hilbert quantum image scrambling and quantum picture DNA coding and decoding. By closely integrating the two technologies, the goal of enhancing picture security may be achieved by more effectively reducing the high connection between neighboring pixels. We also developed the quantum DNA codec's implementation circuit.
The rest of this article is structured as follows: Section 2 introduces the background. Section 3 shows the quantum circuit model. In Section 4, the flow of encryption and decryption algorithm is shown in detail. Section 5 introduces the theoretical analysis and experimental simulation. Finally, Section 6 draws a conclusion.

Quantum Color Image Representation
NCQI is a quantum color digital image representation method proposed in 2017 [39]. We briefly reviewed the NCQI quantum representation model so as to introduce the quantum image encryption algorithm proposed in this paper.
The NCQI model of a 2 n × 2 n image |ψ can be mathematically expressed as follows: where c (y,x) represents the color value of the pixel, which can be encoded by binary sequence R q−1 · · · R 0 G q−1 · · · G 0 B q−1 · · · B 0 . Every pixel contained in a color channel, which has a range of [0, 2 q − 1], is represented by three components: the horizontal position X, the vertical position Y, and the color information c (y,x) . The R, G, and B range [0, 2 q − 1] of each channel is utilized to store picture data in an NCQI state of a color image using the 2n + 3q qubits. Figure 1 is an example of a 4-by-4-color picture with the three channels, R, G, and B, with the range size 0, 2 8 − 1 , n = 1, and q = 8. The equation in Figure 1 states that the whole NCQI is kept in a state of normalized quantum superposition, with each base standing in for a single pixel.

DNA Coding Method and Operation
Adenine (A), thymine (T), cytosine (C), and guanine (G) are the four nucleotides that make up the molecular structure of deoxyribonucleic acid (DNA), which is based on the biological model (G). The DNA pairing rule states that A and T pair and C and G pair. Similarly, in the binary complementary calculation, 1 and 0 are complementary, and eight coding schemes which accord with the rules of a biological model were obtained by encoding each nucleic acid base with 2-bit binary number respectively, as shown in Table 1. Each RGB three-channel pixel in a color image is represented as a 24-bit binary sequence as part of the encryption procedure, where each color channel's 8-bit binary sequence may be represented by four bases. For instance, scheme 1 will produce CACT if an image pixel's R-channel gray value is 71, which is represented by the binary sequence 01000111.

Quantum Hilbert Scrambling
With the development of quantum image processing, many image scrambling methods have emerged [40,41]. In this work, quantum Hilbert image scrambling [42] was used.
An original image of size 2 n × 2 n can be regarded as a matrix. We call this matrix the starting matrix (or original matrix) S n and used 1 to 2 2n to encode all pixels, The arrangement of S n is H n . For example,   This paper adopted the improved Hilbert scrambling recursive generation algorithm in [42]. If A is a matrix, then A T represents its transposition, A ud its upper and lower direction reversed, A ld its left and right inversion, and A pp its centre rotation matrix. For a quantum computer to implement Hilbert image scrambling, where n is a positive integer and the initial matrix is According to reference [42], initialization, and even and odd basic circuits, are also integrated circuits, and the process is described in Figure 4. The three parts that make up the three basic circuits are called three circuit modules.

Quantum XOR
According to reference [43], it needs to be divided into 2 2n sub-operations Y y,x in order to implement the XOR operation on each pixel value of the quantum image. Use Y to represent a matrix of the same size as the image in the sub-operation: where y y,x = m 0 yx m 1 yx m 2 yx m 3 yx , · · · , m 23 yx , m i yx ∈ 0, 1, and the quantum gate operation sequence F are generated according to y i,j : where represents the realization of the X-gate transformation or I-gate transformation of C i yx , respectively: When F is applied to the entire image, there are: where | f (Y, X) represents the new pixel value after pixel scrambling, and |C YX is the pixel sequence.

Quantum Circuit Design
The design of the DNA codec simulator's quantum circuit, which is a crucial component of our quantum picture encryption technique, is presented in this section.

Quantum DNA Codec Simulator
Based on the classical DNA coding technology and the quantum image representation of NCQI, a DNA codec simulation circuit for quantum images was designed.
In our proposed encryption algorithm, quantum DNA coding and decoding technology were used to encrypt pixel color information. NCQI representation can directly transform the color value information of a color image with three-channel color values in the range of [0, 2 q − 1] of 2 n × 2 n into a binary sequence of 3q bits, so we took every two lines as a combination to reflect the concept of bases in biology.
We encapsulated the whole quantum DNA codec into a black box. We only needed to input the binary sequence of the image into the black box and enter the sequence number of the coding and decoding scheme to complete the DNA codec operation of the quantum image. D i,j was used to represent the quantum DNA codec, where i is the coding scheme sequence number and j is the decoding scheme sequence number. As shown in Figure 5, six lines were added to reflect the sequence number of the codec scheme, and |ψ 0 and |ψ 1 were input lines as binary sequences. Three quantum lines b 0 ,b 1 ,b 2 can represent the numerical value of the decoding scheme sequence number. When designing quantum circuits, we used two auxiliary circuits. While reducing a lot of time complexity, we only added a little space complexity. Therefore, it can effectively reduce the circuit complexity and improve the operation efficiency. If we decode it with option 6, the circuit module of the scheme will be run directly through the three quantum lines b 0 ,b 1 ,b 2 . As a result, only the sequence number of the decoding scheme can be input to run the circuit to realize automatic decoding, and there is no need to select the circuit. Figure 6 shows the quantum circuits of seven decoding schemes encoded in Rule 1.  In this paper, we designed the quantum circuits of seven kinds of decoders with scheme one as the coding scheme, and showed the process of transforming the same binary sequence from scheme one to the other seven schemes. As shown in Table 1, the sequence was first quantum DNA encoded according to scheme 1. If the second scheme is used for decoding, it is necessary to reverse the two lines when the high qubits are different from the low qubits, that is, to realize the interchange between C and G. If the third scheme is used for decoding, it is necessary to reverse all the low qubits, that is, to realize the interchange between A and C and between T and G. If we use scheme 4 to decode, we need to reverse the high qubit and the low qubit at the same time and, if the high qubit is different from the low qubit, we need to flip the low qubit. If we use scheme 5 to decode, contrary to scheme 4, we need to flip high qubits when high qubits are different from low qubits, and if high qubits and low qubits flip low qubits at the same time. If decoding is carried out in scheme 6, each set of high qubits needs to be flipped. If we use scheme 7 to decode, when the high qubit and the low qubit are all flipped, the interchange between An and T will be realized. If we use scheme 8 to decode, it is necessary to reverse all the high and low qubits, that is, to realize the interchange between A and T and between C and G.

Hilbert Image Scrambling Quantum Circuit
The Hilbert scrambling operation of quantum image was divided into three steps: quantum image partition and Hilbert image scrambling parity operation, in which the parity operation is carried out alternately. The composition of these three basic circuits is described below. In this section, k is an integer and 0 ≤ k ≤ n − 1.

Initialization Module
The initialization quantum module is beneficial to the segmentation of the quantum image and the formation of H n , and the partition module PARTITION (K) plays a major role. The PARTITION (k) module can divide the input image of size 2 n × 2 n into 2 n−k−1 × 2 n−k−1 blocks of size 2 k+1 × 2 k+1 ; the initialization module quantum circuit is shown in Figure 7a:

Odd(k) Module
The main function of the Odd(k) module is to encrypt the pixel position information, where k is odd and 1 ≤ k ≤ n − 1. The main role is the odd module O(k) in the Odd(k) module. Figure 7b shows the complete quantum circuit of the O(k) module.

Even (k) Module
As with the function of the Odd(k) module, the function of the Even (k) module is to transform the pixel position, where k is even and 2 ≤ k ≤ n − 1. Figure 7c shows the complete Even (k) quantum circuit.

Encryption and Decryption of Quantum Images
Quantum image diffusion and scrambling are the two key components of this paper's encryption phase. At the diffusion step, the picture is made confusing by using DNA coding and various decoding techniques, and the original image is quantum XOR coded. The approach employs iterative Hilbert scrambling during the scrambling stage to encrypt the image's pixel location data.

Encryption Process
Using quantum Hilbert scrambling and DNA coding technology, we designed the following quantum image encryption method. The original input quantum image size is 2 n × 2 n and the image representation is NCQI. The encryption flow chart is shown below. Figure 8 shows the encryption process of Rule 1. Step 1: The pixel matrix of the original image is divided into three RGB channels, and the NCQI representation model is loaded as a quantum image.
Step 2: The quantum color image is encoded and decoded through the quantum image DNA codec.
In the NCQI representation, the RGB color information will be input into the circuit in binary form, so this paper used rule 1 in Table 1 to encode the binary sequence, and then decodes the sequence according to rule 6, that is, the quantum image is input to the quantum DNA codec, the D 1,6 operation is performed, and the output is |ψ 2 . |ψ 2 = D 1,6 |ψ 1 .
Step 3: Perform Hilbert quantum image scrambling with |ψ 2 iteration. |ψ 2 has 2 n × 2 n = 2 2n pixels, and if the original image pixel order is "1, 2, 3, 4, . . . , 2 2n ", the partition module PARTITION (0) will separate the picture into 2 × 2 sub-images, that is, a a + 1 a + 2 a + 3 . The last two pixels of each sub-image are switched by the C-NOT gate, which will separate the picture into 2 × 2 sub-images. Finally, the scrambled sub-image is restored to the original image size 2 n × 2 n and named |ψ 3 .
where Q 2 n represents performing Hilbert quantum image scrambling on an image of size 2 n × 2 n .
Step 4: Between the original picture and the scrambled image, use quantum XOR coding.
Generate matrix Y YX from the pixel color value of image |ψ 1 and convert each element into an octet binary, where y yx = m 0 yx m 1 yx m 2 yx . . . m 23 yx , m i yx ∈ 0, 1. According to matrix Y YX , the quantum XOR operation matrix F is generated, which is the same as Step 5: Decode the image with different rules through the quantum image DNA codec simulator. |ψ 4 is encoded and decoded by quantum DNA codec, perform the D 1,7 operation to get |ψ 5 , and the encryption is completed.

Decryption Process
The reversibility of quantum circuits serves as the foundation for the quantum image decryption technique developed in this research. As a whole, the procedure is as follows: Step 1: On the encrypted picture, peform the inverse quantum DNA coding and decoding procedure.
The quantum circuit module of the DNA encoder and the quantum DNA codec D 7,1 are both used to decrypt the encrypted picture to produce the result |ψ 4 .
Step 3: The quantum image is iterated to perform Hilbert inverse scrambling. Because the biggest difference between the quantum circuit and the classical circuit is that the quantum circuit is reversible, and there is no information loss in this process, the Hilbert image scrambling quantum circuit in this paper is reversible. We can input the scrambled image |ψ 3 and obtain the reconstructed image |ψ 2 using quantum Hilbert inverse scrambling.

Safety Analysis
We performed simulation experiments in MATLAB and Python using classical computers since there are no quantum computers available. We did not take into account the impact of decoherence and inaccuracy in the quantum version while processing numerical data. In order to examine the encrypted data in this part, three color pictures of pineapples, roses, and plants with pixel sizes of 512 × 512 were utilized as the original image. The following summarizes the encryption and decryption simulation findings. Figure 9 shows the comparison of the results before and after the application of this algorithm.

Histogram Analysis
One of the key indications needed to assess the security of encryption techniques is the histogram, which may considerably reflect the intensity distribution of picture pixels. The encrypted histograms of the three photos are shown in Figures 10-12.
In contrast to the non-uniform peak distribution of the plaintext histogram, which is seen in the image, the peak value of the histogram encrypted by this approach becomes uniform. As a result, the attacker is unable to obtain the picture data by studying the ciphertext image's histogram.

Correlation Analysis of Adjacent Pixels
A crucial metric for determining the efficacy of the encryption technique is the correlation between neighboring pixels. As there is a significant connection between neighboring pixels in the original picture, a good encryption technique should minimize this correlation to zero. In this study, we utilized this coefficient to compare the correlation between neighboring pixels both before and after the method was applied  Figures 13 and 14, and the specific data are reflected in Tables 2 and 3, where C-Image represents the ciphertext image. The suggested encryption technique clearly creates a sizable correlation gap between the ciphertext picture and the original image based on the data shown in the chart, demonstrating the algorithm's effectiveness.

Key Sensitivity Analysis
Two words that are often used to characterize the quantity of pixels and the average intensity of change between the original picture and the ciphertext image are NPCR and UACI. In accordance with the associated ideal value, the key sensitivity of the NPCR = 99.6094%, UACI = 33.4635% algorithm should be as high as possible; the more closely the numerical value resembles the ideal value, the stronger the security of the encryption technique should be. The data for this method's NPCR and UACI are shown in Table 4. Table 5 compares our work numerically to the NPCR and UACI algorithms that have been proposed in different papers. This indicates very clearly how much more efficiently the technique used in this research can guarantee picture confidentiality.  [44] 99.61% 31.60% Ref. [45] 99.57% 33.38%

Information Entropy
We often use information entropy to evaluate the unpredictability of the distribution of ciphertext pictures. The ciphertext image's pixels may be distributed evenly via a decent picture encryption method, making the image more resistant to outside attacks. The perfect information entropy is eight. The image encryption effect is better and the value is more closely aligned with the ideal value as the pixel distribution becomes more uniform. The information entropy of our recommended approach is shown in Table 6. The following table provides ample proof of the algorithm's strong security and robustness by showing that the average information entropy of RGB's three channels may reach 7.999.

Key Space
The modified picture serves as the key matrix in the encryption procedure described in this research. The color picture is 512 × 512 in size, making its key space 2 512×512×24 pixels, which is sufficient to stave against brute force assaults.

Scheme Reversibility Verification
Indicators used often to assess picture quality in the field of image processing include peak signal-to-noise ratio (PSNR) and structural similarity (SSIM).

Peak Signal-to-Noise Ratio
To evaluate the image's decryption quality, we employed PSNR. The floating-point value that PSNR returns will range from 30 to 50 if the two input photos are comparable; the higher the number, the greater the similarity. The PSNR values of plaintext pictures and encrypted images with a size of 512 to 512 are larger than 30 dB, according to simulation findings, and the average value is 43.4590. Table 7 displays the specific data. This demonstrates the algorithm's strong ability to aid in rebuilding.

Structural Similarity
The SSIM value ranges from 0 to 1. The value of SSIM increases with the degree of similarity between the two photos. The picture acquired using the image decryption approach suggested in this work was compared with the original image. Table 7 displays the specific data. The average value of SSIM determined by the simulation results is 0.980358, which shows that the technology has an excellent decryption and recovery effect.

Conclusions
Quantum image processing is committed to the use of quantum computing technology to capture, restoration, and other classical image operations. Because of its exponential storage capacity and parallelism, this technology has a strong advantage in realizing realtime operations such as image retrieval and processing. In this paper, the circuit of a quantum DNA codec was designed, and the image information was encrypted by using the biological characteristics of DNA and the physical properties of quantum mechanics. At the end of this article, the combination of DNA technology and quantum image encryption was studied and verified. According to the simulation, average NPCR = 99.6094%, average NPCR = 33.4244%, the average information entropy of RGB three channels is more than 7.999, and the average value of SSIM determined by the simulation results is 0.980358.
These results unmistakably demonstrate the viability and effectiveness of the quantum picture encryption system presented in this research, which is based on DNA codec and Hilbert scrambling.
In this encryption scheme, a quantum DNA codec was designed to enable the biological field to participate in the quantum image encryption process. It is hoped that it can play a greater role in the later research. In the follow-up work, we hope to combine quantum random walk with DNA technology to realize the integration of physics and biology again. This will be the focus of our next paper.