1 Introduction

In recent years, information security has received more and more concerns, and a variety of digital image encryption methods have been widely applied in secure validation systems [1, 2]. Chaotic cryptosystems commonly have super-speed with low costs, which makes them to be better candidates than many other classical encryption algorithms for multimedia data [3]. In 1989, Matthews firstly presented the chaos-based encryption algorithm [4], and Fridrich firstly introduced chaotic systems into image encryption in 1998 by designing substitution and diffusion in the spatial domain [5]. The interrelated correlation between cryptography and chaos was investigated [6]. Patidar et al. proposed a color image encryption algorithm based on substitution-diffusion framework by adopting chaotic standards and logistic maps [7]. In particular, logistic map was universally used in the field of image encryption [8], though it is not secure enough to use one-dimensional chaotic map merely due to the small key space [9]. Subsequently, a hyper-chaotic system with unfixed parameters for image encryption was investigated [10]. Because of the unique characteristics of the chaotic system, such as high sensitivity, topological transitivity, non-periodicity and pseudo-randomness, the image encryption mechanisms based on hyper-chaotic system have been discussed frequently and a battery of chaos-based image encryption schemes have been proposed [1113].

With the rapid development of network technology, internet-based multimedia communication is of increasing importance. In accordance with random classical computations, M data needs M steps of loading operations for a single processor [14], which reduces the computational efficiency and results in the bottleneck of classical computers. Nowadays, quantum computation is becoming a potentially important and effective tool to meet the high real-time computational requirements [15, 16]. Based on the principles of quantum physics, Feynman presented a computation model named quantum computers, which seems more powerful than classical ones [17]. Shor’s polynomial time scheme for factoring integers and Grover’s database searching algorithm have indicated the power of future quantum computers [18]. Additionally, quantum image processing extending classical image processing applications into a quantum computer is a novel and infusive subject among quantum computation. The image color and position could be encoded into one quantum state by a flexible representation of quantum image (FRQI) [19], which keeps the classical properties of color and position. The real ket model was performed on image quartering iteratively and a balanced quad-tree index was built [20], where each pixel was mapped into a basis state of a four-dimensional qubit sequence. The qubit lattice model [21, 22] allows people to store information without preprocessing with three primary colors, i.e., Red, Green and Blue. Some classical frequency domain transformations have been extended into their quantum versions, for example, quantum Fourier transform (QFT) [16]. Undoubtedly, QFT would play a vital role in quantum computation [2325]. However, there is another kind of transforms, which are shown to be a powerful tool in developing quantum algorithms [26, 27]. Due to the quantum chaotic systems could be characterized by the sensitive dependence on initial values, a new color image encryption algorithm based on quantum chaotic system was presented [28]. In 2014, Yang et al. proposed a quantum cryptographic algorithm for color images by combining quantum Fourier transform with double random-phase encoding [29].

However, some of the presented chaos-based image encryption schemes suffer security threats [30, 31], such as the way of generating the key stream, relatively small key space, the required round of encryption times (the trade off between security and the overall performance), and etc. Quantum networks, emerging as a branch of quantum physics to understand the features of quantum information, have some advantages in breaking the classical computing limits [32]. In particular, quantum image encryption technology has unique characteristics, such as large capacity, high processing speed, high robustness, natural parallelism and high security. The security of the most classical cryptosystems is founded on the supposition of computational complexity and might be susceptible to the strong ability of quantum computation [33]. In this paper, through the combination of hyper chaotic systems and quantum image encryption technology, it can be seen from the simulation that the advantages of quantum image encryption is apparently in overcoming the shortcomings of chaos due to the enlarged key space, the accelerated processing speed, the improved security. Therefore, more and more security algorithms, including quantum image encryption algorithms, were devised based on quantum information and quantum computation [16].

The rest of this paper is arranged as follows. In Section 2, quantum representation for color images and the Chen’s hyper-chaotic system are related. A color image encryption scheme is designed in Section 3 while the security analyses are given in Section 4. Finally, a brief conclusion is drawn in Section 5.

2 Quantum Image Representation and Hyper-Chaotic System

2.1 Quantum Representation for Color Image

Generally, a color image contains information with three colorants of red (R), green (G) and blue (B), which are described by different grayscales. Visually, the color images are matched with the approximate spectrum quantitative properties of human eyes. The quantum representation for color image can be defined as [29]:

$$ \begin{array}{l} \left|I(\theta_{\lambda}) \right\rangle =\frac{1}{2^{n}}\sum\limits_{m=0}^{2^{2n}-1} \left|c_{m} \right\rangle \otimes\left|m\right\rangle\\ \left|c_{m}\right\rangle = \left|r_{m}\right\rangle\left|g_{m}\right\rangle\left|b_{m}\right\rangle \end{array} $$
(1)

where \(\left |r_{m} \right \rangle = \text {cos}\,\theta _{1m}\left |0\right \rangle + \sin \theta _{1m}\left |1\right \rangle , \left |g_{m}\right \rangle =\text {cos}\,\theta _{2m} \left |0\right \rangle + \sin \,\theta _{2m}\left |1\right \rangle ,\left |b_{m}\right \rangle = \text {cos}\,\theta _{3m}\left |0\right \rangle + \sin \,\theta _{3m}\left |1\right \rangle ,\) \(\theta _{\lambda }\in \left [{0,\frac {\pi }{2}}\right ]\), λ=1, 2, 3 and m=0,1,…,22n−1. n is the number of quantum bits required to encode. Quantum states \(\left |0 \right \rangle \) and \(\left |1\right \rangle \) are the 2D computational basis quantum states, 𝜃 λ is the primary phase encoding information of red, green or blue vectors, \(\left |c_{m} \right \rangle \) and \(\left |m \right \rangle \) encode color information and the corresponding position of the pixel, respectively. The preparation of quantum color image is shown in Fig. 1.

Fig. 1
figure 1

Preparation of quantum color image

The three components of the color image are equivalent to three separate gray images, respectively. For a gray image, the position qubit \(\left |m \right \rangle =\left |yx \right \rangle =\left |y \right \rangle \left |x \right \rangle =\left |y_{n-1}y_{n-2}\mathellipsis y_{0} \right \rangle \left |x_{n-1}x_{n-2} \mathellipsis x_{0}\right \rangle \) encodes the corresponding position information of the quantum images, where \(\left |y_{n-1}y_{n-2}\mathellipsis y_{0}\right \rangle \) encodes the information of the first n-qubit along the vertical location while \(\left |x_{n-1}x_{n-2} \mathellipsis x_{0}\right \rangle \) encodes the information of the rest n-qubit along the horizontal location.

2.2 Hyper-Chaotic System

In 1999, the Chen’s system was put forward in a three-dimensional way.

$$ \left\{{{\begin{array}{l} {\bar{{x}}=a\left( {y-x} \right)} \\ {\bar{{y}}=cx-ax-xz-cy} \\ {\bar{{z}}=xy-bz} \\ \end{array} }} \right. $$
(2)

If the control parameters a, b, c in (2) are taken 35, 3, 28, respectively, the system would be chaotic. The Chen’s chaotic system could be used to generate the hyper-chaotic system state [34].

$$ \left\{{{\begin{array}{l} {\bar{X}=d\left( {y-x} \right)} \\ {\bar{Y}=ex+hy-xz+w} \\ {\bar{Z}=y^{2}-lz} \\ {\bar{W}=-qx} \\ \end{array}}}\right. $$
(3)

where d, e, h, l and q are the parameters of the system. While they take 27.5, 3, 19.3, 2.9, 3.3, respectively, the system would be in a hyper-chaotic state under the conditions of any given chaotic system state with a set of initial values \(\bar {{X}}_{0} \), \(\bar {{Y}}_{0} \), \(\bar {{Z}}_{0} \), \(\bar {{W}}_{0} \). The hyper-chaotic system is more effective and more appropriate for image encryption than the chaotic system [13]. With parameters d=27.5, e=3, h=19.3, l=2.9, q=3.3, and the hyper-chaos attractors shown in Fig. 2, the Lyapunov exponents of the hyper-chaos system are 1.6170, 0.1123, 0, −12.8425. Apparently, the hyper-chaos system has two positive Lyapunov exponents, thus the prediction time of a hyper-chaotic system is shorter than that of a chaotic system [35] and the hyper-chaotic system is better than chaos system for security algorithm.

Fig. 2
figure 2

Hyper-chaos attractors of Chen’s hyper-chaotic system with q=3.3

3 Quantum Color Image Encryption and Decryption Algorithm

3.1 Quantum Color Image Encryption Based on the Hyper-Chaotic System

Assume the quantum original image is \(\left |I(\theta _{\lambda })\right \rangle = \frac {1}{2^{n}}\sum \limits _{m=0}^{2^{2n}-1}\left |c_{m}\right \rangle \otimes \left |m\right \rangle \), where \(\left |c_{m}\right \rangle =\left |r_{m}\right \rangle \left |g_{m}\right \rangle \left |b_{m}\right \rangle \), m=0,1,…,22n−1, \(\left |r_{m} \right \rangle =\text {cos}\,\theta _{1m}\left |0\right \rangle +\sin \,\theta _{1m}\left |1\right \rangle \), \(\left |g_{m} \right \rangle =\text {cos}\,\theta _{2m}\left |0\right \rangle +\sin \,\theta _{2m}\left |1\right \rangle \), \(\left |b_{m}\right \rangle =\text {cos}\,\theta _{3m}\left |0\right \rangle +\sin \,\theta _{3m}\left |1\right \rangle \), \(\theta _{\lambda } \in \left [ {0,\frac {\pi }{2}} \right ]\), λ=1, 2, 3. The three color components of the original image have 2n×2n pixels, respectively. Thus, 22n iterations are involved to produce 22n numbers for XOR operations. The whole process of the proposed encryption algorithm is as follows.

ᅟ:

Step. 1 By choosing the initial parameters \(\bar {{X}}_{0} \), \(\bar {{Y}}_{0} \), \(\bar {{Z}}_{0} \) and \(\bar {{W}}_{0} \), four sequences \(\bar {{X}}_{m} \), \(\bar {{Y}}_{m} \), \(\bar {{Z}}_{m} \) and \(\bar {{W}}_{m} \) are generated by the fourth order Runge Kutta algorithm with 22n iterations.

ᅟ:

Step 2 \(\bar {{X}}_{m} \), \(\bar {{Y}}_{m} \), \(\bar {{Z}}_{m} \) and \(\bar {{W}}_{m} \) are discretized with (4), then the four corresponding integer sequences T m (T takes X, Y, Z and W, respectively.) could be obtained.

$$ T_{m} =\left| {f {(\overline {T_{m} } -f(\overline {T_{m} } ))} } \right|\times 10^{15}\bmod 256 $$
(4)

where \(f\left (x \right )\) rounds x to the nearest integer less than or equal to x and mod returns the remainder after division.

ᅟ:

Step. 3 Start from the first pixel of the plaintext, each pixel is decomposed into three gray components, and each cipher-text a r m , a g m or a b m could be obtained with XOR operation ⊕.

$$ \left\{ {{\begin{array}{*{20}c} {a_{rm} =r_{m} \oplus \left( {X_{m} \bmod 256} \right)} \\ {a_{gm} =g_{m} \oplus \left( {2Y_{m} \bmod 256} \right)} \\ {a_{bm} =b_{m} \oplus \left( {3Z_{m} \bmod 256} \right)} \\ \end{array} }} \right. $$
(5)
ᅟ:

Step. 4 Based on the integer sequences X m ,Y m ,Z m and W m of the hyper-chaotic system, three of them are formed as a combination Q L .

$$ L=\text{mod}\left( {X_{m} \text{,4}} \right), \quad m=0,1,\mathellipsis ,2^{2n}-1. $$
(6)

where X m is the integer sequence of the hyper-chaotic system. In order to scramble the pixel values better and enhance the sensitivity of the keys, from Table 1, the corresponding state variable combination Q L is used to perform XOR operation with each cipher-text a r m , a g m or a b m .

$$ \left\{ {{\begin{array}{l} {A_{rm} =a_{rm} \oplus Q_{L} } \\ {A_{gm} =a_{gm} \oplus Q_{L} } \\ {A_{bm} =a_{bm} \oplus Q_{L} } \\ \end{array} }} \right. $$
(7)
Step 5 :

Image data matrices \(\left |P \right \rangle \) are achieved by compounding A r m , A g m and A b m from (7).

$$ \left|P \right\rangle =\frac{1}{2^{n}}\sum\limits_{m=0}^{2^{2n}-1} {\left|A_{rm} \right\rangle\left|A_{gm}\right\rangle\left|A_{bm}\right\rangle\left|m\right\rangle} $$
(8)

where \(\left |A_{rm} \right \rangle =\text {cos}\,\theta _{1m}^{\prime }\left |0\right \rangle +\sin \,\theta _{1m}^{\prime }\left |1\right \rangle \), \(\left |A_{gm}\right \rangle = \text {cos}\,\theta _{2m}^{\prime }\left |0\right \rangle +\sin \,\theta _{2m}^{\prime }\left |1\right \rangle \), \(\left |A_{bm}\right \rangle = \text {cos}\,\theta _{3m}^{\prime }\left |0\right \rangle + \sin \,\theta _{3m}^{\prime }\left |1\right \rangle \), m=0,1,…,22n−1.

ᅟ:

Step. 6 Set quantum rotation gate \(R\left ({\xi _{m} ,\psi _{m} ,\zeta _{m} } \right )=T_{X} \left ({\xi _{m} } \right )\otimes T_{Y} \left ({\psi _{m} } \right )\otimes T_{Z} \left ({\zeta _{m} } \right )\), where ξ m , ψ m and ζ m represent the rotation angles around x, y, z axes, respectively.

$$ T_{X} (\xi_{m} )=\left( {{\begin{array}{ccc} 1 & 0 & 0 \\ 0 & {\cos \xi_{m} } & {-\sin \xi_{m} } \\ 0 & {\sin \xi_{m} } & {\cos \xi_{m} } \\ \end{array} }} \right) $$
(9a)
$$ T_{Y} \left( {\psi_{m} } \right)=\left( {{\begin{array}{ccc} {\cos \psi_{m} } & 0 & {\sin \psi_{m} } \\ 0 & 1 & 0 \\ {-\sin \psi_{m} } & 0 & {\cos \psi_{m} } \\ \end{array} }} \right) $$
(9b)
$$ T_{Z} (\zeta_{m} )=\left( {{\begin{array}{ccc} {\cos \zeta_{m} } & {-\sin \zeta_{m} } & 0 \\ {\sin \zeta_{m} } & {\cos \zeta_{m} } & 0 \\ 0 & 0 & 1 \\ \end{array} }} \right) $$
(9c)

\(R\left ({\xi _{m} ,\psi _{m} ,\zeta _{m} } \right )\) is applied to rotate the corresponding A r m , A g m and A b m in the spatial domain.

$$ \left[ {{\begin{array}{c} {A_{r^{\prime}m} } \\ {A_{g^{\prime}m} } \\ {A_{b^{\prime}m} } \\ \end{array} }} \right]=R\left( {\xi_{m} ,\psi_{m} ,\zeta_{m} } \right)\left[ {{\begin{array}{c} {A_{rm} } \\ {A_{gm} } \\ {A_{bm} } \\ \end{array} }} \right] $$
(10)

\(\left |P_{1}\right \rangle =\frac {1}{2^{n}}\sum \limits _{m=0}^{2^{2n}-1}\left |A_{r^{\prime }m}\right \rangle \left |A_{g^{\prime }m}\right \rangle \left |A_{b^{\prime }m}\right \rangle \otimes \left |m\right \rangle \) could be obtained from (10), and \(\left |A_{r^{\prime }m}\right \rangle =\text {cos}\,(\theta _{1m}^{\prime }+\xi _{m})\left |0\right \rangle +\sin \,(\theta _{1m}^{\prime }+\xi _{m})\left |1\right \rangle \), \(\left |A_{g^{\prime }m} \right \rangle =\text {cos}\,(\theta _{2m}^{\prime }+\psi _{m})\left |0\right \rangle +\sin \,(\theta _{2m}^{\prime }+\psi _{m})\left |1\right \rangle \), \(\left |A_{b^{\prime }m} \right \rangle =\text {cos}\,(\theta _{3m}^{\prime }+\zeta _{m})\left |0\right \rangle +\sin \,(\theta _{3m}^{\prime }+\zeta _{m})\left |1\right \rangle \).

Table 1 Combination rule of the hyper-chaotic sequences

3.2 Quantum Fourier Transform

The quantum Fourier transform was concluded from the traditional discrete Fourier transform [16](Fig. 3).

$$ \text{QFT}:\text{}U_{\text{QFT}} \left|t \right\rangle =\frac{1}{\sqrt N }\sum\limits_{k=0}^{N-1} {e^{2\pi \mathrm{i}kt/N}} \left|k \right\rangle $$
(11)

where U QFT is defined to be a linear operator with the following action on the orthonormal basis states \(\left |0 \right \rangle ,\mathellipsis ,\left |N-1 \right \rangle \), QFT is a 2n unitary transformation for a single state into superposition, k and t represent two integers ranging from 0 to N−1. So far, the QFT has been demonstrated experimentally by using the quantum Hadamard gates and the conditional phase gates [16, 36].

Fig. 3
figure 3

Circuit for quantum Fourier transform

A controlled phase rotation gate \(\rho _{w}^{\prime } \)(CROT) [37] used in the QFT is defined as

$$ \rho_{w}^{\prime} \left|H \right\rangle_{u} \left|J \right\rangle_{v} =\left\{ {{\begin{array}{*{20}c} {\left|H \right\rangle_{u} e^{\mathrm{j}\rho_{w} }\left|J \right\rangle_{v} ,\text{\thinspace }\left|H \right\rangle_{u} =\left|1 \right\rangle =\left|J \right\rangle_{v} ;} \\ {\left|H \right\rangle_{u} \left|J \right\rangle_{v} \text{,\thinspace \thinspace \thinspace \thinspace \thinspace \thinspace \thinspace \thinspace \thinspace \thinspace \thinspace else}.\text{\thinspace \thinspace \thinspace \thinspace \thinspace \thinspace \thinspace \thinspace }} \\ \end{array} }} \right. $$
(12)

where qubit number u acts as the control qubit \(\left |H \right \rangle _{u} \in \left \{ {\left |0 \right \rangle ,\left |1 \right \rangle } \right \}\), and qubit number v acts as the target qubit \(\left |J \right \rangle _{v} \in \left \{ {\left |0 \right \rangle ,\left |1 \right \rangle } \right \}\), \(w=\left | {f\left \lfloor {u-v} \right \rfloor } \right |\) is the integer distance between qubit numbers u and v, where \(f\left \lfloor x \right \rfloor \) rounds x to the nearest integer less than or equal to x, integer distance represents integer absolute value of \(f\left \lfloor {u-v} \right \rfloor \). Moreover, in the case of the exact QFT,

$$ \rho_{w} =\frac{\pi }{2^{w}} $$
(13)

Equation 13 defines an exponential hierarchical structure of phase rotation angles, the base of the exponential in (13) relates directly to the base-2 arithmetic used in transcribing the abstract QFT unitary transformation into a realization with qubits of two possible states. Due to the number-theoretical relationships, the qubit-based QFT will be executed perfectly in this way, while the desired reinforcements (quantum interference) and amplitude cancellations will be precisely taken place [37].

Assume R channel \(\left |I(\theta )\right \rangle \) is extracted from the color image \(\left |I(\theta _{\lambda }) \right \rangle \) to generate a representation of image in quantum states, it could be defined as [38],

$$ \left|I(\theta)\right\rangle = \frac{1}{2^{n}}\sum\limits_{m=0}^{2^{2n}-1}h_{m}\otimes\left|m\right\rangle $$
(14)
$$ h_{m} \text{=}\frac{1}{2^{n}}\sum\limits_{m=0}^{2^{2n}-1} {\left( {\left|0 \right\rangle \text{+}e^{\mathrm{j}\theta_{m} }\left|1 \right\rangle } \right)\left|m \right\rangle } $$
(15)

where, m=0,1,…,22n−1, there is a 2n+1 qubits unitary transform E κ that turns the color angle 𝜃 m corresponding to the position \(\left |m \right \rangle \) of the quantum image \(\left |I(\theta ) \right \rangle \) into a color angle σ m . Given the angles 𝜃 m and σ m , there exists angle ϕ m = σ m 𝜃 m ; thus, we can construct a 2n+1 qubits-based unitary transform E κ as:

$$ E_{\kappa } =\left( {I_{0} \otimes \sum\limits_{m=0,m\ne \kappa }^{2^{2n}-1} {\left|m \right\rangle } \left\langle m \right|} \right)+F_{\kappa } \otimes \left|\kappa \right\rangle \left\langle \kappa \right| $$
(16)
$$ F_{\kappa } =\left( {{\begin{array}{cc} 1 & 0 \\ 0 & {\phi_{\kappa }^{\prime} \left|H \right\rangle_{u} \left|J \right\rangle_{v} } \\ \end{array} }} \right) $$
(17)

F κ is a phase gate, the controlled phase matrix E κ is a unitary matrix, \(E_{\kappa } E_{\kappa }^{\ast } =I_{0}^{\otimes 2n+1} \), where \(E_{\kappa }^{\ast } \) is the Hermitian conjugate of E κ , I 0 is a two-dimensional identity matrix, \(\phi _{\kappa }^{\prime } \left |H \right \rangle _{u} \left |J \right \rangle _{v} \) matches the corresponding values in (12). Sequences of controlled phase matrices in (16) are designed to change every angle encoding color without destroying that of the other positions. Thus, the angles encoding colors \(\theta _{m} =\left ({\theta _{1} ,\theta _{2} ,\mathellipsis ,\theta _{2^{2n}-1} } \right )\) can be transformed.

$$ {\begin{array}{l} E_{\eta } E_{\kappa} \left|I(\theta) \right\rangle\\=\text{\thinspace \thinspace \thinspace \thinspace \thinspace }\frac{1}{2^{n}}\left[ \sum\limits_{m=0,m\ne\kappa,\eta}^{2^{2n}-1}\left( \left|0 \right\rangle \text{+}e^{\mathrm{j}\theta_{m} }\left|1 \right\rangle \right)\left|m \right\rangle \text{+}\left( \left|0 \right\rangle \text{+}e^{\mathrm{j}\left( {\theta_{\kappa } \text{+}\phi_{\kappa}} \right)}\left|1 \right\rangle \right)\left|\kappa \right\rangle \text{+}\left( \left|0 \right\rangle \text{+}e^{\mathrm{j}\left( {\theta_{\eta } \text{+}\phi_{\eta } } \right)}\left|1 \right\rangle \right)\left|\eta \right\rangle \right]\\ =\frac{1}{2^{n}}\left[\sum\limits_{m=0,m\ne \kappa ,\eta}^{2^{2n}-1}\left( \left|0 \right\rangle \text{+}e^{\mathrm{j}\theta_{m} }\left|1 \right\rangle \right)\left|m \right\rangle \text{+}\left( \left|0 \right\rangle \text{+}e^{\mathrm{j}\sigma_{\kappa } }\left|1 \right\rangle \right)\left|\kappa \right\rangle \text{+}\left( \left|0 \right\rangle \text{+}e^{\mathrm{j}\sigma_{\eta}}\left|1 \right\rangle \right)\left|\eta \right\rangle \right]\\ \end{array}} $$
(18)

From (18), it is clear that

$$ {\begin{array}{ll} E\left|I(\theta)\right\rangle&=\prod\limits_{j=0}^{2^{2n}-1}E_{j} \left|I(\theta) \right\rangle\\ &=\frac{1}{2^{n}}\sum\limits_{m=0}^{2^{2n}-1}(\left|0\right\rangle+e^{\mathrm{j}(\theta_{m}+\phi_{m})}\left|1\right\rangle)\left|m\right\rangle\\ &=\frac{1}{2^{n}}\sum\limits_{m=0}^{2^{2n}-1}(\left|0\right\rangle+e^{\mathrm{j}\sigma_{m}}\left|1\right\rangle)\left|m\right\rangle \end{array}} $$
(19)

Likewise, the similar operations \(E^{\prime }\) and \(E^{\prime \prime }\) could implement on the G and B channels also.

$$ E^{\prime}\left|I(\theta^{\prime})\right\rangle=\frac{1}{2^{n}}\sum\limits_{m=0}^{2^{2n}-1} (\left|0\right\rangle+e^{\mathrm{j}\sigma^{\prime}_{m}}\left|1\right\rangle)\left|m\right\rangle $$
(20)
$$ E^{\prime\prime}\left|I(\theta^{\prime\prime})\right\rangle=\frac{1}{2^{n}}\sum\limits_{m=0}^{2^{2n}-1} (\left|0\right\rangle+e^{\mathrm{j}\sigma^{\prime\prime}_{m}}\left|1\right\rangle)\left|m\right\rangle $$
(21)
Step 7::

The new image \(\left |P_{2}\right \rangle \) is obtained by implementing quantum Fourier transform, and then quantum random phase operation in the Fourier transform domain is performed [39].

$$ {\begin{array}{l} \left|P_{2}\right\rangle=\text{QFT}\left|P_{1}\right\rangle\\ =\text{QFT}\left( \frac{1}{2^{n}}\sum\limits_{m=0}^{2^{2n}-1}\left|A_{r^{\prime}m}\right\rangle\left|A_{g^{\prime}m}\right\rangle\left|A_{b^{\prime}m}\right\rangle\left|m\right\rangle\right)\\ \end{array}} $$
(22)
$$\begin{array}{@{}rcl@{}} \left|P_{3}\right\rangle &=& (E^{\prime\prime}\otimes E^{\prime}\otimes E)\left|P_{2}\right\rangle\\ &=&(E^{\prime\prime}\otimes E^{\prime}\otimes E)\left( \text{QFT}\left( \frac{1}{2^{n}}\sum\limits_{m=0}^{2^{2n}-1}\left|A_{r^{\prime}m}\right\rangle \left|A_{g^{\prime}m}\right.\rangle\left|A_{b^{\prime}m}\right\rangle\left|m\right.\rangle\right)\right) \end{array} $$
(23)
Step 8::

Execute the inverse quantum Fourier transform on \(\left |P_{3}\right \rangle \) to obtain the final encrypted image \(\left |P_{4}\right \rangle \).

$$\begin{array}{@{}rcl@{}} \left|P_{4}\right\rangle &\,=\,& \text{IQFT}(\left|P_{3}\right\rangle)\\ &\,=\,& \text{IQFT}\left( \!(E^{\prime\prime}\otimes E^{\prime}\otimes E)\left( \!\text{QFT}\left( \!\frac{1}{2^{n}}\sum\limits_{m=0}^{2^{2n}-1}\left|A_{r^{\prime}m}\right\rangle\left|A_{g^{\prime}m}\right.\rangle \left|A_{b^{\prime}m}\right\rangle\left|m\right\rangle\right)\right)\right) \end{array} $$
(24)

3.3 Quantum Color Image Decryption Process

The encryption process is completely reversible, so the decryption process is similar to the encryption process.

Step1::

Perform quantum Fourier transform on \(\left |P_{4}\right \rangle \).

$$ \text{QFT}\left( {\left|P_{4}\right\rangle}\right)=\text{QFT}(\text{IQFT}(\left|P_{3}\right\rangle))=\left|P_{3}\right\rangle $$
(25)
Step 2::

\(\left |P_{2} \right \rangle \) is obtained by applying calculation of random phase conjugate on \(\left |P_{3}\right \rangle \),

$$\begin{array}{@{}rcl@{}} &&(E^{\prime\prime}\otimes E^{\prime}\otimes E)^{*}\left|P_{3}\right\rangle\\ &&=(E^{\prime\prime}\otimes E^{\prime}\otimes E)^{*}((E^{\prime\prime}\otimes E^{\prime}\otimes E)\left|P_{2}\right\rangle) \end{array} $$
(26)
$$\begin{array}{@{}rcl@{}} &&= ((E^{\prime\prime})^{*}\otimes(E^{\prime})^{*}\otimes E^{*})((E^{\prime\prime}\otimes E^{\prime}\otimes E)\left|P_{2}\right\rangle)=\left|P_{2}\right\rangle \end{array} $$

then the inverse quantum Fourier transform is performed.

$$ \text{IQFT}\left|P_{2}\right\rangle = \text{IQFT}(\text{QFT}\left|P_{1}\right\rangle)=\left|P_{1}\right\rangle $$
(27)
Step 3: :

Execute the decrypted operation on \(\left |P_{1} \right \rangle \) with the key \(R^{-1}\left ({\xi ,\psi ,\zeta } \right )\).

$$\begin{array}{@{}rcl@{}} &&R^{-1}\left( \xi ,\psi ,\zeta \right)\left|P_{1}\right\rangle=(T_{X}(\xi)\otimes T_{Y}(\psi)\otimes T_{Z}(\zeta))^{-1}\left|P_{1}\right\rangle\\ &&=T_{X}^{-1}(\xi)\otimes T_{Y}^{-1}(\psi)\otimes T_{z}^{-1}(\zeta)\left( \frac{1}{2^{n}}\sum\limits_{m=0}^{2^{2n}-1}\left|A_{r^{\prime}m}\right\rangle \left|A_{g^{\prime}m}\right.\rangle\left|A_{b^{\prime}m}\right\rangle\left|m\right\rangle\right)\\ &&=T_{X}^{-1}(\xi)\otimes T_{Y}^{-1}(\psi)\otimes T_{Z}^{-1}(\zeta)\left( T_{X}(\xi)\otimes T_{Y}(\psi)\otimes T_{Z}(\zeta)\left( \frac{1}{2^{n}}\sum\limits_{m=0}^{2^{2n}-1}\left|A_{rm}\right\rangle\left|A_{gm}\right.\rangle\left|A_{bm}\right\rangle\left|m\right\rangle\right)\right)\\ &&=\frac{1}{2^{n}}\sum\limits_{m=0}^{2^{2n}-1}\left|A_{rm}\right\rangle\left|A_{gm}\right.\rangle\left|A_{bm}\right\rangle\left|m\right\rangle \end{array} $$
(28)
Step 4: :

The keys involved in the whole encryption process are the initial parameters \(\bar {{X}}_{0} \), \(\bar {{Y}}_{0} \), \(\bar {{Z}}_{0} \) and \(\bar {{W}}_{0} \). The solutions are based on \(\bar {{X}}_{0} \), \(\bar {{Y}}_{0} \), \(\bar {{Z}}_{0} \) and \(\bar {{W}}_{0} \), and it could be successful to restore the original image in turn.

4 Security Analysis

4.1 Theoretical Analyses and Experimental Simulation

Traditional encryption technology is widely used in real life, which can protect the classic data from unauthorized modification and interception, but once the classic data suffer the brute-force attacks, there is no irreversible change. Infer from the quantum Uncertainty principle and No-cloning theorem, if an illegal attacker wants to obtain information from the unknown quantum state, the quantum state must be first measured, it would lead to the quantum state collapsing randomly into an eigenstate of the measurement operators irreversibly [40], moreover, unknown quantum state couldn’t be reproduced.

Since a practical and useful quantum computer is still unavailable, the experiments are limited to classical simulations on a classical computer with MATLAB. The 200 ×200 color image “Lena” is chosen as the original image, which is shown in Fig. 4a. \(\bar {{X}}_{0} \text {=}0.146\), \(\bar {{Y}}_{0} \text {=}-0.329\), \(\bar {{W}}_{0} \text {=}1.000\) are set as the initial parameters of the hyper-chaotic system. The encrypted image is given in Fig. 4b. The encrypted image does not show any information of the original image visually.

Fig. 4
figure 4

Results of test images: (a) the original image (b) the encrypted image

4.2 Statistical Analysis

(1) Information entropy:

The information entropy is often used to measure the randomness of the cipher images. The entropy \(H\left (m \right )\) of a message source S is:

$$ H(m) = \sum\limits_{m=0}^{2^{N}-1}p(s_{m})\log_{2}\frac{1}{p(s_{m})} $$
(29)

where \(p\left ({s_{m} } \right )\) represents the probability of symbol s m and the entropy is expressed in bits. After encrypting a message, the ideal entropy of the encrypted image should be approaching 8 bits [41]. If the entropy is close to 8 bits, then it means the encryption system could resist the brute-force attack. With the proposed image encryption algorithm, counting times of each pixel in three primary colors (R, G, and B) and calculating the corresponding probability, three colors corresponding to the information entropy are shown in Table 2. From the results of statistics, the loss in the processing of information encryption is completely weak, thus the proposed scheme is stable and secure against entropy attack (Fig. 5).

(2) Histogram:

A good image encryption scheme should always generate a uniform histogram of the cipher-image for any plain-image. Figure 6a, Fig. 7a and Fig. 8a are the histograms of three primary colors of the original image while Fig. 6b, Fig. 7b and Fig. 8b are those of their corresponding encrypted image. It can be seen that the histograms of the original image ”Lena” are not evenly distributed and their shape difference is distinctly, while the histograms of the encrypted image tend to be a similar shape. It demonstrates that an attacker can hardly launch any effective statistical attack since the gray values are distributed uniformly.

(3) Correlation between adjacent pixels:

A color image is divided into three channels, i.e., R, G and B, and each channel is regarded as a gray-scale image. In ordinary images with definite visual content, each pixel is highly correlated with its adjacent pixels. A desirable encryption scheme should generate an encrypted image with rather weak correlation between adjacent pixels. The horizontal pixels correlation coefficient is:

$$ \rho_{xy} =\frac{cov\left( {x,y} \right)}{\sqrt {D\left( x \right)D\left( y \right)} } $$
(30)

The covariance cov(x,y) and the variance \(D\left (x \right )\) can be expressed respectively:

$$ cov\left( {x,y} \right)\text{=}\frac{1}{n}\sum\limits_{i=1}^{n} \left( x_{i} -\overset{\mathunderscore}{x}\right) \left( y_{i} -\overset{\mathunderscore}{y}\right) $$
(31)
$$ \mathrm{D}\left( x \right)\text{=}\frac{1}{{n}}\sum\limits_{j=1}^{n} \left( x_{j} -\overset{\mathunderscore}{x} \right)^{2} $$
(32)

where \(\overset {\mathunderscore }{x} = \frac {1}{n}\sum \limits _{i=1}^{n} {x_{i} } \), \(\overset {\mathunderscore }{y}=\frac {1}{n}\sum \limits _{i=1}^{n} {y_{i} } \). Similarly, the correlation coefficients of the vertical and diagonal directions could be obtained also. The correlation coefficients of three primary colors in horizontal, vertical and diagonal directions are shown in Table 3.

Figs. 910 and 11 show the correlation distributions between two adjacent pixels of R channel in the horizontal, vertical and diagonal directions.

Based on the data and figures above, three primary colors (R G B) of the original image in all directions between the adjacent pixels have close correlation. The correlation coefficients of the encrypted image are much little, which shows that the information was excellently hidden after the original image being encrypted. Thus the attacker cannot implement any statistical attack from the aspect of correlation.

(4) Key space and key sensitivity:

Key space should be large enough to resist the brute-force attack, and it is also an important indicator of a security encryption algorithm. It is recommended that the ideal key space should be larger than 2100 while considering the current computer computation speed [42]. The time complexity for color image decryption in our presented algorithm is computed by: \(C\left ({\bar {{X}}_{0} ,\bar {{Y}}_{0} ,\bar {{Z}}_{0} ,\bar {{W}}_{0} } \right )={\Theta } \left ({\bar {{X}}_{0} \times \bar {{Y}}_{0} \times \bar {{Z}}_{0} \times \bar {{W}}_{0} } \right )\), where \({\bar {{X}}_{0} ,\bar {{Y}}_{0} ,\bar {{Z}}_{0}}\) and \({\bar {{W}}_{0}}\) are the initial keys of the hyper-chaotic system. Considering that the calculation precision is 10−15, the size of key space for initial parameters would be approximately 2200. Moreover, the quantum rotation gate \(R\left ({\xi _{m} ,\psi _{m} ,\zeta _{m} } \right )\) and random phase gates E, \(E^{\prime }\) and \(E^{\prime \prime }\) could be also used as the secret keys, which are more than 2100, thus the encryption algorithm has high security.

Key is the secret parameters of the encryption schemes. A good encryption scheme must have enough sensitivity to the key, i.e., the deciphered results are significantly different even if only the key is changed slightly. To detect the sensitivity of the key, the key could be changed little deviation to observe the effect of the decrypted image. As all of the secret keys are right, the image is shown in Fig. 12a; The decrypted image is shown in Fig. 12b with the wrong keys \(\bar {{X}}_{0} \text {+}10^{-15}\); Similarly, if \(\bar {{Y}}_{0} \), \(\bar {{Z}}_{0} \), \(\bar {{W}}_{0} \) deviate 10−15 respectively, while all of the other three keys are correct, the corresponding decrypted images are shown in Figs. 12c, d and e. It is convinced that the correct image could be reconstructed if the decryption keys and the domain positions match accurately, which ensures high security of the image encryption algorithm.

(5) Computational complexity:

Assume the original image is divided into three gray components and each component is represented by a channel. The channel can be viewed as a 2n×2n gray image. According to the parallel characteristics of quantum computing, the gray-scale information for each pixel of the quantum image is performed with the quantum XOR operation ⊕, which is realized by using a 2n−CNOT gate. It is understood that each n−CNOT gate can be decomposed into 4n−8 Toffoli gates, and the Toffoli gate can be realized by six Controlled-NOT gates [40]. In the proposed image encryption algorithm, the hyper-chaotic sequences are scrambled and diffused by the XOR operation, and the mix of three components involves six times of CNOT gate operations, thus the quantum image XOR operation needs 128n−256 basic gates. Consequently, the computational complexity of the quantum image XOR operation is \(O\left (n \right )\). The complexity of quantum random-phase operation for a quantum image is \(O\left (n \right )\), thus the random phase operation and rotation operation are of the same computational complexity. For an n-qubit input, the computation time of quantum Fourier transform is \(O\left ({n^{2}} \right )\) [43]. Consequently, the total computational complexity is \(O\left ({n^{2}} \right )\) by neglecting the small complexity. The classical image XOR operations could be accomplished by performing 6×22n XOR operations, and the classical random-phase encoding could be realized by 22n multiplication operations, thus the computational complexity of XOR operation is \(O\left ({2^{2n}} \right )\). Consequently, the computational complexity of the classical Fourier transform operation is \(O\left ({n2^{2n}} \right )\). As a result, the whole computational complexity \(O\left ({n2^{2n}} \right )\) of the classical encryption algorithm is required. In brief, the computational complexity of the presented quantum color image encryption algorithm is lower than that of its classical counterparts.

Fig. 5
figure 5

a original image Lena (b) original image Splash (c) original image Beans

Fig. 6
figure 6

Histograms of R channel: (a) Lena, (b) encrypted Lena

Fig. 7
figure 7

Histograms of G channel: (a) Lena, (b) encrypted Lena

Fig. 8
figure 8

Histograms of B channel: (a) Lena, (b) encrypted Lena

Fig. 9
figure 9

Correlation distributions between two horizontal adjacent pixels in R channel: (a) original image Lena and (b) encrypted image

Fig. 10
figure 10

Correlation distributions between two vertical adjacent pixels in R channel: (a) original image Lena and (b) encrypted image

Fig. 11
figure 11

Correlation distributions between two diagonal adjacent pixels in R channel: (a) original image Lena and (b) encrypted image

Fig. 12
figure 12

Decrypted images with: (a) correct keys, (b) incorrect \(\bar {{X}}_{0} \text {+}10^{-15}\), (c) incorrect \(\bar {{Y}}_{0} \text {+}10^{-15}\), (d) incorrect \(\bar {{Z}}_{0} \text {+}10^{-15}\), (e) incorrect \(\bar {{W}}_{0} \text {+}10^{-15}\)

Table 2 The information entropy of image Lena
Table 3 Correlation coefficients between adjacent pixels

5 Conclusion

The measurement principle and superposition of quantum states are utilized to establish the interaction among image pixels. A new quantum color image encryption and decryption scheme based on a hyper-chaotic system is proposed, which exploits the interesting properties of a hyper-chaotic system. The initial parameters of the hyper-chaotic system are applied into the quantum color image encryption scheme to increase the number of keys and enlarge the key space. Consecutively, the positions in an image could be divided into groups with the same color. Theoretical analyses and experimental results indicate that the proposed scheme possesses the advantages of acceptable encryption speed, large key space and high level of security, and could be implemented efficiently.