1 Introduction

In recent years, due to the outstanding properties of quantum computation, such as entanglement, superposition and parallelism, it has been widely applied into many fields of information sciences [1, 2, 5, 18]. Combining quantum mechanics with classical information theory has developed into an important and effective approach to improve information processing speed and enhance communication security [14]. As one of these applications and a young emerging cross-discipline of quantum mechanics and image processing, quantum image processing (QImP) which is devoted to making use of quantum computing technologies to capture, manipulate, and recover classical images for various purposes has become a hot research topic since it has huge storage capacity and parallel processing ability [27, 28].

The first step of QImP is how to store classical images into quantum computers by utilizing qubits. Many quantum image representation models are gradually put forward, such as Qubit Lattice [23], Entangled Image [22], Real Ket [8], FRQI [9], MCQI [20], QUALPI [35], NEQR [34], GQIR [7], NCQI [17], FQRCI [30], IFRQI [16], OCQR [12] and QRCI [26]. The existing representation models mainly focus on single quantum gray or color image, while the investigation on double quantum color images representation is still scarce.

Where there is information, where there will be dissemination. Undoubtedly, when the image information is transmitted through a public channel, attackers may intercept it and do some illegal operations such as duplication, modification and forgery. So it is very necessary to have some useful techniques to prevent the illegal invasions. One of the simplest and most efficient methods for protecting image data is image encryption which ensures that unauthorized persons could not obtain the original image without correct keys even if the encrypted image information is divulged. Quantum image encryption is defined as the approach of transforming a meaningful original quantum state image into a disordered one by performing quantum operations on a quantum image representation. Many algorithms for quantum image encryption have been suggested [3, 6, 10, 11, 15, 21, 29, 31, 32, 36, 37, 39]. Several examples can be considered; in 2013, Zhou et al. put forward a quantum image encryption and decryption algorithm by employing quantum image geometric transformations [36]. Following that, in 2015, Yang et al. presented an image encryption algorithm based on quantum walks [31]. Afterward, they investigated another quantum image encryption algorithm by using one-dimensional quantum cellular automata [32]. Subsequently, Gong et al. designed a quantum image encryption algorithm based on quantum image XOR operations [3]. And more recently, Ran et al. raised a quantum color image encryption scheme based on coupled hyper-chaotic Lorenz system with three impulse injections [15]. Zhou et al. investigated a bit-level quantum color image encryption scheme with cross-exchange operation and hyper-chaotic system, in which the gray values of three channels (RGB) were swapped to enhance the scrambling effect [39]. However, all the encryption schemes introduced above are devised for single quantum image.

Uniquely, in order to encrypt two images simultaneously in quantum computers, Liu et al. designed a double quantum image encryption algorithm based on quantum Arnold transform (QAT) and random qubit rotation, in which QAT was used to scramble the pixel’s position information and the corresponding gray information was altered by using random qubit rotation [13]. The theoretical analyses and numerical simulations had shown that it has superior performance in computational complexity and security. But, through our analysis, it is found that this encryption algorithm has some disadvantages as follows: (1) It is designed to deal with quantum gray images, while it is not applicable to quantum color images; (2) It directly adopts FRQI model to represent two original gray images, but it not devises an effective quantum representation model to store two images simultaneously, which leads to the storage resource (i.e., the number of qubits) required is not reduced; (3) FRQI model utilizes probability amplitudes of quantum states to store the gray information, so it is difficult to retrieve the classical image from a FRQI quantum state accurately. Despite aforementioned shortcomings, this article is the first paper to implement double quantum image encryption which can achieve the aim of improving the quantum image encryption efficiency. To conquer above problems, in this contribution, firstly, a double quantum color images representation model, i.e., DQRCI, together with its corresponding quantum circuit are investigated, by which two color digital images could be stored simultaneously into a quantum superposition state. Moreover, some simple DQRCI-based image processing operations are discussed and the corresponding quantum circuits are designed. Through analyses, it has been proved that DQRCI representation model has the following advantages:

  1. 1.

    DQRCI can save more storage space since it only employs 2n + 9 qubits to store two color images of size 2n × 2n, while \(\left (2n+24 \right )\times 2\) qubits are needed to encode the same images’ information in NCQI.

  2. 2.

    Different from FQRCI in which color information is stored as the probability amplitudes of three single qubits, the classical color images can be accurately retrieved from DQRCI quantum state due to the color information is encoded by the basis state of qubit sequence.

  3. 3.

    The complex and elaborate color transformations could be performed on DQRCI conveniently and some simple DQRCI-based image processing operations have very low computational complexity.

Furthermore, to ensure the security of DQRCI quantum state image, an encryption scheme is proposed. The validity verification of encryption system in quantum field is given for the first time. Numerical simulation and performance comparison demonstrate that the proposed double quantum color images encryption scheme shows better performance in histogram, correlation, information entropy and computational complexity.

The rest of this paper is organized as follows. Section 2 investigates DQRCI quantum image representation model, preparation and retrieving. Section 3 discusses some simple DQRCI-based image processing operations and designs the corresponding quantum circuits. The proposed double quantum color images encryption/decryption scheme and validity verification are described in Section 4. Section 5 gives numerical simulation and performance comparison. Finally, the conclusion work is drawn in Section 6.

2 DQRCI quantum image representation model, preparation and retrieving

2.1 DQRCI quantum image representation model and preparation

In ref. [26], QRCI representation model is proposed to store a color digital image of size 2n × 2n with every channel ranged \(\left [ 0,255\right ]\) in quantum computers. It uses three entangled qubit sequences to encode the image information, where the color information of three channels (R,G,B) is encoded into the first qubit sequence, while the corresponding bit-plane information and position information are encoded into the second and third qubit sequence, respectively. Its modularized preparation circuit is shown in Fig. 1 and the corresponding quantum representation can be written as

$$ \begin{array}{lllllll} \left| I \right\rangle &=\frac{1}{\sqrt{{{2}^{2n+3}}}}\sum\limits_{L=0}^{{{2}^{3}}-1}{\sum\limits_{Y=0}^{{{2}^{n}}-1}{\sum\limits_{X=0}^{{{2}^{n}}-1}{\left| C_{L}\left( Y,X \right) \right\rangle \otimes \left| L\right\rangle \otimes \left|YX \right\rangle }}} \\ & =\frac{1}{\sqrt{{{2}^{2n+3}}}}\sum\limits_{L=0}^{{{2}^{3}}-1}{\sum\limits_{Y=0}^{{{2}^{n}}-1}{\sum\limits_{X=0}^{{{2}^{n}}-1}{\left| R_{LYX}G_{LYX}B_{LYX} \right\rangle \otimes \left| L\right\rangle \otimes \left|YX \right\rangle }}} \end{array} $$
(1)
$$ \left| L \right\rangle =\left| {{L}_{2}}{{L}_{1}}{{L}_{0}} \right\rangle $$
(2)
$$ \left| YX \right\rangle = \left| Y \right\rangle \left| X \right\rangle =\left| {{Y}_{n-1}}{{Y}_{n-2}}{\ldots} {{Y}_{0}} \right\rangle \left| {{X}_{n-1}}{{X}_{n-2}}{\ldots} {{X}_{0}} \right\rangle $$
(3)

where \(\left | L \right \rangle \) and \(\left | YX \right \rangle \) denote the bit-plane information and position information, respectively; \(\left | {{C}_{L}}\left (Y,X \right ) \right \rangle \) represents the corresponding color information of pixel \(\left (Y,X \right )\) in bit-plane L; \( {{R}_{LYX}},{{G}_{LYX}},{{B}_{LYX}}\in \left \{ 0,1 \right \}\), L = 0,1,…,7, Y,X = 0,1,…,2n − 1.

Fig. 1
figure 1

Modularized preparation circuit of QRCI

Inspired by QRCI, by taking full advantage of quantum superposition and quantum entanglement, we investigate DQRCI representation model to store two color images of size 2n × 2n with every channel ranged \(\left [ 0,255\right ]\) simultaneously as follows

$$ \begin{array}{lllllll} \left| D \right\rangle &=\frac{1}{\sqrt{{{2}^{2n+3}}}}\sum\limits_{L=0}^{{{2}^{3}}-1}{\sum\limits_{Y=0}^{{{2}^{n}}-1}{\sum\limits_{X=0}^{{{2}^{n}}-1}{\left| C\left( L, Y,X \right) \right\rangle \otimes \left| L\right\rangle \otimes \left|YX \right\rangle }}} \\ &=\frac{1}{\sqrt{{{2}^{2n+3}}}}\sum\limits_{L=0}^{{{2}^{3}}-1}{\sum\limits_{Y=0}^{{{2}^{n}}-1}{\sum\limits_{X=0}^{{{2}^{n}}-1}{\left| {C_{L}^{1}}\left( Y,X \right) {C_{L}^{2}}\left( Y,X \right) \right\rangle \otimes \left| L\right\rangle \otimes \left|YX \right\rangle }}} \\ & =\frac{1}{\sqrt{{{2}^{2n+3}}}}\sum\limits_{L=0}^{{{2}^{3}}-1}{\sum\limits_{Y=0}^{{{2}^{n}}-1}{\sum\limits_{X=0}^{{{2}^{n}}-1}{\left| R_{LYX}^{1}G_{LYX}^{1}B_{LYX}^{1} R_{LYX}^{2}G_{LYX}^{2}B_{LYX}^{2} \right\rangle \otimes \left| L\right\rangle \otimes \left|YX \right\rangle }}} \end{array} $$
(4)

where \(\left | {C_{L}^{1}}\left (Y,X \right ) \right \rangle =\left | R_{LYX}^{1}G_{LYX}^{1}B_{LYX}^{1} \right \rangle \) and \(\left | {C_{L}^{2}}\left (Y,X \right ) \right \rangle =\left | R_{LYX}^{2}G_{LYX}^{2}B_{LYX}^{2} \right \rangle \) represent the color information of pixel \(\left |YX \right \rangle \) in bit-plane \(\left | L\right \rangle \) in two images, respectively.

According to ref. [17], \(\left (2n+24\right )\times 2\) qubits are needed to encode two color digital images of size 2n × 2n with every channel ranged \(\left [ 0,255\right ]\) in NCQI. However, DQRCI only employs 2n + 9 qubits to store the same image information. The quantum circuit of encoding image information in DQRCI representation model is designed in Fig. 2.

Fig. 2
figure 2

The quantum circuit of encoding image information in DQRCI representation model

Figure 3 shows the modularized preparation circuit of DQRCI.

Fig. 3
figure 3

Modularized preparation circuit of DQRCI

Taking two color images with size 2 × 2 shown in Fig. 4 as examples, the DQRCI expression is as

$$ \begin{array}{lllllll} \left| D \right\rangle =&\frac{1}{\sqrt{{{2}^{5}}}}\left[ \left| 100000 \right\rangle \otimes\left| 000\right\rangle \otimes\left|00 \right\rangle+ \left| 000001 \right\rangle\otimes \left| 000\right\rangle \otimes\left|01 \right\rangle\right.+\left| 001000 \right\rangle \otimes\left| 000\right\rangle\otimes \left|10 \right\rangle \\ &+\left| 110000 \right\rangle\otimes \left| 000\right\rangle \otimes\left|11 \right\rangle +\left| 100000 \right\rangle \otimes\left| 001\right\rangle \otimes\left| 00 \right\rangle+ \left| 000101 \right\rangle \otimes\left| 001 \right\rangle \otimes\left| 01 \right\rangle\\ &+\left| 101000 \right\rangle\otimes \left| 001 \right\rangle\otimes \left| 10 \right\rangle+\left| 110000 \right\rangle \otimes\left| 001 \right\rangle \otimes\left| 11 \right\rangle +\left| 110010 \right\rangle \otimes\left| 010 \right\rangle \otimes\left| 00 \right\rangle\\ &+ \left| 100101 \right\rangle\otimes \left| 010 \right\rangle \otimes\left| 01 \right\rangle+\left| 011000 \right\rangle \otimes\left| 010 \right\rangle \otimes\left| 10 \right\rangle+\left| 110111 \right\rangle \otimes\left| 010 \right\rangle \otimes\left| 11 \right\rangle \\ & +\left| 100000 \right\rangle \otimes\left| 011 \right\rangle\otimes \left| 00 \right\rangle+ \left| 010001 \right\rangle \otimes\left| 011 \right\rangle\otimes \left| 01 \right\rangle+\left| 001110 \right\rangle \otimes\left| 011 \right\rangle \otimes\left| 10 \right\rangle\\ & +\left| 110000 \right\rangle \otimes\left| 011 \right\rangle \otimes\left| 11 \right\rangle+\left| 100000 \right\rangle\otimes \left| 100 \right\rangle \otimes\left| 00 \right\rangle+ \left| 000101 \right\rangle \otimes\left| 100 \right\rangle\otimes \left| 01 \right\rangle\\ &+\left| 101000 \right\rangle \otimes\left| 100 \right\rangle \otimes\left| 10 \right\rangle+\left| 110000 \right\rangle \otimes\left| 100 \right\rangle \otimes\left| 11 \right\rangle +\left| 110010 \right\rangle \otimes\left| 101 \right\rangle \otimes\left| 00 \right\rangle\\ &+ \left| 100001 \right\rangle\otimes \left| 101 \right\rangle \otimes\left| 01 \right\rangle+\left| 111000 \right\rangle\otimes \left| 101 \right\rangle\otimes \left| 10 \right\rangle+\left| 110111 \right\rangle \otimes\left| 101 \right\rangle\otimes \left| 11 \right\rangle \\ & +\left| 110010 \right\rangle \otimes\left| 110 \right\rangle \otimes\left| 00 \right\rangle+ \left| 110001 \right\rangle \otimes\left| 110 \right\rangle\otimes \left| 01 \right\rangle+\left| 011110 \right\rangle \otimes\left| 110 \right\rangle \otimes\left| 10 \right\rangle\\ &+\left| 110111 \right\rangle\otimes \left| 110 \right\rangle \otimes\left| 11 \right\rangle +\left| 100000 \right\rangle \otimes\left| 111 \right\rangle \otimes\left| 00 \right\rangle+ \left| 010101 \right\rangle\otimes \left| 111 \right\rangle \otimes\left| 01 \right\rangle \\ & \left.+\left| 001110 \right\rangle \otimes\left| 111 \right\rangle \otimes\left| 10 \right\rangle+\left| 110000 \right\rangle \otimes\left| 111 \right\rangle \otimes\left| 11 \right\rangle \right] \end{array} $$
(5)
Fig. 4
figure 4

Two color digital images with size 2 × 2

2.2 Image retrieving

Because quantum state image cannot be recognized by human eyes, it is an important processing operation to retrieve classical image from quantum system accurately. Quantum measurement is a unique way to retrieve classical image from quantum state. During image retrieval from DQRCI quantum image, every pixel in each bit-plane should be recovered individually. The measurement operation Ω for bit-plane informaiton and position information as defined in (6) is used to extract the information of a single pixel

$$ {\Omega} =\sum\limits_{L=0}^{{{2}^{3}}-1}{\sum\limits_{Y=0}^{{{2}^{n}}-1}{\sum\limits_{X=0}^{{{2}^{n}}-1}{{{\left| I \right\rangle }^{\otimes 6}}\otimes \left| L \right\rangle \otimes \left| YX \right\rangle \otimes \left\langle YX \right|\otimes \left\langle L \right|}}} $$
(6)

By applying Ω to DQRCI quantum state image \(\left | D \right \rangle \) in (4), \(\left | {{H}_{LYX}} \right \rangle \) which contains the corresponding information of pixel \(\left | YX \right \rangle \) in bit-plane \(\left | L \right \rangle \) is obtained

$$ \left| {{H}_{LYX}} \right\rangle =\left| C\left( L, Y,X \right) \right\rangle \otimes \left| L \right\rangle \otimes \left| YX \right\rangle $$
(7)

The projective measurement operation F is constructed as follows

$$ F =\sum\limits_{f=0}^{{{2}^{6}}-1}{f\left| f \right\rangle \left\langle f \right|} $$
(8)

Through performing F on \(\left | {{H}_{LYX}} \right \rangle \), the color information of two images can be retrieved, i.e., \(C\left (L, Y,X \right )={{2}^{5}}\times R_{LYX}^{1}+{{2}^{4}}\times G_{LYX}^{1}+{{2}^{3}}\times B_{LYX}^{1}+{{2}^{2}}\times R_{LYX}^{2}+{{2}^{1}}\times G_{LYX}^{2}+{{2}^{0}}\times B_{LYX}^{2}\).

For pixel \(\left | YX \right \rangle \) in bit-plane \(\left | L \right \rangle \), the accurate color information of two images equals to the expectation value \(\left \langle C\left (L, Y,X \right ) \right |F\left | C\left (L, Y,X \right ) \right \rangle \)

$$ \begin{array}{lllllll} & \langle C\left( L, Y,X \right)|F\left| C\left( L, Y,X \right) \right\rangle \\ =&\langle C\left( L, Y,X \right)|\left( \sum\limits_{f=0}^{{{2}^{6}}-1}{f\left| f \right\rangle \left\langle f \right|} \right)\left| C\left( L, Y,X \right) \right\rangle \\ =&\sum\limits_{f=0}^{{{2}^{6}}-1}{f\langle C\left( L, Y,X \right)|\left( \left| f \right\rangle \left\langle f \right| \right)\left| C\left( L, Y,X \right) \right\rangle } \\ =&C\left( L, Y,X \right) \end{array} $$
(9)

It can be seen from (9) that the two classical color images can be accurately retrieved from DQRCI quantum state image if all pixels in all eight bit-planes are retrieved.

3 Some simple DQRCI-based image processing operations

3.1 Color complement operation

Color complement operation UC is defined as

$$ {{U}_{C}}={{X}^{\otimes 6}}\otimes {{I}^{\otimes 2n+3}} $$
(10)

where X represents quantum NOT gate

$$ X=\left[ \begin{array}{lllll} 0 & 1 \\ 1 & 0 \end{array} \right] $$
(11)

The output of performing UC on the state \(\left |{D} \right \rangle \) in (4) can be described as follows

$$ \begin{array}{lllllll} {{U}_{C}}\left| {D} \right\rangle =\frac{1}{\sqrt{{{2}^{2n+3}}}}\sum\limits_{L=0}^{{{2}^{3}}-1}{\sum\limits_{Y=0}^{{{2}^{n}}-1}{\sum\limits_{X=0}^{{{2}^{n}}-1}{\left| \bar{R}_{LYX}^{1}\bar{G}_{LYX}^{1}\bar{B}_{LYX}^{1} \bar{R}_{LYX}^{2}\bar{G}_{LYX}^{2}\bar{B}_{LYX}^{2} \right\rangle \otimes \left| L \right\rangle \otimes \left| YX \right\rangle}}} \end{array} $$
(12)

where, \(\left | \bar {K}_{LYX}^{j}\right \rangle =\left | 1-{K}_{LYX}^{j}\right \rangle \), \(K\in \left \{ R,G,B \right \},j=1,2\).

The quantum circuit of color complement operation UC in DQRCI is demonstrated in Fig. 5. It can be seen that the color complement operation can be implemented by 6 NOT gates.

Fig. 5
figure 5

The quantum circuit of color complement operation UC in DQRCI

3.2 Channel swapping operation

The first type of channel swapping operation \({U_{S}^{1}}\) is defined as

$$ {U_{S}^{1}}=I\otimes swap\left( 3\right)\otimes I{}^{\otimes 2n+5} $$
(13)

where, \(swap\left (3\right )\) gate is shown in Fig. 6.

Fig. 6
figure 6

Notation of \(swap\left (3\right )\) gate

The result after executing \({U_{S}^{1}}\) to the state \(\left |{D} \right \rangle \) in (4) is presented as below

$$ {U_{S}^{1}}\left| {D} \right\rangle =\frac{1}{\sqrt{{{2}^{2n+3}}}}\sum\limits_{L=0}^{{{2}^{3}}-1}{\sum\limits_{Y=0}^{{{2}^{n}}-1}{\sum\limits_{X=0}^{{{2}^{n}}-1}{\left| R_{LYX}^{1}R_{LYX}^{2}B_{LYX}^{1} G_{LYX}^{1}G_{LYX}^{2}B_{LYX}^{2} \right\rangle \otimes \left| L \right\rangle \otimes \left| YX \right\rangle}}} $$
(14)

The second type of channel swapping operation \({U_{S}^{2}}\) is defined as

$$ {U_{S}^{2}}=I{}^{\otimes 2} \otimes swap\left( 3\right)\otimes I{}^{\otimes 2n+4} $$
(15)

The production of performing \({U_{S}^{2}}\) on the state \(\left |{D} \right \rangle \) in (4) is expressed as follows

$$ {U_{S}^{2}}\left| {D} \right\rangle =\frac{1}{\sqrt{{{2}^{2n+3}}}}\sum\limits_{L=0}^{{{2}^{3}}-1}{\sum\limits_{Y=0}^{{{2}^{n}}-1}{\sum\limits_{X=0}^{{{2}^{n}}-1}{\left| R_{LYX}^{1}G_{LYX}^{1}G_{LYX}^{2} R_{LYX}^{2}B_{LYX}^{1}B_{LYX}^{2} \right\rangle \otimes \left| L \right\rangle \otimes \left| YX \right\rangle}}} $$
(16)

The quantum circuits of channel swapping operations \({U_{S}^{1}}\) and \({U_{S}^{2}}\) in DQRCI are illustrated in Fig. 7. It can be seen that both channel swapping operations can be implemented by 3 CNOT gates.

Fig. 7
figure 7

The quantum circuits of channel swapping operations in DQRCI: a\({U_{S}^{1}}\), b\({U_{S}^{2}}\)

3.3 Bit-plane reversing operation

The bit-plane reversing operation UR is defined as

$$ {{U}_{R}}={{I}^{\otimes 6}}\otimes {{X}^{\otimes 3}}\otimes {{I}^{\otimes 2n}} $$
(17)

The outcome of performing UR on the state \(\left |{D} \right \rangle \) in (4) is shown as below

$$ {{U}_{R}}\left| {D} \right\rangle=\frac{1}{\sqrt{{{2}^{2n+3}}}}\sum\limits_{L=0}^{{{2}^{3}}-1}{\sum\limits_{Y=0}^{{{2}^{n}}-1}{\sum\limits_{X=0}^{{{2}^{n}}-1}{\left| R_{LYX}^{1}G_{LYX}^{1}B_{LYX}^{1} R_{LYX}^{2}G_{LYX}^{2}B_{LYX}^{2} \right\rangle \otimes \left| 7-L \right\rangle\otimes \left| YX \right\rangle }}} $$
(18)

The quantum circuit of bit-plane reversing operation UR in DQRCI is given in Fig. 8. It can be seen that the bit-plane reversing operation can be implemented by 3 NOT gates.

Fig. 8
figure 8

The quantum circuit of bit-plane reversing operation UR in DQRCI

3.4 Color transformation

Color transformation U can be designed by combining the above operations

$$ U={{U}_{R}}{U_{S}^{2}}{U_{S}^{1}}{{U}_{C}} $$
(19)

Obviously, the transformation U is reversible, and \({U}^{-1}={{{U}_{C}}{U_{S}^{1}}{U_{S}^{2}}{U}_{R}}\).

The quantum circuit of color transformation U in DQRCI is shown in Fig. 9. It can be seen that the color transformation can be implemented by 9 NOT gates and 6 CNOT gates.

Fig. 9
figure 9

The quantum circuit of special color transformation U in DQRCI

Taking two color images with size 512 × 512 as examples, Fig. 10 displays the output ones after applying the transformation U.

Fig. 10
figure 10

Simulation results: a Baboon, b House, c Transformed Baboon, d Transformed House

From Fig. 10, it can be seen that the designed color transformation U can transform two original color images into meaningless ones, i.e., visual acuity is lost. Therefore, in the following encryption scheme to be put forward, we use the transformation U as an encryption method to hide original image information.

4 Double quantum color images encryption/decryption scheme and validity verification

4.1 Double quantum color images encryption scheme

The proposed double quantum color images encryption scheme based on DQRCI consists of two stages as illustrated in Fig. 11. First, the quantum color transformation is performed on color information and bit-plane information without changing the position information. Then, to enhance the security of encryption scheme and make the distribution of pixel values more uniform, the color information is modified by quantum XOR operation, while the bit-plane information and position information remain unchanged. Figure 12 demonstrates the specific flowchart of encryption and decryption scheme.

  1. Input:

    original DQRCI quantum stage image \(\left | D \right \rangle \) in (4).

  2. Keys:

    \({{x}_{1}}\left (0 \right ),{{y}_{1}}\left (0 \right ),{{z}_{1}}\left (0 \right ),{{x}_{2}}\left (0 \right ),{{y}_{2}}\left (0 \right ),{{z}_{2}}\left (0 \right )\).

  3. Output:

    encrypted DQRCI quantum stage image \(\left | E \right \rangle \).

  • Stage 1:quantum color transformation

Through performing the color transformation U on \(\left | D \right \rangle \), \(\left | {{E}^{\prime }} \right \rangle \) can be obtained

$$ \begin{array}{lllllll} \left| {{E}^{\prime}} \right\rangle & =U\left( \frac{1}{\sqrt{{{2}^{2n+3}}}}\sum\limits_{L=0}^{{{2}^{3}}-1}{\sum\limits_{Y=0}^{{{2}^{n}}-1}{\sum\limits_{X=0}^{{{2}^{n}}-1}{\left| R_{LYX}^{1}G_{LYX}^{1}B_{LYX}^{1} R_{LYX}^{2}G_{LYX}^{2}B_{LYX}^{2} \right\rangle \otimes \left| L \right\rangle\otimes \left| YX \right\rangle }}} \right) \\ &=\frac{1}{\sqrt{{{2}^{2n+3}}}}\sum\limits_{L=0}^{{{2}^{3}}-1}{\sum\limits_{Y=0}^{{{2}^{n}}-1}{\sum\limits_{X=0}^{{{2}^{n}}-1}{\left| {R^{\prime}}_{LYX}^{1}{G^{\prime}}_{LYX}^{1}{B^{\prime}}_{LYX}^{1} {R^{\prime}}_{LYX}^{2}{G^{\prime}}_{LYX}^{2}{B^{\prime}}_{LYX}^{2} \right\rangle \otimes \left| {{L}^{\prime}} \right\rangle \otimes \left| YX \right\rangle }}} \end{array} $$
(20)
  • Stage 2:quantum XOR operation

Fig. 11
figure 11

Encryption process

The coupled hyper-chaotic Lorenz system is defined as

$$ \left\{ \begin{array}{lllllll} & {{{\dot{x}}}_{1}}=\sigma \left( {{y}_{1}}-{{x}_{1}} \right) \\ & {{{\dot{y}}}_{1}}=\rho {{x}_{1}}-{{y}_{1}}-{{x}_{1}}{{z}_{1}}+{{k}_{1}}\left( {{x}_{2}}-{{y}_{2}} \right) \\ & {{{\dot{z}}}_{1}}={{x}_{1}}{{y}_{1}}-\varepsilon {{z}_{1}} \\ & {{{\dot{x}}}_{2}}=\sigma \left( {{y}_{2}}-{{x}_{2}} \right) \\ & {{{\dot{y}}}_{2}}=\rho {{x}_{2}}-{{y}_{2}}-{{x}_{2}}{{z}_{2}}+{{k}_{2}}\left( {{x}_{1}}-{{y}_{1}} \right) \\ & {{{\dot{z}}}_{2}}={{x}_{2}}{{y}_{2}}-\varepsilon {{z}_{2}} \end{array} \right. $$
(21)

where σ, ρ and ε are positive control parameters, k1 and k2 are coupling parameters [4]. When parameters are set as σ = 10,ρ = 28,ε = 8/3,k1 = k2 = 0.05, the behavior of system (21) is hyper-chaotic. In this stage, we use system (21) to generate key sequences to control quantum XOR operation.

Fig. 12
figure 12

Flowchart of encryption and decryption scheme

First, coupled hyper-chaotic Lorenz system (21) is iterated with initial values \({{x}_{1}}\left (0 \right )\), \({{y}_{1}}\left (0 \right )\), \({{z}_{1}}\left (0 \right )\), \({{x}_{2}}\left (0 \right )\), \({{y}_{2}}\left (0 \right )\), \({{z}_{2}}\left (0 \right )\) for N = 22n+ 3 times. When the iterating times satisfy t1 = N/4, t2 = 2N/4 and t3 = 3N/4, Δx1 = 0.001 is injected into \({{x}_{1}}\left ({{t}_{1}} \right )\), \({{x}_{1}}\left ({{t}_{2}} \right )\) and \({{x}_{1}}\left ({{t}_{3}} \right )\), respectively. Six sequences \(\left \{ {{x}_{1}}\left (0 \right ),{\ldots } ,{{x}_{1}}\left ({{2}^{2n+3}}-1 \right ) \right \}\), \(\left \{ {{y}_{1}}\left (0 \right ),{\ldots } ,{{y}_{1}}\left ({{2}^{2n+3}}-1 \right ) \right \}\), \(\left \{ {{z}_{1}}\left (0 \right ),{\ldots } ,{{z}_{1}}\left ({{2}^{2n+3}}-1 \right ) \right \}\), \(\left \{ {{x}_{2}}\left (0 \right ),{\ldots } ,{{x}_{2}}\left ({{2}^{2n+3}}-1 \right ) \right \}\), \(\left \{ {{y}_{2}}\left (0 \right ),{\ldots } ,{{y}_{2}}\left ({{2}^{2n+3}}-1 \right ) \right \}\) and \(\left \{ {{z}_{2}}\left (0 \right ),{\ldots } ,{{z}_{2}}\left ({{2}^{2n+3}}-1 \right ) \right \}\) can be generated. Then they are calculated as follows

$$ \begin{array}{lllllll} & \left|{T_{i}^{j}}\right\rangle =\left|T_{sku}^{j}\right\rangle=\left|floor\left( {{x}_{j}}\left( i \right)\times {{10}^{14}} \right)\bmod 2\right\rangle \\ & \left|{V_{i}^{j}}\right\rangle =\left|V_{sku}^{j}\right\rangle=\left|floor\left( {{y}_{j}}\left( i \right)\times {{10}^{14}} \right)\bmod 2\right\rangle\\ & \left|{W_{i}^{j}}\right\rangle =\left|W_{sku}^{j}\right\rangle=\left|floor\left( {{z}_{j}}\left( i \right)\times {{10}^{14}} \right)\bmod 2\right\rangle \end{array} $$
(22)

where, j = 1,2, i = 0,1,⋯,22n+ 3 − 1, s = 0,1,⋯,7, k,u = 0,1,⋯,22n − 1 and \(floor\left (\cdot \right )\) stands for the rounding operation. Obviously, \(\left |{T_{i}^{j}}\right \rangle ,\left |{V_{i}^{j}}\right \rangle ,\left |{W_{i}^{j}}\right \rangle \in \left \{ \left | 0 \right \rangle ,\left | 1 \right \rangle \right \}\).

Quantum XOR operation UXOR can be constructed as

$$ {{U}_{XOR}}=\prod\limits_{L=0}^{{{2}^{3}}-1}{\prod\limits_{Y=0}^{{{2}^{n}}-1}{\prod\limits_{X=0}^{{{2}^{n}}-1}{\left( {{I}^{\otimes 6}}\otimes \sum\limits_{s=0}^{{{2}^{3}}-1}{\sum\limits_{k=0}^{{{2}^{n}}-1}{\sum\limits_{u=0,sku\ne LYX}^{{{2}^{n}}-1}{\left| s \right\rangle \left| ku \right\rangle \langle ku|\langle s|}}} +{{\Gamma }_{LYX}}\otimes \left| L \right\rangle \left| YX \right\rangle \langle YX|\langle L| \right)}}} $$
(23)

where quantum operation \({{\Gamma }_{LYX}}={\Gamma }_{LYX}^{{{R}_{1}}}\otimes {\Gamma }_{LYX}^{{{G}_{1}}}\otimes {\Gamma }_{LYX}^{{{B}_{1}}}\otimes {\Gamma }_{LYX}^{{{R}_{2}}}\otimes {\Gamma }_{LYX}^{{{G}_{2}}}\otimes {\Gamma }_{LYX}^{{{B}_{2}}}\) is used to modify the color information of pixel \(\left | YX \right \rangle \) in bit-plane \(\left | L \right \rangle \). \({\Gamma }_{LYX}^{{{R}_{1}}}\), \({\Gamma }_{LYX}^{{{G}_{1}}}\), \({\Gamma }_{LYX}^{{{B}_{1}}}\), \({\Gamma }_{LYX}^{{{R}_{2}}}\), \({\Gamma }_{LYX}^{{{G}_{2}}}\), \({\Gamma }_{LYX}^{{{B}_{2}}}\) are quantum oracles and the corresponding functions can be described as below

$$ \begin{array}{lllllll} & {\Gamma}_{LYX}^{{{R}_{1}}}:\left| {R^{\prime}}_{LYX}^{1} \right\rangle \to \left| {R^{\prime}}_{LYX}^{1}\oplus T_{LYX}^{1} \right\rangle \\ & {\Gamma}_{LYX}^{{{G}_{1}}}:\left| {G^{\prime}}_{LYX}^{1} \right\rangle \to \left| {G^{\prime}}_{LYX}^{1}\oplus V_{LYX}^{1} \right\rangle \\ & {\Gamma}_{LYX}^{{{B}_{1}}}:\left| {B^{\prime}}_{LYX}^{1} \right\rangle \to \left| {B^{\prime}}_{LYX}^{1}\oplus W_{LYX}^{1} \right\rangle \\ & {\Gamma}_{LYX}^{{{R}_{2}}}:\left| {R^{\prime}}_{LYX}^{2} \right\rangle \to \left| {R^{\prime}}_{LYX}^{2}\oplus T_{LYX}^{2} \right\rangle \\ & {\Gamma}_{LYX}^{{{G}_{2}}}:\left| {G^{\prime}}_{LYX}^{2} \right\rangle \to \left| {G^{\prime}}_{LYX}^{2}\oplus V_{LYX}^{2} \right\rangle \\ & {\Gamma}_{LYX}^{{{B}_{2}}}:\left| {B^{\prime}}_{LYX}^{2} \right\rangle \to \left| {B^{\prime}}_{LYX}^{2}\oplus W_{LYX}^{2} \right\rangle \end{array} $$
(24)

By applying UXOR to \(\left | {{E}^{\prime }} \right \rangle \), the final encrypted image \(\left | E \right \rangle \) can be obtained

$$ \begin{array}{lllllll} \left|E \right\rangle& ={{U}_{XOR}}\left| {E}^{\prime} \right\rangle\\ &=\prod\limits_{L=0}^{{{2}^{3}}-1}{\prod\limits_{Y=0}^{{{2}^{n}}-1}{\prod\limits_{X=0}^{{{2}^{n}}-1}{\left( {{I}^{\otimes 6}}\otimes \sum\limits_{s=0}^{{{2}^{3}}-1}{\sum\limits_{k=0}^{{{2}^{n}}-1}{\sum\limits_{u=0,sku\ne LYX}^{{{2}^{n}}-1}{\left| s \right\rangle \left| ku \right\rangle \langle ku|\langle s|}}} +{{\Gamma }_{LYX}}\otimes \left| L \right\rangle \left| YX \right\rangle \langle YX|\langle L| \right)}}}\left| {E}^{\prime} \right\rangle\\ &=\frac{1}{\sqrt{{{2}^{2n+3}}}}\sum\limits_{L=0}^{{{2}^{3}}-1}{\sum\limits_{Y=0}^{{{2}^{n}}-1}{\sum\limits_{X=0}^{{{2}^{n}}-1}{\left| {R^{\prime\prime}}_{LYX}^{1}{G^{\prime\prime}}_{LYX}^{1}{B^{\prime\prime}}_{LYX}^{1} {R^{\prime\prime}}_{LYX}^{2}{G^{\prime\prime}}_{LYX}^{2}{B^{\prime\prime}}_{LYX}^{2} \right\rangle \otimes \left| {{L}^{\prime}} \right\rangle \otimes \left| YX \right\rangle }}} \end{array} $$
(25)

where \(\left |{R^{\prime \prime }}_{LYX}^{1}\right \rangle =\left | {R^{\prime }}_{LYX}^{1}\oplus T_{LYX}^{1} \right \rangle \), \(\left |{G^{\prime \prime }}_{LYX}^{1}\right \rangle =\left | {G^{\prime }}_{LYX}^{1}\oplus V_{LYX}^{1} \right \rangle \), \(\left |{B^{\prime \prime }}_{LYX}^{1}\right \rangle =\left | {B^{\prime }}_{LYX}^{1}\oplus W_{LYX}^{1} \right \rangle \), \(\left |{R^{\prime \prime }}_{LYX}^{2}\right \rangle =\left | {R^{\prime }}_{LYX}^{2}\oplus T_{LYX}^{2} \right \rangle \), \(\left |{G^{\prime \prime }}_{LYX}^{2}\right \rangle =\left | {G^{\prime }}_{LYX}^{2}\oplus V_{LYX}^{2} \right \rangle \), \(\left |{B^{\prime \prime }}_{LYX}^{2}\right \rangle =\left | {B^{\prime }}_{LYX}^{2}\oplus W_{LYX}^{2} \right \rangle \).

4.2 Double quantum color images decryption scheme

The decryption scheme can be described as follows.

  1. Step 1.

    \(\left \{ \left |{T_{i}^{1}} \right \rangle \right \}\), \(\left \{ \left |{V_{i}^{1}} \right \rangle \right \}\), \(\left \{ \left |{W_{i}^{1}} \right \rangle \right \}\), \(\left \{ \left |{T_{i}^{2}} \right \rangle \right \}\), \(\left \{ \left |{V_{i}^{2}} \right \rangle \right \}\) and \(\left \{ \left |{W_{i}^{2}} \right \rangle \right \}\) can be generated with initial values \({{x}_{1}}\left (0 \right ),{{y}_{1}}\left (0 \right ),{{z}_{1}}\left (0 \right ),{{x}_{2}}\left (0 \right ),{{y}_{2}}\left (0 \right ),{{z}_{2}}\left (0 \right )\) according to stage 2 in the encryption scheme, where i = 0,1,⋯,22n+ 3 − 1. By applying the quantum XOR operation UXOR which is controlled by \(\left \{ \left |{T_{i}^{1}} \right \rangle \right \}\), \(\left \{ \left |{V_{i}^{1}} \right \rangle \right \}\), \(\left \{ \left |{W_{i}^{1}} \right \rangle \right \}\), \(\left \{ \left |{T_{i}^{2}} \right \rangle \right \}\), \(\left \{ \left |{V_{i}^{2}} \right \rangle \right \}\), \(\left \{ \left |{W_{i}^{2}} \right \rangle \right \}\) to \(\left | E \right \rangle \), \(\left | {{E}^{\prime }} \right \rangle \) can be got.

  2. Step 2.

    The quantum color inverse transformation U− 1 is performed on \(\left | {{E}^{\prime }} \right \rangle \) and the decrypted DQRCI quantum stage image can be obtained.

4.3 Validity verification

The validity verification of quantum image encryption system is to determine whether the decrypted quantum state image is the same as original quantum state image. If consistent, the system is valid, otherwise, the system is invalid. Unfortunately, none of the previous relevant literatures on quantum image encryption has dealt with this in theory.

First, we review the quantum equal (QE) [38], which is used to compare two numbers \(\left | P \right \rangle =\left | {{p}_{m-1}}{\cdots } {{p}_{1}}{{p}_{0}} \right \rangle \) and \(\left | Q \right \rangle =\left | {{q}_{m-1}}{\cdots } {{q}_{1}}{{q}_{0}} \right \rangle \) to find out whether they are equal or not. Therein, \(\left | {{p}_{i}} \right \rangle ,\left | {{q}_{i}} \right \rangle \in \left \{ \left | 0 \right \rangle ,\left | 1 \right \rangle \right \},i=0,1,{\cdots } ,m-1\). The output qubit \(\left | e \right \rangle \) represents the comparative result. If \(\left | e \right \rangle =\left | 1 \right \rangle \), \(\left | P \right \rangle =\left | Q \right \rangle \); otherwise, \(\left | P \right \rangle \ne \left | Q \right \rangle \). Figure 13 shows the specific circuit and modularized circuit of QE.

Fig. 13
figure 13

The quantum realization circuit of QE: a Concrete circuit, b Modularized circuit

It is assumed that the original DQRCI quantum state image and the corresponding decrypted image are shown in (26) and (27), respectively

$$ \left| D \right\rangle=\frac{1}{\sqrt{{{2}^{2n+3}}}}\sum\limits_{L=0}^{{{2}^{3}}-1}{\sum\limits_{Y=0}^{{{2}^{n}}-1}{\sum\limits_{X=0}^{{{2}^{n}}-1}{\left| R_{LYX}^{1}G_{LYX}^{1}B_{LYX}^{1} R_{LYX}^{2}G_{LYX}^{2}B_{LYX}^{2} \right\rangle \otimes \left| {{L}_{2}}{{L}_{1}}{{L}_{0}}\right\rangle \otimes \left|YX \right\rangle }}} $$
(26)
$$ \left| {{D}^{\prime}} \right\rangle =\frac{1}{\sqrt{{{2}^{2n+3}}}}\sum\limits_{{L}^{\prime}=0}^{{{2}^{3}}-1}{\sum\limits_{{Y}^{\prime}=0}^{{{2}^{n}}-1}{\sum\limits_{{X}^{\prime}=0}^{{{2}^{n}}-1}{\left| {R}^{\prime1}_{{L}^{\prime}{Y}^{\prime}{X}^{\prime}}{G}^{\prime1}_{{L}^{\prime}{Y}^{\prime}{X}^{\prime}}{B}^{\prime1}_{{L}^{\prime}{Y}^{\prime}{X}^{\prime}} {R}^{\prime2}_{{L}^{\prime}{Y}^{\prime}{X}^{\prime}}{G}^{\prime2}_{{L}^{\prime}{Y}^{\prime}{X}^{\prime}}{B}^{\prime2}_{{L}^{\prime}{Y}^{\prime}{X}^{\prime}} \right\rangle \otimes \left| {{{{L}^{\prime}}}_{2}}{{{{L}^{\prime}}}_{1}}{{{{L}^{\prime}}}_{0}} \right\rangle \otimes \left| {Y}^{\prime}{X}^{\prime} \right\rangle }}} $$
(27)

and there is an empty quantum binary image of the same size

$$ \left| {{D}^{\prime\prime}} \right\rangle =\frac{1}{{{2}^{n}}}\sum\limits_{{Y}^{\prime\prime}=0}^{{{2}^{n}}-1}{\sum\limits_{{X}^{\prime\prime}=0}^{{{2}^{n}}-1}{\left| 0 \right\rangle \otimes \left| {Y}^{\prime\prime}{X}^{\prime\prime} \right\rangle }} $$
(28)

The quantum circuit of verification process is shown in Fig. 14. The output is

$$ \left| V \right\rangle =\frac{1}{{{2}^{n}}}\sum\limits_{{Y}^{\prime\prime}=0}^{{{2}^{n}}-1}{\sum\limits_{{X}^{\prime\prime}=0}^{{{2}^{n}}-1}{\left| v\left( {Y}^{\prime\prime},{X}^{\prime\prime} \right) \right\rangle \otimes \left| {Y}^{\prime\prime}{X}^{\prime\prime} \right\rangle }} $$
(29)
Fig. 14
figure 14

Quantum circuit for validity verification

If for any pixel \( \left | {Y}^{\prime \prime }{X}^{\prime \prime } \right \rangle \), there is \(\left | v\left ({Y}^{\prime \prime },{X}^{\prime \prime } \right ) \right \rangle =\left | 1 \right \rangle \), the encryption system is valid, i.e., the decrypted DQRCI quantum state image is the same as original quantum state image; otherwise, the system is invalid.

5 Numerical simulation and performance comparison

To evaluate our proposed encryption scheme compared with other prior pertinent works, this section gives the simulation analysis. Due to the lack of physical quantum hardware, the simulation is implemented on a classical computer equipped with MATLAB R2016a environment. The quantum states and quantum operations are simulated by complex vectors and unitary matrices, respectively. The keys are set as \({{x}_{1}}\left (0 \right )=4.175,{{y}_{1}}\left (0 \right )=8.203,{{z}_{1}}\left (0 \right )=1.376,{{x}_{2}}\left (0 \right )=14.362,{{y}_{2}}\left (0 \right )=0.800,{{z}_{2}}\left (0 \right )=2.364\). From Fig. 15, it can be seen that any information of original images cannot be obtained from the encrypted ones which are noise-like. Therefore, the proposed encryption scheme is effective.

Fig. 15
figure 15

Three pairs of original color images and the corresponding encrypted ones: a Original Lena, b Original Baboon, c Encrypted Lena, d Encrypted Baboon, e Original Splash, f Original Sailboat, g Encrypted Splash, h Encrypted Sailboat, i Original Peppers, j Original House, k Encrypted Peppers, l Encryped House

5.1 Statistical analysis

5.1.1 Mean square error

Mean square error (MSE) calculated by the following equation can be used to characterize the difference between encrypted image and original one

$$ MSE=\frac{1}{M\times N}\sum\limits_{i=1}^{M}{\sum\limits_{j=1}^{N}{{{\left( D\left( i,j \right)-E\left( i,j \right) \right)}^{2}}}} $$
(30)

where M × N is the size of image, \(D\left (i,j \right )\) and \(E\left (i,j \right )\) denote pixel values of pixel \(\left (i,j \right )\) in original and encrypted image, respectively. The larger the MSE value, the better the security. For images shown in Fig. 15, the MSE values are calculated and listed in Table 1. It shows that the proposed encryption scheme can counteract statistical attack.

Table 1 The MSE values between original color images and the corresponding encrypted ones

5.1.2 Histogram

The histogram of an image reflects the pixel value distribution. Taking Lena and Baboon as examples, the histograms of R, G, B channels before and after encryption are illustrated in Fig. 16. It is shown that the histograms of encrypted images have two remarkable properties: (1) they are totally different from the histograms of original images and (2) their distributions are uniform, which means that the probability of existence of any pixel value is the same. Therefore, the proposed encryption scheme could resist statistical attack and differential attack.

Fig. 16
figure 16

The histogram distributions: a R channel of Lena, b G channel of Lena, c B channel of Lena, d R channel of encrypted Lena, e G channel of encrypted Lena, f B channel of encrypted Lena, g R channel of Baboon, h G channel of Baboon, i B channel of Baboon, j R channel of encrypted Baboon, k G channel of encrypted Baboon, l B channel of encrypted Baboon

5.1.3 Correlation of adjacent pixels

An ideal encrypted image should have very low correlation in horizontal, vertical and diagonal directions. The degree of correlation can be measured by CC

$$ CC=\frac{\sum\limits_{i=1}^{L}{\left( {{x}_{i}}-\frac{1}{L}\sum\limits_{i=1}^{L}{{{x}_{i}}} \right)\left( {{y}_{i}}-\frac{1}{L}\sum\limits_{i=1}^{L}{{{y}_{i}}} \right)}}{\sqrt{\sum\limits_{i=1}^{L}{{{\left( {{x}_{i}}-\frac{1}{L}\sum\limits_{i=1}^{L}{{{x}_{i}}} \right)}^{2}}\sum\limits_{i=1}^{L}{{{\left( {{y}_{i}}-\frac{1}{L}\sum\limits_{i=1}^{L}{{{y}_{i}}} \right)}^{2}}}}}} $$
(31)

where xi, yi stand for the pixel values of two adjacent pixels, respectively, L is the number of adjacent pixels. The correlation is strong when CC is close to 1 or − 1. Correspondingly, the correlation is weak when CC is close to 0.

Table 2 lists the CC values of adjacent pixels. It is shown that CC values of encrypted images are close to 0 in all three directions, which means that the encrypted images have an almost random relationship among adjacent pixels. Hence, the proposed encryption scheme is secure against correlation analysis attack.

Table 2 The CC values of original images and encrypted ones

5.1.4 Information entropy

Assume an image has Z pixel values \({{z}_{i}}\left (i=0,1,{\cdots } ,Z-1 \right )\). According to Shannon theorem, the corresponding information entropy value IE can be calculated as

$$ IE=-\sum\limits_{i=0}^{Z-1}{p\left( {{z}_{i}}\right){{\log }_{2}}p\left( {{z}_{i}} \right)} $$
(32)

where \(p\left ({{z}_{i}} \right )\) denotes the probability of occurrence of zi, \(\sum \limits _{i=0}^{Z-1}{p\left ({{z}_{i}} \right )}=1\). The ideal IE of an encrypted image is 8 bits. The closer the IE is to 8, the better the system is to resist entropy attack. Table 3 lists the IE values of images shown in Fig. 15. Obviously, the IE values of encrypted images are very close to 8 bits. Thus, the proposed encryption scheme can frustrate entropy attack.

Table 3 The IE values of original images and encrypted ones

5.1.5 Spatial frequency

The spatial frequency (SF) of an image reflects its overall activity in the spatial domain [25]. SF can be calculated as

$$ SF=\sqrt{{{\left( RF \right)}^{2}}+{{\left( CF \right)}^{2}}} $$
(33)

where RF and CF denote the row frequency and column frequency of the image, respectively. RF and CF are defined as follows

$$ RF=\sqrt{\frac{1}{M\times N}\sum\limits_{i=1}^{M}{\sum\limits_{j=1}^{N}{{{\left[ K\left( i,j \right)-K\left( i,j-1 \right) \right]}^{2}}}}} $$
(34)
$$ CF=\sqrt{\frac{1}{M\times N}\sum\limits_{i=1}^{M}{\sum\limits_{j=1}^{N}{{{\left[ K\left( i,j \right)-K\left( i-1,j \right) \right]}^{2}}}}} $$
(35)

where M × N is the size of image, \(K\left (i,j \right )\) represents the pixel value of position \(\left (i,j \right )\). RF and CF reflect the changes of horizontal and vertical directions in the image, respectively. Table 4 lists the RF, CF and SF values of images shown in Fig. 15. It can be seen that the SF values of encrypted images are almost 5 times the values of original ones. Therefore, the encrypted images have good randomness.

Table 4 The RF, CF and SF values of original images and encrypted ones

5.2 Key security analysis

5.2.1 Key sensitivity analysis

For an ideal image encryption algorithm, the keys should be sensitive enough to counteract brute-force attack. The sensitivity performance of proposed encryption system can be evaluated by changing one of the correct keys slightly, while the other keys remain untouched. To analyze the key sensitivity, six groups of incorrect keys are utilized to decrypt the encrypted images. Figures 17a–f depict the decryptd images with incorrect keys \({{x}_{1}}\left (0 \right )+{{10}^{-14}}\), \({{y}_{1}}\left (0 \right )+{{10}^{-14}}\), \({{z}_{1}}\left (0 \right )+{{10}^{-14}}\), \({{x}_{2}}\left (0 \right )+{{10}^{-14}}\), \({{y}_{2}}\left (0 \right )+{{10}^{-14}}\) and \({{z}_{2}}\left (0 \right )+{{10}^{-14}}\), respectively, while the other keys are all right. From Fig. 17, it is easy to find that a very little deviation from correct keys will result in an apparent distortion of the decrypted image. Thus, the proposed encryption scheme is very sensitive to keys.

Fig. 17
figure 17

Decrypted images with: a incorrect key \({{x}_{1}}\left (0 \right )+{{10}^{-14}}\), b incorrect key \({{y}_{1}}\left (0 \right )+{{10}^{-14}}\), c incorrect key \({{z}_{1}}\left (0 \right )+{{10}^{-14}}\), d incorrect key \({{x}_{2}}\left (0 \right )+{{10}^{-14}}\), e incorrect key \({{y}_{2}}\left (0 \right )+{{10}^{-14}}\), f incorrect key \({{z}_{2}}\left (0 \right )+{{10}^{-14}}\)

5.2.2 Key space analysis

Under current computation ability, the key space of an ideal image encryption scheme should larger than 2100 to resist brute-force attack [33]. In our encryption scheme, the keys are six initial values of coupled hyper-chaotic Lorenz system, i.e., \({{x}_{1}}\left (0 \right ),{{y}_{1}}\left (0 \right ),{{z}_{1}}\left (0 \right ),{{x}_{2}}\left (0 \right ),{{y}_{2}}\left (0 \right ),{{z}_{2}}\left (0 \right )\). Hence, the key space is about S = 1014 × 1014 × 1014 × 1014 × 1014 × 1014 = 1084 ≈ 2279 ≫ 2100, which is large enough to counteract the brute-force attack.

5.3 Computational complexity analysis

There is no doubt that computational complexity is an essential criterion for assessing a quantum image encryption scheme. Therefore, in this subsection, the computational complexity of proposed double quantum color images encryption scheme is discussed. In our encryption scheme, the computational complexity depends on quantum color transformation and quantum XOR operation. CNOT gate is chosen as the basic quantum gate. Ref. [19] shows the computational complexity of CNOT gate is far exceed the complexity of NOT gate, so we assume NOT gate has a computational complexity of \(\delta \left (\delta \ll 1 \right )\). The color transformation encompasses 9 NOT gates and 2 swap gates. It is known that one swap gate can be broken down into three CNOT gates [39]. So the computational complexity of color transformation is \(\left (6+9\delta \right )\). According to the parallel characteristics of quantum computation, the corresponding computational complexity of XOR operation could be evaluated via the computational complexity of quantum operation ΓLYX which is composed of six \(\left (2n+3\right )\)-CNOT gates. n-CNOT gate can be constructed by \(\left (4n-8\right )\) 2-CNOT gates and 6 CNOT gates are involved in realizing the 2-CNOT gate [24]. Therefore, ΓLYX can be realized by \(\left (288n+144\right )\) basic gates. In other words, the computational complexity of quantum XOR operation is \(\left (288n+144\right )\). Thus, the total computational complexity of proposed encryption scheme is \(\left (288n+150+9\delta \right )\).

5.4 Performance comparison

This subsection compares our encryption scheme with the previous pertinent work put forward by Liu et al. [13]. The comparison consequences include the following aspects.

5.4.1 Key space comparison

The Liu’s algorithm in Ref. [13] uses quantum Arnold transform (QAT) to scramble pixel positions and the gray information is changed by utilizing qubit random rotation. According to the analysis in Ref. [13], the key space of QAT is about 215 and the key space of random rotation matrix which depends on the image size is larger than 2256×256. Therefore, the total key space is more than 2256×256 + 15, which means their algorithm has a larger key space compared to what we investigated. However, under current computation ability, our key space is still large enough to resist brute-force attack. Despite this, our proposed encryption system is much reliable and outperform than theirs, as can be seen in the following parts.

5.4.2 Histogram comparison

Generally, the flatter the histogram of encrypted image and the fewer peaks appear in the histogram, the higher the security of image encryption algorithm. Figure 18 plots the histograms of original images and the corresponding encrypted ones by using the algorithm put forward in Ref. [13]. Obviously, the histograms of original images are different from each other, while the histograms of encrypted ones are similar. However, from the comparison between Figs. 16 and 18. it can be seen that the histograms of encrypted images with our scheme have more uniform distributions. Thus, our proposed double quantum color images encryption scheme is more efficient and applicable.

Fig. 18
figure 18

The histograms of original images and cipher images by using algorithm put forward in Ref. [13]. (Figure adapted from [13])

5.4.3 Correlation coefficient comparison

In this part of research, as regards the performance of correlation coefficient, our proposed encryption scheme is compared with the algorithm in Ref. [13]. It can be perceived from Tables 2 and 5 that the CC values of encrypted images are relatively smaller with our scheme. That is to say, our proposed double quantum color images encryption scheme has a stronger ability to cancel the correlation of adjacent pixels.

Table 5 The CC values by using the algorithm put forward in Ref. [13]

5.4.4 Information entropy comparison

As mentioned previously, an image encryption algorithm is reliable iff the information entropy value of encrypted image is close to ideal value, i.e., 8 bits, to counteract the entropy attack. The calculated IE values by using the algorithm in Ref. [13] are listed in Table 6. It can be seen from Tables 3 and 6 that the information entropy values of encrypted images are relatively larger with our scheme. In other words, our proposed double quantum color images encryption scheme is more stable and secure against entropy attack.

Table 6 The IE values by using the algorithm put forward in Ref. [13]

5.4.5 Computational complexity comparison

The computational complexity is compared in this part. As analyzed in the previous subsection, the total computational complexity of our proposed encryption scheme is \(O\left (n\right )\). According to the discussion in Ref. [13], the image encryption algorithm consists of five steps and the overall complexity is \(O\left ({n}^{2}\right )\), which is more complex than our scheme. Hence, we can give the conclusion that our proposed double quantum color images encryption scheme can reach a quadratic speedup than the algorithm in Ref. [13].

6 Conclusion

In this paper, in order to store and process two color images in quantum computer simultaneously, a double quantum color images representation model, i.e., DQRCI, is newly investigated. In DQRCI, the color information of two images is stored into the first qubit sequence, while the bit-plane information and position information are stored into the second and third qubit sequences, respectively. Besides, some simple DQRCI-based image processing operations are discussed and the corresponding quantum circuits are designed, which indicate that these operations have very low computational complexity based on DQRCI. Furthermore, to ensure the security of DQRCI quantum state image, an encryption scheme is proposed. Owing to DQRCI model exploits the basis states of qubit sequences to encode color information, two classical original color images can be retrieved accurately from the encrypted DQRCI image through using correct keys. By utilizing quantum computation, the validity verification of proposed encryption system in theory is given. Numerical simulation and performance comparison show that the proposed double quantum color images encryption scheme is secure against statistical attack and brute-force attack. Moreover, our quantum image encryption scheme is superior compared with the previous pertinent work in terms of security and computational complexity. Quantum image encryption is the simplest and most efficient approach for protecting quantum image information. In the future, we will try our best to design more effective quantum image representation model, processing algorithm and encryption scheme.