Quantum Image Encryption Using DNA Codec
Quantum Image Encryption Using DNA Codec
Article
Quantum Image Encryption Based on Quantum DNA Codec
and Pixel-Level Scrambling
Jie Gao 1 , Yinuo Wang 2 , Zhaoyang Song 1 and Shumei Wang 2, *
1 School of Information and Control Engineering, Qingdao University of Technology, Qingdao 266520, China
2 School of Science, Qingdao University of Technology, Qingdao 266520, China
* Correspondence: [email protected]
Abstract: 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.
Keywords: quantum information; DNA coding; quantum image encryption; quantum image scrambling
data, whereas conventional encryption typically restricts the timeliness of decryption oper-
ations. 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 quan-
tum computing and digital imaging [18–20]. There are several quantum image repre-
sentation 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 ex-
periment [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–33]. At present, DNA coding is also grad-
ually emerging in the field of encryption [34–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 com-
bined 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.
2. Related Work
2.1. 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 2n × 2n image |ψi can be mathematically expressed as follows:
2n −1 2n −1
1
|ψi = n
2 ∑ ∑ |c(y,x) i ⊗ |yx i, (1)
y =0 x =0
E
where c(y,x) represents the color value of the pixel, which can be encoded by binary
sequence Rq−1 · · · R0 Gq−1 · · · G0 Bq−1 · · · B0 .
Every pixel contained in a color channel, which has a range of [0, 2q − 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, 2q − 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, 28 − 1 , n = 1, and q = 8. The equation in Figure 1 states that
Entropy 2023, 25, 865 3 of 16
the whole NCQI is kept in a state of normalized quantum superposition, with each base
standing in for a single pixel.
1 2 3 4 5 6 7 8
00 A A C C G G T T
01 C G A T A T C G
10 G C T A T A G C
11 T T G G C C A A
· · · 2n
1 2 3
2n + 1 2n + 2 2n + 3 · · · 2n +1
Sn = (2)
.. .. .. .. ..
. . . . .
22n − 1 +1 2 2n − 1 +2 22n − 1 +3 ··· 2 .2n
1 2
The arrangement of Sn is Hn . For example, H0 = (1), H1 = , H2 =
4 3
1 2 15 16
4 3 14 13 , where Hn (i, j) represents the pixel at position (i, j) of the starting
5 8 9 12
6 7 10 11
matrix Sn . Hilbert curves (see Figure 2) and scrambled images (see Figure 3) can be
obtained along the Hn .
Entropy 2023, 25, 865 4 of 16
This paper adopted the improved Hilbert scrambling recursive generation algorithm
in [42]. If A is a matrix, then A T represents its transposition, Aud its upper and lower
direction reversed, Ald its left and right inversion, and App its centre rotation matrix. For a
quantum computer to implement Hilbert image scrambling,
!
H ( H + 4 n E )T
n n n
, n is even
( Hn + 3 × 4n En )pp ( Hn + 2 × 4n En )T
Hn+1 = , (3)
( Hn + 3 × 4n En )pp
Hn
, n is odd
( Hn + 4n En )T ( Hn + 2 × 4n En )T
··· 1
1 1
1 2
1 ··· 1
1
where n is a positive integer and the initial matrix is H1 = , En = .. .
4 3 .. ..
..
. . . .
1 1 ··· 1
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.
Entropy 2023, 25, 865 5 of 16
···
y0,1 y0,2n −1
Y= .. .. ..
, (4)
. . .
y 2n −1,0 · · · y2 −1,2 −1
n n
···
b0,1 b0,2n −1
F= .. .. ..
, (5)
. . .
b2n −1,0 · · · b2n −1,2n −1
(
0 V1 23 , i X, miyx = 1
where Fyx = Vyx yx . . . Vyx Vyx = represents the realization of the X-gate
I, miyx = 0
i , respectively:
transformation or I-gate transformation of Cyx
0 1 1 0
GX = , GI = (6)
1 0 0 1.
2n −1 2n −1
F| I i = ∏ ∏ Fyx | I i
x =0 y =0
2n −1 2n −1
1 E
=
2n ∑ ∑ ⊗23 C i
i =0 yx ⊗ m i
yx | yx i (7)
x =0 y =0
2n −1 2n −1
1
= n
2 ∑ ∑ | f (y, x )i|yx i,
x =0 y =0
where | f (Y, X )i represents the new pixel value after pixel scrambling, and |CYX i is the
pixel sequence.
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
Entropy 2023, 25, 865 7 of 16
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.
Figure 7. Initializing the quantum circuit. (a) implement the block function (b) implement the
scrambling function when k is odd (c) realize the scrambling function when k is even
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.
2n −1 2n −1
1
|ψ1 i =
2n ∑ ∑ |c(y, x )i ⊗ |yx i. (8)
y =0 x =0
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 D1,6 operation is performed, and the output is |ψ2 i.
where Q2n represents performing Hilbert quantum image scrambling on an image of size
2n × 2n .
Step 4: Between the original picture and the scrambled image, use quantum XOR coding.
Entropy 2023, 25, 865 9 of 16
Generate matrix YYX from the pixel color value of image |ψ1 i and convert each element
into an octet binary,
···
y0,0 y0,2n −1
YYX = .. .. ..
, (11)
. . .
y2n −1,0 · · · y2n −1,2n −1
Step 4: Pass |ψ2 i through quantum DNA codec D6,1 to obtain the original image |ψ1 i.
5. Safety Analysis
We performed simulation experiments in MATLAB and Python using classical com-
puters 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.
Entropy 2023, 25, 865 10 of 16
Figure 10. RGB three-channel histogram of pineapple before and after encryption.
Entropy 2023, 25, 865 11 of 16
Figure 11. RGB three-channel histogram of rose before and after encryption.
Figure 12. RGB three-channel histogram of plants before and after encryption.
cov( x, y)
r= p , (16)
D ( x ) D (y)
where A and pB representp the values of adjacent pixels, cov( A, B) is the covariance of A
and B, and D ( A) and D ( B) are the variances of A and B. In this section, the pixel
correlation between the original image and the ciphertext image was analyzed horizontally,
Entropy 2023, 25, 865 12 of 16
vertically, and diagonally. The results are shown in 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, demon-
strating the algorithm’s effectiveness.
Pineapple
(a)
Rose
(b)
Plants
(c)
Figure 13. (a) Pineapple correlation analysis; (b) Rose correlation analysis; (c) Plants correlation analysis.
Ciphertext image-
Pineapple
(a)
Ciphertext image-
Rose
(b)
Ciphertext image-
Plants
(c)
Figure 14. (a) Correlation analysis after pineapple encryption; (b) Correlation analysis after Rose
encryption; (c) Correlation analysis after plants encryption.
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.
Table 6. Information entropy data.
Ciphertext Image R G B
Pineapple 7.99925 7.99901 7.99921
Rose 7.99910 7.99930 7.99889
Plants 7.99922 7.99895 7.99912
6. 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 real-
time 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.
Entropy 2023, 25, 865 15 of 16
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 biologi-
cal 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.
Author Contributions: Conceptualization, Y.W.; Methodology, J.G. and Y.W.; Software, Z.S.; Valida-
tion, Z.S.; Formal analysis, J.G.; Data curation, Z.S.; Writing—original draft, J.G.; Writing—review
& editing, J.G.; Visualization, J.G. and Y.W.; Supervision, Y.W. and S.W.; Project administration,
S.W.; Funding acquisition, S.W. All authors have read and agreed to the published version of
the manuscript.
Funding: This work was supported by the Natural Science Foundation of Shandong Province, China
(Grant Nos. ZR2021MF049), Joint Fund of Natural Science Foundation of Shandong Province (Grant
Nos. ZR2022LLZ012), Joint Fund of Natural Science Foundation of Shandong Province (Grant Nos.
ZR2021LLZ001), Project supported by the National Natural Science Foundation of China (Grant Nos.
11975132), National Natural Science Foundation of China (Grant Nos. 12005110) and the Natural
Science Foundation of Shandong Province, China (Grant Nos. ZR2022JQ04).
Institutional Review Board Statement: Not applicable.
Informed Consent Statement: Not applicable.
Data Availability Statement: The data are contained within the article.
Conflicts of Interest: The authors declare no conflict of interest.
References
1. Wang, Z.B.; Xu, M.Z.; Zhang, Y.N. Review of Quantum Image Processing. Arch. Comput. Methods Eng. 2022, 29, 737–761.
[CrossRef]
2. Nielsen, M.A.; Chuang, I. Quantum computation and quantum information. Am. J. Phys. 2002, 70, 558–559
3. Hardy, L. Quantum mechanics, local realistic theories, and Lorentz-invariant realistic theories. Phys. Rev. Lett. 1992, 68, 2981.
[CrossRef]
4. Hardy, L. Nonlocality for two particles without inequalities for almost all entangled states. Phys. Rev. Lett. 1993, 71, 1665.
[CrossRef]
5. Shor, P.W. Algorithms for quantum computatio: Discrete logarithms and factoring. In Proceedings of the 35th Annual Symposium
on Foundations of Computer Science, Santa Fe, NM, USA, 20–22 November 1994; pp. 124–134.
6. Grover, L.K. A fast quantum mechanical algorithm for database search. In Proceedings of the Twenty Eighth Annual ACM
Symposium on Theory of Computing, Philadelphia, PA, USA, 22–24 May 1996; pp. 212–219.
7. Ashikhmin, A.; Litsyn, S.; Tsfasman, M.A. Asymptotically good quantum codes. Phys. Rev. A 2001, 63, 032311. [CrossRef]
8. Ashikhmin, A.; Knill, E. Nonbinary quantum stabilizer codes. IEEE Trans. Inf. Theory 2001, 47, 3065–3072. [CrossRef]
9. Trugenberger, C.A. Probabilistic quantum memories. Phys. Rev. Lett. 2001, 87, 067901. [CrossRef]
10. Trugenberger, C.A. Phase transitions in quantum pattern recognition. Phys. Rev. Lett. 2002, 89, 277903. [CrossRef]
11. Venegas-Andraca, S.E.; Bose, S. Storing, processing, and retrieving an image using quantum mechanics. Quantum Inf. Comput.
2003, 5105, 137–147.
12. Klappenecker, A.; Rotteler, M. Discrete cosine transforms on quantum computers. In Proceedings of the 2nd International
Symposium on Image and Signal Processing and Analysis, Pula, Croatia, 19–21 June 2001; pp. 464–468.
13. Fijany, A.; Williams, C.P. Quantum wavelet transform: Fast algorithms and complete circuits. In Quantum Computing and Quantum
Communications; Springer: Berlin/Heidelberg, Germnay, 1999; pp. 10–33.
14. Beach, G.; Lomont, C.; Cohen, C. Quantum image processing (quip). In Proceedings of the 32nd Applied Imagery Pattern
Recognition Workshop, Washington, DC, USA, 15–17 October 2003; pp. 39–44.
15. Caraiman, S.; Manta, V.I. New applications of quantum algorithms to computer graphic: The quantum random sample consensus
algorithm. In Proceedings of the 6th ACM Conference on Computing Frontiers, Ischia, Italy, 18–20 May 2009 ; pp. 81–88.
16. Caraiman, S.; Manta, V.I. Image segmentation on a quantum computer. Quantum Inf. Process. 2015, 14, 1693–1715. [CrossRef]
17. Castleman, K.R. Digital Image Processing; Prentice Hall Press: Hoboken, NJ, USA, 1996.
18. Li, H.S.; Li, C.Y.; Chen, X.; Xia, H.Y. Quantum Image Encryption Algorithm Based on NASS. Int. J. Theor. Phys. 2018, 57, 3745–3760.
[CrossRef]
Entropy 2023, 25, 865 16 of 16
19. Li, H.S.; Li, C.Y.; Chen, X.; Xia, H.Y. Quantum image encryption based on phase-shift transform and quantum Haar wavelet packet
transform. Mod. Phys. Lett. A 2019, 34, 1950214. [CrossRef]
20. Yang, Y.G.; Xia, J.; Jia, X.; Zhang, H. Novel image encryption/decryption based on quantum Fourier transform and double phase
encoding. Quantum Inf. Process. 2013, 12, 3477–3493. [CrossRef]
21. Yan, F.; Iliyasu, A.M.; Venegas-Andraca, S.E. A survey of quantum image representations. Quantum Inf. Process. 2016, 15, 1–35.
[CrossRef]
22. Le, P.Q.; Dong, F.; Hirota, K. A flexible representation of quantum images for polynomial preparation, image compression, and
processing operations. Quantum Inf. Process. 2011, 10, 63–84. [CrossRef]
23. Zhang, Y.; Lu, K.; Gao, Y.H.; Wang, M. NEQ: A novel enhanced quantum representation of digital images. Quantum Inf. Process.
2013, 12, 2833–2860. [CrossRef]
24. Sun, B.; Iliyasu, A.; Yan, F.; Dong, F.Y.; Hirota, K. An RGB multi-channel representation for images on quantum computers. J. Adv.
Comput. Intell. Intell. Inform. 2013, 17, 404–415. [CrossRef]
25. Li, H.S.; Zhu, Q.X.; Zhou, R.G.; Lan, S.; Yang, X.J. Multi-dimensional color image storage and retrieval for a normal arbitrary
quantum superposition state. Quantum Inf. Process. 2014, 13, 991–1011. [CrossRef]
26. Li, H.S.; Zhu, Q.X.; Lan, S.; Shen, C.Y.; Zhou, R.G.; Mo, J. Image storage, retrieval, compression and segmentation in a quantum
system. Quantum Inf. Process. 2013, 12, 2269–2290. [CrossRef]
27. Zhang, Y.; Lu, K.; Gao, Y.H.; Xu, K. A novel quantum representation for log-polar images. Quantum Inf. Process. 2013, 12, 3103–3126.
[CrossRef]
28. Zhang, J.L.; Huang, Z.J.; Li, X.; Wu, M.Q.; Wang, X.Y.; Dong, Y.M. Quantum Image Encryption Based on Quantum Image
Decomposition. Int. J. Theor. Phys. 2021, 60, 2930–2942. [CrossRef]
29. Zhou, N.R.; Hu, Y.Q.; Gong, L.H.; Li, G.Y. Quantum image encryption scheme with iterative generalized Arnold transforms and
quantum image cycle shift operations. Quantum Inf. Process. 2017, 16, 164. [CrossRef]
30. Adleman, L.M. Molecular computation of solutions to combinatorial problems. Science 1994, 266, 1021–1024. [CrossRef]
31. Leier, A.; Richter, C.; Banzhaf, W.; Rauhe, H. Cryptography with DNA binary strands. Biosystems 2000, 57, 13–22. [CrossRef]
32. Chang, W.L.; Guo, M.Y.; Ho, M.S.H. Fast parallel molecular algorithms for DNA-based computatio. factoring integers. IEEE Trans.
Nanobiosci. 2005, 4, 149–163. [CrossRef]
33. Basu, S.; Karuppiah, M.; Nasipuri, M.; Halder, A.K.; Radhakrishnan, N. Bio-inspired cryptosystem with DNA cryptography and
neural networks. J. Syst. Archit. 2019, 94, 24–31. [CrossRef]
34. Alghafis, A.; Firdousi, F.; Khan, M.; Batool, S.I.; Amin, M. An efficient image encryption scheme based on chaotic and Deoxyri-
bonucleic acid sequencing. Math. Comput. Simul. 2020, 177, 441–466. [CrossRef]
35. Liu, Y.; Zhang, J.D. A Multidimensional Chaotic Image Encryption Algorithm based on DNA Coding. Multimed. Tools Appl. 2020,
79, 21579–21601. [CrossRef]
36. Wang, X.Y.; Zhang, Y.Q.; Bao, X.M. A novel chaotic image encryption scheme using DNA sequence operations. Opt. Lasers Eng.
2015, 73, 53–61. [CrossRef]
37. Zhang, X.Q.; Wang, X.S. Multiple-image encryption algorithm based on DNA encoding and chaotic system. Multimed. Tools Appl.
2019, 78, 7841–7869. [CrossRef]
38. Wang, Y.N.; Song, Z.Y.; Ma, H.Y. Color image encryption algorithm based on DNA code and alternating quantum random walk.
Acta Phys. Sin. 2021, I, 230302. [CrossRef]
39. Sang, J.Z.; Wang, S.; Li, Q. A novel quantum representation of color digital images. Quantum Inf. Process. 2017, 16, 42. [CrossRef]
40. Arnold, V.I.; Avez, A. Ergodic Problems of Classical Mechanics; Benjamin: Amsterdam, The Netherlands, 1968; Volume 9.
41. Wang, S.; Xu, X.S. A new algorithm of Hilbert scanning matrix and its MATLAB program. J. Image Graph. 2006, 11, 119–122.
42. Jiang, N.; Wang, L.; Wu, W.Y. Quantum Hilbert Image Scrambling. Int. J. Theor. Phys. 2014, 53, 2463–2484. [CrossRef]
43. Gong, L.H.; He, X.T.; Zhou, N.R. Quantum Image Encryption Algorithm Based on Quantum Image XOR Operations. Int. J. Theor.
Phys. 2016, 55, 3234–3250. [CrossRef]
44. Vagish, K.D.; Rajakumaran, C.; Kavitha, R. Chaos based encryption of quantum images. Multimed. Tools Appl. 2020, 79,
23849–23860.
45. Li, C.; Yang, X.Z. An image encryption algorithm based on discrete fractional wavelet transform and quantum chaos. Optik 2022,
260, 169042. [CrossRef]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual
author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to
people or property resulting from any ideas, methods, instructions or products referred to in the content.