1 Introduction

Along with the bright prospect of quantum computers [1, 2], quantum image processing (QIP) has gained researchers’ interest in recent years [3]. The first task in this direction is constructing the quantum image representation model to represent images on quantum computer.

A great number of research results concerning quantum image representations have been established for the need of storing image information in quantum states, i.e., Qubit Lattice [4], Entangled Image [5], Real Ket [6], Flexible Representation of Quantum Images (FRQI) [7], quantum representation for log-polar images [8], a novel enhanced quantum representation of digital images (NEQR) [9], the improved novel enhanced quantum representation (INEQR) [10], Multi-channel representation for quantum images (MCRQI) [11], and a novel quantum representation for color digital images (NCQI) [12].

Because of the particular properties of quantum computation, there are some quantum processing transformations which are more efficient than their corresponding classical versions: quantum Fourier transform [13], quantum wavelet transform [14], and quantum discrete cosine transform [15]. Many researchers also focus on some elementary processing algorithms on quantum images, such as the geometric transformations on quantum images (GTQI) [16], image scrambling [17, 18], image translation [19], image scaling [20, 21], pseudocolor coding [22] and quantum Boolean image denoising [23].

Except the above elementary quantum image processing algorithms, quantum image information hiding has become a hot topic. Based on restricted geometric transformation, a watermarking scheme is given [24]. A novel quantum image watermark scheme is proposed by embedding the secrets into the Taylor series coefficients [25] of color information. Several watermarking schemes based on FRQI are put forward [2628]. Further, by using simple CNOT gate and small-scale quantum circuit, a watermarking scheme is projected in [29]. A novel quantum image steganography based on Moiré pattern is depicted [30]. A LSQb algorithm based on NEQR has been given in [31]. Block LSB steganography algorithm has been given [32]. However, all existing quantum image steganography algorithms are derived from gray scale image. In fact, in quantum image processing, gray image processing algorithms cannot be directly applied into the color digital image. We have to design different methods for the realization of information hiding algorithm of color image on quantum computer. Also, the images in the real life are usually colorful, so the corresponding quantum steganography algorithms of color images should be researched.

This paper is concerned with the LSQb information hiding algorithm based on NCQI. The following advantages of NCQI are suggested to make it suitable for quantum image LSQb algorithm:

  1. (1)

    NCQI acquires three channels RGB information and their corresponding positions in an image into a normalized quantum state. Thus, quantum CNOT gates and other simple quantum gates are used to flexibly link color and position information, providing an easy way to process image for the user.

  2. (2)

    NCQI uses a binary qubit basis to encode position information. It is easy to design various unitary operators to act on the different position qubits, which achieves the aim of embedding the secret qubits into distinct positions of an image.

  3. (3)

    For NCQI, color information of RGB channels is stored into a binary quantum sequence which is similar to the representations of classical color digital images. This makes it relatively easy to transfer LSB information hiding algorithm from classical computer to quantum computer.

In this paper, a substantially different method for the quantum realization is proposed for LSQb information hiding algorithm of NCQI. In the proposed method, the reliance on using quantum measurement or classical computer is no longer necessary. The key idea is how to embed secret qubits information into the least significant qubits of RGB channels. A method of designing three qubits comparator and unitary operators to embed secret qubits is required. Specifically, LSQb hiding problem is solved by two steps. First, through the designed three qubits comparator, the secret qubits are compared with least significant qubits of RGB channels. Then, by the constructed unitary operators, the secret qubits are embedded into the least significant qubits of RGB channels. Theoretical analyses show two merits of our algorithm: (1) the algorithm is absolutely blind. The extracting procedure does not need the original cover image. (2) The whole procedure of information extraction does not need any quantum measurement operation or any other help from classical computer.

The contributions of this paper are summarized as follows: First, three qubits comparator is designed, which can establish the relationship between the secret qubits and least significant qubits of three channels. Second, the elaborated unitary operators are constructed to construct LSQb information hiding algorithm. Third, the control-swap gates are introduced to design the quantum secret information extraction circuit.

The rest of the paper is organized as follows. Section 2 briefly introduces the NCQI model. Also, the differences between FRQI, NEQR, and NCQI are depicted. In Sect. 3, the reasonability and feasibility of LSQb information hiding algorithm of NCQI are proven based on the designed three qubits comparator and the unitary operators. The proposed LSQb information hiding and extraction algorithms are depicted in Sect. 4. In addition, complexity and comparison analysis are also shown. Simulation examples and quantum measurement on the outcome are demonstrated in Sect. 5. The conclusion and future work are given in Sect. 6.

2 Related work

2.1 NCQI

Inspired by the NEQR [9], NCQI is present to store and process color digital images on quantum computer. The range of x and y is assumed to be \(\left[ {0,2^n - 1} \right] \) and \(\left[ {0,2^n - 1} \right] \), respectively. The value range of every channel (RGB) is \(\left[ {0,2^q - 1} \right] \). Then, the quantum image representation model NCQI can be shown in the following equation:

$$\begin{aligned} \left| {I} \right\rangle = \frac{1}{{2^{n} }}\sum \limits _{y = 0}^{2^n - 1} {\sum \limits _{ x = 0}^{2^n - 1} {\left| {c\left( {y ,x } \right) } \right\rangle } } \otimes \left| {y x } \right\rangle \end{aligned}$$
(1)

where \({\left| {c\left( {y ,x } \right) } \right\rangle }\) denotes the color value of the corresponding pixel and it can be encoded by the binary sequence \({R_{q - 1} \cdots R_0 G_{q - 1} \cdots G_0 B_{q - 1} \cdots B_0 }\).

$$\begin{aligned} \left| {c\left( {y ,x } \right) } \right\rangle = \left| {\underbrace{R_{q - 1} \cdots R_0 }_{Red}\underbrace{G_{q - 1} \cdots G_0 }_{Green}\underbrace{B_{q - 1} \cdots B_0 }_{Blue}} \right\rangle \end{aligned}$$
(2)

Equation (1) indicates that the whole NCQI model is stored into a normalized quantum superposition state. There are three parts i.e., the color information \({c\left( {y ,x } \right) }\), the vertical position y and the horizontal position x to represent one pixel. The tensor product of these three qubits sequences constitutes the basis state of NCQI. Equation (2) implies that \({\left| {c\left( {y ,x } \right) } \right\rangle }\) contains three channels information, i.e. RGB. There are \(2n + 3q\) qubits being employed to store image information into a NCQI state for a \(2^n \times 2^n\) color image with every channel RGB ranged \(\left[ {0,2^q - 1} \right] \).

Fig. 1
figure 1

A \(4 \times 4\) color image and its quantum representation expression of NCQI

An example of a \(4 \times 4\) color image with three channels RGB ranged \([0, 2^8-1]\), i.e., \(n=2,q = 8\) is shown in Fig. 1. Equation expressed in Fig. 1 depicts that the whole NCQI is stored into a normalized quantum superposition state, in which each basis represents one pixel.

Among numerous quantum image models, FRQI and NEQR are the two most important and convenient models in considering the way in which a gray image is encoded under rectangular coordinate system. The differences and relations between FRQI, NEQR and NCQI can be summarized as follows:

  1. (1)

    FRQI and NEQR are very important two quantum image models, but they cannot represent the color digital images on the quantum computer. NCQI can represent color digital images on the quantum computer, which meets the fact that the images in the real life are usually colorful.

  2. (2)

    The most obvious distinction between them lies in the color encoding form. Due to the different patterns of color encoding state, the preparation process for FRQI, NEQR and NCQI is distinct. FRQI is convenient to research quantum gray image watermarking and frequency transform. However, for some binary qubit operation-based transforms, NEQR and NCQI may be more applicable.

  3. (3)

    NEQR is developed from FRQI. NCQI extends the NEQR model to the color digital image.

According to the above points, discussions about LSQb information hiding algorithm of color digital image is appropriate for NCQI.

3 Reasonability and feasibility of LSQb algorithm

In the following discussion, the original quantum image has the form described in Eq. (1) and the secret binary qubits stream has the form \(\left| {{s_{0}}} \right\rangle \), \(\left| {{s_{1}}} \right\rangle \), \(\cdots \), \(\left| {{s_{3t-2}}} \right\rangle \), \(\left| {{s_{3t-1}}} \right\rangle \), \(t \le {2^{2n}}\). Before proving the feasibility of LSQb information hiding algorithm, one proposition is given.

Proposition 1

Using the novel designed three qubits comparator in Fig. 2, the aim of comparing the secret qubits with the least significant qubits of RGB channels can be realized.

Fig. 2
figure 2

Three qubits comparator

Proof

Through analyzing the inputs and outputs of Fig. 2, the corresponding conclusion in proposition 1 can be obtained.

  1. (1)

    Firstly, as an example, CNOT gate is analyzed. In Fig. 3, the value of input qubits \(\left| {{c_0}{s_0}} \right\rangle \) has four circumstances \(\left| {00} \right\rangle \), \(\left| {01} \right\rangle \), \(\left| {10} \right\rangle \) and \(\left| {11} \right\rangle \). After the function of the CNOT gate, the corresponding values of the output qubit \(\left| {{o_0}} \right\rangle \) are \(\left| 0 \right\rangle \), \(\left| 1 \right\rangle \), \(\left| 1 \right\rangle \), \(\left| 0 \right\rangle \). That is to say, when \(\left| {{c_0}{s_0}} \right\rangle = \left| {00} \right\rangle \) or \(\left| {{c_0}{s_0}} \right\rangle = \left| {11} \right\rangle \), the output qubit \(\left| {{o_0}} \right\rangle = \left| 0 \right\rangle \); when \(\left| {{c_0}{s_0}} \right\rangle = \left| {01} \right\rangle \) or \(\left| {{c_0}{s_0}} \right\rangle = \left| {10} \right\rangle \), the output qubit \(\left| {{o_0}} \right\rangle = \left| 1 \right\rangle \). So, the following conclusion can be acquired:

    If \(\left| {{o_0}} \right\rangle = \left| 0 \right\rangle \), then \(\left| {{c_0}} \right\rangle = \left| {{s_0}} \right\rangle \); if \(\left| {{o_0}} \right\rangle = \left| 1 \right\rangle \), then \(\left| {{c_0}} \right\rangle \ne \left| {{s_0}} \right\rangle \).

  2. (2)

    For three qubits comparator in Fig. 2, there are three CNOT gates, which \(\left| {{c_0}} \right\rangle \), \(\left| {{c_1}} \right\rangle \), \(\left| {{c_2}} \right\rangle \), \(\left| {{s_0}} \right\rangle \), \(\left| {{s_1}} \right\rangle \) and \(\left| {{s_2}} \right\rangle \) are the input qubits and \(\left| {{o_0}} \right\rangle \), \(\left| {{o_1}} \right\rangle \), \(\left| {{o_2}} \right\rangle \) are the output states. Following the case in (1), the following conclusion about Fig. 2 is established:

    $$\begin{aligned}&\hbox {If }\left| {{o_0}} \right\rangle = \left| 0 \right\rangle ,\hbox { then } \left| {{c_0}} \right\rangle = \left| {{s_0}} \right\rangle ; if \left| {{o_0}} \right\rangle = \left| 1 \right\rangle ,\hbox { then } \left| {{c_0}} \right\rangle \ne \left| {{s_0}} \right\rangle ;\\&\hbox {If } \left| {{o_1}} \right\rangle = \left| 0 \right\rangle ,\hbox { then } \left| {{c_1}} \right\rangle = \left| {{s_1}} \right\rangle ; if \left| {{o_1}} \right\rangle = \left| 1 \right\rangle ,\hbox { then } \left| {{c_1}} \right\rangle \ne \left| {{s_1}} \right\rangle ;\\&\hbox {If } \left| {{o_2}} \right\rangle = \left| 0 \right\rangle ,\hbox { then } \left| {{c_2}} \right\rangle = \left| {{s_2}} \right\rangle ; if \left| {{o_2}} \right\rangle = \left| 1 \right\rangle ,\hbox { then } \left| {{c_2}} \right\rangle \ne \left| {{s_2}} \right\rangle .\\ \end{aligned}$$

According to (1) and (2), proposition 1 is established. That is, when the corresponding output qubit is \(\left| 0 \right\rangle \), the two qubits being compared are the same. When the corresponding output qubit is \(\left| 1 \right\rangle \), the two qubits being compared are different. \(\square \)

Fig. 3
figure 3

CNOT gate

Theorem 1

LSQb information hiding algorithm is rational for NCQI.

Proof

To prove this theorem, there are two problems needing to be solved. \(\square \)

Problem 1 Before embedding secret qubits into the least significant qubits of RGB channels (i.e. \(\left| {{R_0}} \right\rangle \), \(\left| {{G_0}} \right\rangle \), \(\left| {{B_0}} \right\rangle \)), secret qubits and \(\left| {{R_0}} \right\rangle \), \(\left| {{G_0}} \right\rangle \), \(\left| {{B_0}} \right\rangle \) should be compared.

Problem 2 The concrete unitary operators should be designed to realize the aim of embedding the secret qubits into \(\left| {{R_0}} \right\rangle \), \(\left| {{G_0}} \right\rangle \), \(\left| {{B_0}} \right\rangle \) which are the least significant qubits of the relevant pixels in the cover image.

Solution for problem 1 Obviously, from proposition 1, utilizing three qubits comparator in Fig. 2, problem 1 has a perfect solution.

Concretely speaking, secret binary qubits \(\left| {{s_i}} \right\rangle \), \(i=0,1,2\) and the qubits \(\left| {{R_0}} \right\rangle \), \(\left| {{G_0}} \right\rangle \), \(\left| {{B_0}} \right\rangle \) of the first pixel in the cover image are taken as the inputs of the quantum comparator in Fig. 2. Three comparison results between \(\left| {{s_0}} \right\rangle \) and \(\left| {{R_0}} \right\rangle \), \(\left| {{s_1}} \right\rangle \) and \(\left| {{G_0}} \right\rangle \), \(\left| {{s_2}} \right\rangle \) and \(\left| {{B_0}} \right\rangle \) are obtained, which are denoted as \(\left| {{o_0}} \right\rangle \), \(\left| {{o_1}} \right\rangle \), \(\left| {{o_2}} \right\rangle \). Through analyzing the results of the output qubits, the aim of comparing secret binary qubits \(\left| {{s_i}} \right\rangle \), \(i=0,1,2\) and the qubits \(\left| {{R_0}} \right\rangle \), \(\left| {{G_0}} \right\rangle \), \(\left| {{B_0}} \right\rangle \) is realized. Similarly, the comparisons between other secret qubits \(\left| {{s_j}} \right\rangle \), \(\left| {{s_{j+1}}} \right\rangle \), \(\left| {{s_{j+2}}} \right\rangle , j=3, 6, \cdots 3t-3 \) and \(\left| {{R_0}} \right\rangle \), \(\left| {{G_0}} \right\rangle \), \(\left| {{B_0}} \right\rangle \) of other \(t-1\) relevant pixels in the cover image can also be achieved.

Solution for problem 2 New unitary operators can be designed to achieve the secrets embedding.

Unitary operators are designed according to the comparison results. Each of the comparison results \(\left| {{o_i}} \right\rangle \) \(i=0,1,\cdots ,3t-1\) has two cases, i.e. \(\left| {{s_i}} \right\rangle = \left| {{c_0}} \right\rangle \) (the same, noted as S) and \(\left| {{s_i}} \right\rangle \ne \left| {{c_0}} \right\rangle \) (the different, noted as D), \({c=R, G, B}\). There are \(2 \times 2 \times 2 = 8\) cases for us to analyze.

  1. (1)

    If the results are S, S, S, unitary transform \(U_0\) is applied.

    $$\begin{aligned} U_0 = I^{ \otimes 3q} \otimes \left( {\sum \limits _{j = 0,}^{2^n - 1} {\sum \limits _{i = 0}^{2^n - 1} {\left| {ji} \right\rangle \left\langle {ji} \right| } } } \right) \end{aligned}$$
  2. (2)

    If the results are S, S, D, unitary transform \(U_1\) is applied.

    $$\begin{aligned} U_1 = I^{ \otimes 3q - 1} \otimes U \otimes \left| {y x } \right\rangle \left\langle {y x } \right| + I^{ \otimes 3q} \otimes \left( {\sum \limits _{j = 0,}^{2^n - 1} {\sum \limits _{i = 0,ji \ne y x }^{2^n - 1} {\left| {ji} \right\rangle \left\langle {ji} \right| } } } \right) \end{aligned}$$
  3. (3)

    If the results are S, D, S, unitary transform \(U_2\) is applied.

    $$\begin{aligned} U_2 = I^{ \otimes 2q - 1} \otimes U \otimes I^{ \otimes q} \otimes \left| {y x } \right\rangle \left\langle {y x } \right| + I^{ \otimes 3q} \otimes \left( {\sum \limits _{j = 0,}^{2^n - 1} {\sum \limits _{i = 0,ji \ne y x }^{2^n - 1} {\left| {ji} \right\rangle \left\langle {ji} \right| } } } \right) \end{aligned}$$
  4. (4)

    If the results are D, S, S, then unitary transform \(U_3\) is applied.

    $$\begin{aligned} U_3 = I^{ \otimes q - 1} \otimes U \otimes I^{ \otimes 2q} \otimes \left| {y x } \right\rangle \left\langle {y x } \right| + I^{ \otimes 3q} \otimes \left( {\sum \limits _{j = 0,}^{2^n - 1} {\sum \limits _{i = 0,ji \ne y x }^{2^n - 1} {\left| {ji} \right\rangle \left\langle {ji} \right| } } } \right) \end{aligned}$$
  5. (5)

    If the results are S, D, D, then unitary transform \(U_4\) is applied.

    $$\begin{aligned} U_4= & {} I^{ \otimes 2q - 1} \otimes U \otimes I^{ \otimes q - 1} \otimes U \otimes \left| {y x } \right\rangle \left\langle {y x } \right| \\&+ I^{ \otimes 3q} \otimes \left( {\sum \limits _{j = 0,}^{2^n - 1} {\sum \limits _{i = 0,ji \ne yx }^{2^n - 1} {\left| {ji} \right\rangle \left\langle {ji} \right| } } } \right) \end{aligned}$$
  6. (6)

    If the results are D, D, S, then unitary transform \(U_5\) is applied.

    $$\begin{aligned} U_5= & {} I^{ \otimes q - 1} \otimes U \otimes I^{ \otimes q - 1} \otimes U \otimes I^{ \otimes q} \otimes \left| {y x } \right\rangle \left\langle {y x } \right| \\&+ I^{ \otimes 3q} \otimes \left( {\sum \limits _{j = 0,}^{2^n - 1} {\sum \limits _{i = 0,ji \ne y x }^{2^n - 1} {\left| {ji} \right\rangle \left\langle {ji} \right| } } } \right) \end{aligned}$$
  7. (7)

    If the results are D, S, D, then unitary transform \(U_6\) is applied.

    $$\begin{aligned} U_6= & {} I^{ \otimes q - 1} \otimes U \otimes I^{ \otimes q} \otimes I^{ \otimes q - 1} \otimes U \otimes \left| {y x } \right\rangle \left\langle {y x } \right| \\&+ I^{ \otimes 3q} \otimes \left( {\sum \limits _{j = 0,}^{2^n - 1} {\sum \limits _{i = 0,ji \ne y x }^{2^n - 1} {\left| {ji} \right\rangle \left\langle {ji} \right| } } } \right) \end{aligned}$$
  8. (8)

    If the results are D, D, D, then unitary transform \(U_7\) is applied.

    $$\begin{aligned} U_7= & {} I^{ \otimes q - 1} \otimes U \otimes I^{ \otimes q - 1} \otimes U \otimes I^{ \otimes q - 1} \otimes U \otimes \left| {y x } \right\rangle \left\langle {y x } \right| \\&+ I^{ \otimes 3q} \otimes \left( {\sum \limits _{j = 0,}^{2^n - 1} {\sum \limits _{i = 0,ji \ne y x }^{2^n - 1} {\left| {ji} \right\rangle \left\langle {ji} \right| } } } \right) \end{aligned}$$

    where \(U = \left[ {\begin{array}{*{20}c} 0 &{} \ 1 \\ 1 &{} \ 0 \\ \end{array}} \right] \).

Whether the above unitary operators truly realize the aim of hiding secret qubits should be proven. In the following proof, unitary operator \(U_1\) corresponding to one of the result S, S, D is taken as an example to analyze.

$$\begin{aligned}&U_1 \left( {\left| {I} \right\rangle } \right) \nonumber \\&= I^{ \otimes 3q - 1} \otimes U \otimes \left| {yx} \right\rangle \left\langle {yx} \right| + I^{ \otimes 3q} \otimes \left( {\sum \limits _{j = 0,}^{2^n - 1} {\sum \limits _{i = 0,ji \ne y x }^{2^n - 1} {\left| {ji} \right\rangle \left\langle {ji} \right| } } } \right) \left( {\left| {I} \right\rangle } \right) \nonumber \\&= I^{ \otimes 3q - 1} \otimes U \otimes \left| {yx} \right\rangle \left\langle {yx} \right| + I^{ \otimes 3q} \otimes \left( {\sum \limits _{j = 0,}^{2^n - 1} {\sum \limits _{i = 0,ji \ne y x }^{2^n - 1} {\left| {ji} \right\rangle \left\langle {ji} \right| } } } \right) \nonumber \\&\quad \left( {\frac{1}{{ {2^{n} } }}\sum \limits _{y = 0}^{2^n - 1} {\sum \limits _{x = 0}^{2^n - 1} {\left| {c\left( {y ,x } \right) } \right\rangle } } \otimes \left| {y x } \right\rangle } \right) \nonumber \\&= I^{ \otimes 3q - 1} \otimes U \otimes \left| {yx} \right\rangle \left\langle {yx} \right| + I^{ \otimes 3q} \otimes \left( {\sum \limits _{j = 0,}^{2^n - 1} {\sum \limits _{i = 0,ji \ne y x }^{2^n - 1} {\left| {ji} \right\rangle \left\langle {ji} \right| } } } \right) \nonumber \\&\quad \left( {\frac{1}{{ {2^{n} } }}\sum \limits _{y = 0}^{2^n - 1} {\sum \limits _{x = 0}^{2^n - 1} {\left| {R_{q - 1} \cdots R_0 G_{q - 1} \cdots G_0 B_{q - 1} \cdots B_0 } \right\rangle } } \otimes \left| {y x } \right\rangle } \right) \nonumber \\&= \frac{1}{{ {2^{n} } }}\sum \limits _{j = 0}^{2^n - 1} {\sum \limits _{i = 0, ji \ne y x}^{2^n - 1} {\left| {R_{q - 1} \cdots R_0 G_{q - 1} \cdots G_0 B_{q - 1} \cdots {B_0 }} \right\rangle } } \otimes \left| {j i } \right\rangle \nonumber \\&\quad +{\left| {R_{q - 1} \cdots {R_0 } G_{q - 1} \cdots G_0 B_{q - 1} \cdots \overline{B}_0} \right\rangle } \otimes \left| {y x } \right\rangle \end{aligned}$$
(3)

where

$$\begin{aligned} \left| {\overline{B_0 }} \right\rangle = \left\{ \begin{array}{l} \left| \mathrm{{1}} \right\rangle \mathrm{{, }}\left| {B_0 } \right\rangle = \left| 0 \right\rangle \\ \left| \mathrm{{0}} \right\rangle \mathrm{{, }}\left| {B_0 } \right\rangle = \left| 1 \right\rangle \\ \end{array} \right. \end{aligned}$$

Obviously, from the above result, the function of the unitary operator \(U_1 \) is just changing least significant blue qubit \(\left| {B_0 } \right\rangle \) of the relevant pixel \(\left| {yx} \right\rangle \) into \( \left| {\overline{B_0 }} \right\rangle \). It does not change color information of other pixels. Again, the other two secret qubits are respectively equal to \(\left| {R_0 } \right\rangle \) and \(\left| {G_0 } \right\rangle \), so they can also be regarded as being embedded into the least significant qubits \(\left| {R_0 } \right\rangle \) and \(\left| {G_0 } \right\rangle \) of the cover image. Other cases can also be proven in a similar way. From the above explanations, problem 2 is solved.

Once solving problem 1 and problem 2, theorem 1 is established. Since in order to realize the aim of embedding 3t secret qubits, it just needs to divide the secret qubits into t groups, then execute t times comparator and t times unitary operator.

Note 1 It should be noted that when executing comparator once, three secret qubits are compared.

Note 2 We should note that when performing unitary operator once, three secret qubits are embedded into cover image.

4 LSQb information hiding method of NCQI

In this section, LSQb algorithm of NCQI is proposed by employing the three qubits comparator and unitary operators proposed in Sect. 3, which hides the secret qubits stream into the LSQb of RGB channels in the cover image.

4.1 LSQb information hiding algorithm

LSQb information hiding method rooted in NCQI is described in details as in the following steps.

  • Step 1 Comparing the secret qubits \({s_0}, {s_1},{s_2}\) with the three least significant qubits \({R_0}, {G_0},{B_0}\) of the first pixel in the original cover image. Utilizing the three qubits comparator in Fig. 2, secret qubits \({s_0}, {s_1},{s_2}\) and the last three qubits \(R_0\), \(G_0\), \(B_0\) is compared sequentially. Comparison results from the comparator are denoted as \(o_0, o_1, o_2\), respectively.

  • Step 2 LSQb information hiding. According to the values of \(o_0\), \(o_1\) and \(o_2\), one of the unitary operators from the set \(\left\{ {U_0 ,U_1 ,U_2 ,U_3 ,U_4 ,U_5 ,U_6 ,U_7 } \right\} \) is chosen to operate on the original cover image state \(\left| {I} \right\rangle \) to realize the aim of embedding the first three secret qubits.

  • Step 3 Repeating Step 1 and Step 2 t times. In the beginning, the length of the secret binary qubits \({s_{0}},{s_{1}} \cdots {s_{3t-2}},{s_{3t-1}}\) is supposed as 3t. In order to complete the task of embedding all secret binary qubits, it is necessary to repeat Step 1 t times to execute 3t times comparison and step 2 t times to hide 3t secret qubits. Since the secret qubits have been divided into t groups and every group has 3 qubits. Obviously, in this process, t relevant pixels in the cover image are used. Applying unitary transform \(\prod \nolimits _{i = 1}^t {T_i }\) on the state \(\left| {I} \right\rangle \) can realize the goal of information hiding. Operator \(T_i\), which is in the set \(\left\{ {U_0 ,U_1 ,U_2 ,U_3 ,U_4 ,U_5 ,U_6 ,U_7 } \right\} \), is decided by the output values of the comparator.

Note 3 The length of secret binary qubits can always be supposed as 3t, \(t \le 2^{2n}\). If secret binary qubits’ length is less than 3t, it can be increased to 3t by using the same least significant color qubits of relevant pixels in the original image.

Figure 4 shows the quantum circuit of LSQb information hiding algorithm. It can be seen that after the function of the unitary operators \(T_i\), \(i=1 \cdots t\), the LSQb-embedded quantum image is obtained.

Fig. 4
figure 4

Quantum circuit of information hiding algorithm

4.2 LSQb information extraction algorithm

Secret binary qubits stream can be accurately extracted by using control-swap gates.

  • Step 1 Separately extracting the last qubits of three channels RGB corresponding to t relevant pixels. All the extracted qubits constitute sequentially the secret binary qubits stream.

Figure 5 describes the quantum circuit of extracting the secret qubits stream. When extracting the secrets, the extraction order in terms of cover image is from left to right and from top to bottom. That is, the control qubits in Fig. 5 is set from the natural number 0 until the beginning of coding sequence of natural number \(t-1\).

Fig. 5
figure 5

Quantum circuit of extracting secret qubits stream

Original quantum image can also be recovered in a lossless manner. Applying \(\prod \nolimits _{i = 1}^t {T_i^\dag }\) on the embedded image, the original quantum image \(\left| {I} \right\rangle \) can be recovered accurately, where \(T_i^\dag \) is the conjugate transpose of \(T_i\). Obviously, all transforms \(T_i\), \(i = 1, \ldots , t \) used in information hiding algorithm are reversible, so \(T_i^\dag \) is meaningful. Figure 6 describes the quantum circuit of recovering the original quantum cover image.

Fig. 6
figure 6

Quantum circuit of recovering the cover image

In all, LSQb information hiding algorithm is designed based on the three qubits comparator and the unitary operator. Obviously, the algorithm is absolutely blind because the extraction procedure does not need the original cover image. The whole procedure of information extracting, which only needs control-swap gates, does not need any quantum measurement operation or any other help from classical computer. Figure 7 describes the whole framework of LSQb information hiding algorithm.

Fig. 7
figure 7

Framework of information hiding algorithm

4.3 Computational complexity

In quantum image processing, the circuit’s complexity depends on what is considered to be an elementary gate. Generally, CNOT gate is chosen as a basic unit. For the LSQb information hiding algorithm, due to the properties of quantum parallel computation, the utilization of quantum transforms speeds up the information hiding and extraction. The computational complexity of the information hiding algorithm depends on three qubits comparator and unitary operator \({T_i }\).

Three qubits comparator consists of three CNOT gates. So the quantum comparator’s complexity is no more than \(O\left( 3 \right) \). Unitary operator \({T_i }\) can be regarded as almost a 2n-control-NOT gate. Reference [33] has pointed out that a t -control-qubit-NOT gate is equivalent to \(2(t-1)\) Toffoli gates \(+\) 1 CNOT gate. Again, one Toffoli gate can be constructed by 6 CNOT gates. So the complexity of the unitary operator \({T_i }\) is \(O\left( {2\left( {2n - 1} \right) \cdot 6 + 1} \right) \), i.e. \(O\left( {24n - 11} \right) \).

In step 1, quantum comparator is carried out one time, so its complexity is O(3). In step 2, unitary transform \({T_i}\) is operated on the original quantum image, so the complexity is near \(O\left( 24n-11\right) \). In step 3, step 1 and step 2 are repeated t times. So the complexity of our algorithm is \(O\left( {(24n-8)t} \right) \). The complexity is linear to the length 3t of the secret binary qubits stream (\((24n-8)t = \frac{{24n - 8}}{3} \cdot 3t\)), which to some extent shows the feasibility of the proposed LSQb information hiding scheme.

4.4 Example

In order to understand LSQb scheme clearly, one specific circuit is given as another application example of our presented idea.

Fig. 8
figure 8

A \(2 \times 2\) color digital image

For example, there is a color digital image sized \(2 \times 2\), which is shown in Fig. 8. The NCQI representation of Fig. 8 can be expressed as the following form \(\left| {I\left( \theta \right) } \right\rangle \).

$$\begin{aligned}&\left| {I(\theta )} \right\rangle \\&\quad = \frac{1}{{\sqrt{{2^2}} }}\left[ {\left| {\underbrace{11111111}_R\underbrace{00000000}_G\underbrace{00000000}_B} \right\rangle } \right. \otimes \left| {00} \right\rangle \\&\quad +\left| {\underbrace{00000000}_R\underbrace{11111111}_G\underbrace{00000000}_B} \right\rangle \otimes \left| {01} \right\rangle \\&\quad + \left| {\underbrace{00000000}_R\underbrace{00000000}_G\underbrace{11111111}_B} \right\rangle \otimes \left| {10} \right\rangle \\&\quad \left. { + \left| {\underbrace{11111111}_R\underbrace{11111111}_G\underbrace{11111111}_B} \right\rangle \otimes \left| {11} \right\rangle } \right] \end{aligned}$$

Suppose the binary secret qubits stream has the form 000011100110. Obviously, the least significant qubits of three channels are 100010001111. Then we have:

$$\begin{aligned}&{s_0} \ne {c_0},{s_1} = {c_1},{s_2} = {c_2},{s_3} = {c_3},{s_4} = {c_4},{s_5} \ne {c_5},\\&{s_6} \ne {c_6},{s_7} \ne {c_7},{s_8} = {c_8},{s_9} = {c_9},{s_{10}} = {c_{10}},{s_{11}} \ne {c_{11}} \end{aligned}$$

Qubits \({s_i}\) and \({c_i}\), \(i = 0, \cdots 11\) are corresponding to secret qubits and least significant qubits, respectively.

Following the proposed algorithm, the unitary operators \({U_1},{U_2},{U_3}\) and \({U_4}\) are designed as the following form.

$$\begin{aligned} {U_1}= & {} {I^{ \otimes 7}} \otimes U \otimes {I^{ \otimes 16}} \otimes \left| {00} \right\rangle \left\langle {00} \right| + {I^{ \otimes 24}} \otimes \sum \limits _{j = 0}^1 {\sum \limits _{i = 0,ji \ne 00}^1 {\left| {ji} \right\rangle \left\langle {ji} \right| } } \\ {U_2}= & {} {I^{ \otimes 23}} \otimes U \otimes \left| {01} \right\rangle \left\langle {01} \right| + {I^{ \otimes 24}} \otimes \sum \limits _{j = 0}^1 {\sum \limits _{i = 0,ji \ne 01}^1 {\left| {ji} \right\rangle \left\langle {ji} \right| } } \\ {U_3}= & {} {I^{ \otimes 7}} \otimes U \otimes {I^{ \otimes 7}} \otimes U \otimes {I^{ \otimes 8}} \otimes \left| {10} \right\rangle \left\langle {10} \right| + {I^{ \otimes 24}} \otimes \sum \limits _{j = 0}^1 {\sum \limits _{i = 0,ji \ne 10}^1 {\left| {ji} \right\rangle \left\langle {ji} \right| } } \\ {U_4}= & {} {I^{ \otimes 23}} \otimes U \otimes \left| {11} \right\rangle \left\langle {11} \right| + {I^{ \otimes 24}} \otimes \sum \limits _{j = 0}^1 {\sum \limits _{i = 0,ji \ne 11}^1 {\left| {ji} \right\rangle \left\langle {ji} \right| } } \end{aligned}$$

After the function of the operators \({U_1},{U_2},{U_3}\) and \({U_4}\), the original quantum cover image evolves into the quantum image \({\left| {I\left( \theta \right) } \right\rangle _{emb}}\).

$$\begin{aligned}&{\left| {I(\theta )} \right\rangle _{emb}}\\&= \frac{1}{{\sqrt{{2^2}} }}\left[ {\left| {\underbrace{11111110}_R\underbrace{00000000}_G\underbrace{00000000}_B} \right\rangle } \right. \otimes \left| {00} \right\rangle \\&\quad + \left| {\underbrace{00000000}_R\underbrace{11111111}_G\underbrace{00000001}_B} \right\rangle \otimes \left| {01} \right\rangle \\&+ \left| {\underbrace{00000001}_R\underbrace{00000000}_G\underbrace{11111110}_B} \right\rangle \otimes \left| {10} \right\rangle \\&\quad \left. { + \left| {\underbrace{11111111}_R\underbrace{11111111}_G\underbrace{11111110}_B} \right\rangle \otimes \left| {11} \right\rangle } \right] \end{aligned}$$

Obviously, from the form \({\left| {I\left( \theta \right) } \right\rangle _{emb}}\), it can be seen that the secret qubits have been embedded into the cover image. Also, the extracting quantum circuit can be depicted in Fig. 9 according to the proposed algorithm.

Fig. 9
figure 9

Quantum circuit of extracting secret qubits for the example

5 Simulation and analysis

In this section, several analysis in terms of visual quality, capacity, comparison with other works and quantum measurement on the outcome are introduced. Since a practical and useful quantum computer is unavailable, the simulations of the quantum circuit and algorithm are executed on a classical computer equipped with software MATLAB. Simulations are based on the MATLAB 7.12.

5.1 Visual quality

The peak-signal-to-noise (PSNR) is one of the most used indictor for comparing the fidelity of a stego-image with its original version. PSNR is defined as the following form

$$\begin{aligned} PSNR= & {} 20\log _{10} \left( {\frac{{MAX_I }}{{\sqrt{MSE} }}} \right) \\ MSE= & {} \frac{1}{{mn}}\sum \limits _{i = 0}^{m - 1} {\sum \limits _{j = 0}^{n - 1} {\left[ {I\left( {i,j} \right) - J\left( {i,j} \right) } \right] ^2 } } \end{aligned}$$

where I and J are two different gray images, \({MAX_I }\) is the maximum pixel of image I. In our algorithm, I and J correspond to the original image and the stego-image, respectively.

PSNR is inversely proportional to MSE. Actually, MSE can be deemed as a ratio of the number of pixels that has been changed during the embedding process. It is independent with the size of cover image.

Since our algorithm is a LSB-based algorithm, if a pixel’s LSB qubit is the same as the message bit it accommodates, \({\left[ {I\left( {i,j} \right) - J\left( {i,j} \right) } \right] ^2 }=0\). Suppose \({MAX_I =255}\) for 8-bit natural image and \(MSE = 0.5\), that means half of the pixels is changed, then

$$\begin{aligned} PSNR = 20\log _{10} \left( {\frac{{255}}{{\sqrt{0.5} }}} \right) = 51.1411 \end{aligned}$$

Even if every pixel is changed, i.e. MSE=1, PSNR still can reach 48.1308 dB.

Some simulation examples are shown in Fig. 10, where (a)–(d) with \(256 \times 256\) and (e) ”message” with \(256 \times 256\) are used as the carrier and the secret image, respectively. The visual quality of the embedded images is obtained in Table 1. It can be seen that the PSNR is around 51 dB, which indicates that the invisibility of our scheme is good.

Fig. 10
figure 10

Simulation examples by LSQb algorithm of color digital images. ad are four cover images and e is message. fi are four embedded images

Table 1 PSNR value of the simulation results

5.2 Capacity

Steganography capacity is defined as the ratio between the number of message bits and the number of cover pixels. Therefore, the capacity of the proposed algorithm is

$$\begin{aligned} C = \frac{\hbox {The number of message qubits}}{\hbox {The number of cover image's pixels}} = \frac{{3t}}{{2^{2n} }}\left( {bit/pixel} \right) \end{aligned}$$
(4)

From Eq.  (4), it can be seen that the capacity is proportional to the length of secret binary qubits stream. The maximum of capacity can be reached at 3 bit/pixel when \(t = 2^{2n} \).

5.3 Comparison analysis

In this section, our work and the Ref. [31] are compared, especially pointing out the differences between them.

The feasibility of LSQb information hiding algorithm based on NEQR was presented in [31]. However, the discussion and focus of this paper is on the reasonability and feasibility of LSQb hiding algorithm rooted in NCQI, and the major contribution of our work lies in the designment of unitary operators.

To show the novelty and advantage of our idea, the proposed scheme is compared with the related scheme, especially [31]. Analysis of the differences is given mainly from the following aspects.

The first important distinguish is that these two schemes focus on two entirely different research targets, i.e., NEQR and NCQI. NEQR can only represent gray image, while NCQI can represent color image. So these two schemes will be applied into different fields.

In classical digital image processing, some gray image processing algorithms can be directly applied into the color digital image. However, in quantum image processing, gray image processing algorithms cannot be directly applied into the color digital image. We have to design different methods for the realization of LSQb for NEQR and NCQI.

In [31], the specific LSQb information hiding algorithm based on NEQR is given through constructing the unitary operators \({u_i},i = 0,1, \cdots {2^{2n}} - 1\), which can realize the aim of embedding secret qubits into the least significant qubit of gray information.

$$\begin{aligned} {u_i} = {I^{ \otimes q - 1}} \otimes U \otimes \left| i \right\rangle \left\langle i \right| + {I^{ \otimes q}} \otimes \left( {\sum \limits _{j = 0,j \ne i}^{{2^{2n}} - 1} {\left| j \right\rangle \left\langle j \right| } } \right) \end{aligned}$$

The paper offers a novel method for the realization of LSQb information hiding of NCQI. In our work, to achieve the aim of embedding secret qubits into the least significant qubits of three channels RGB, the different unitary operators, which can be seen in Sect. 3, are constructed based on analyzing the color encoding form of NCQI. In addition, the novel three qubits comparator is designed instead of using one qubit comparator in [31].

In a word, the entirely different unitary operators, which are of significance in the aspect of directing the construction of the information embedding algorithm, are the second difference and determine our work is not similar to the work [31]. Since the most important work in quantum image processing lies in designing the unitary operators, then the corresponding quantum circuits can be given.

Except the differences in the secrets embedding process between our work and [31], that is, the entirely different unitary operators described in Sect. 3. There is another obvious distinction between these two works. In the process of extracting the secret qubits, in [31], we need to decompose the quantum embedded image state into the basis states, which is a complex work. However, in our proposed work, it only needs to use the control-swap gates to exchange the secret qubits with the ancillary qubits \(\left| 0 \right\rangle \). Compared with [31], this is our obvious advantage.

Finally, we should point out that our work is not the extension of the work in [31]. From the above descriptions, there are clear differences between the two works. The two works research two different objects and show two distinct ultimate information embedding algorithm and extraction algorithm, then finally can be applied into different fields.

5.4 Analysis of quantum measurement on the outcome

The impact of quantum measurement on the outcome is analyzed in this section.

When designing a quantum image processing algorithm, the authors generally consider the measurement in the final step, i.e., quantum simulation, which converts the quantum information into the classical information in form of probability distributions.

In the designment of the whole LSQb information hiding and extracting algorithm, there is no quantum measurement operation. However, the projective measurement is used in the final step of quantum simulation. The final step in quantum simulation is the measurement which converts the quantum information into the classical information in form of probability distributions, i.e., it converts a single qubit state \(\left| \Psi \right\rangle = \alpha \left| 0 \right\rangle + \beta \left| 1 \right\rangle \) into a probability classical bit M (distinguished from a qubit by drawing it as a double-line wire), which is 0 with probability \({\left| \alpha \right| ^2}\), or 1 with probability \({\left| \beta \right| ^2}\) as shown in Fig. 11.

Fig. 11
figure 11

Quantum circuit symbol for measurement

In practice, the quantum state cannot be practically observed in quantum system because the measurement will destroy the superposition. And what’s worse is that, it is not allowed to make copies of the state and measure each one due to the Non-Cloning theorem. Hence, it is necessary to repeat the construction of the embedded image state n times \(\left( {n > 1} \right) \), and measure each one to summarize the measurement results from which we can estimate the embedded image.

Measurement results on the embedded image sized \({2^n} \times {2^n}\) find a value in the set \(\left\{ {{s_1},{s_2}, \cdots {s_{{2^{2n + 3q}}}}} \right\} \), which \({s_i}, i = 1,2 \cdots {2^{2n + 3q}}\) are basis states in \({2^{2n + 3q}}\) dimension Hilbert space. After multiple measurements, these basis states follow a probability distribution. The measurement will be continued until the probability of every basis state stabilized at a fixed value. According to law of large numbers, there is a limit for these basis states. The block diagram of measurement procedure on quantum computer is shown in Fig. 12.

Fig. 12
figure 12

Block diagram of measurement procedure on quantum computers

6 Conclusion

In this paper, a LSQb information hiding algorithm is proposed for quantum image model NCQI. The proposed method constructs a LSQb-embedded image and mainly contains two steps: (1) qubits comparison and (2) qubits embedding. In the qubits comparison step, the designed three qubits comparator is utilized to compare the secret qubits with three least significant qubits of RGB channels of one pixel in the cover image. In the qubits embedding step, eight types of unitary operators are constructed, but it should be noted that which kind of unitary operators should be acted on the cover image. These unitary operators are decided by the output qubits of the comparator. When extracting the secret qubits, control-swap gates are used instead of introducing quantum measurement. So our algorithm has at least two advantages: (1) the algorithm is absolutely blind since the extracting procedure does not need the original cover image. (2) The whole procedure of information extraction does not need any quantum measurement operation or any other help from classical computer. Complexity analysis, simulation results and comparison analysis with other work show that the proposed LSQb information hiding algorithm has good performance. Designing other quantum image steganography algorithms, especially LSQb-based algorithms, is our future work.