1 Introduction

Since the presentation of the first quantum key distribution protocol by Bennett and Brassard in 1984 [1], quantum information and quantum computation have spurred a number of theoretical and practical research. Recent research on quantum computation and quantum information allowed to use it in applications related to information security in real life [214].

New improvements in the field make it possible to represent and processes classical media using quantum point of view [1533].

In 2011, a Flexible Representation for Quantum Images (FRQI) was proposed by Phuc, Fangyan Dong and Kaoru Hirota [24]. The FRQI, is similar to the pixel representation for images on traditional computers, it captures the essential information about the colors as well as the corresponding positions of every point in an image and integrates them into a quantum state. In 2013, Zhang, Lu, Gao and Wang proposed a novel enhanced quantum representation (NEQR) for digital images using the basis state of a qubit sequence to store the gray scale value of every pixel instead of an angle encoded in a qubit in the FRQI method [25]. Therefore, to store the digital image in NEQR scheme, two entangled qubit sequences are used to store the whole image, which represent the gray scale and positional information of all the pixels.

Due to advances in Information and Communications Technology (ICT), most of information is kept electronically. Digital representation of media facilitates access and potentially improves the portability, efficiency, and accuracy of the information presented. Undesirable effects of facile data access include an increased opportunity for violation of copyright and tampering with or modification of content, Consequently, the security of information has become a fundamental issue. Generally, information hiding, i.e., watermarking and steganography can be considered as efficient tools for protecting digital information from above mentioned undesirable effects. Up to now there are many quantum data hiding and quantum watermarking schemes presented [3442].

In 2010 Z.G. Qu et al. proposed a novel quantum steganography protocol based on quantum secure direct communication where, employing entanglement swapping of Bell states, secret messages are transmitted in a hidden channel within the improved Ping-Pong protocol [34]. Quantum steganography protocols with noisy quantum channels where proposed by B. A. Shaw et al. [35], where two types of protocols were considered. In the first one the hidden quantum information was stored locally in the codeword, and in the second type of protocols the hidden quantum information was embedded in the space of error syndromes. In 2012, N. Fatahi and M. Naseri [36] proposed a secure quantum watermarking using entanglement swapping is proposed. In [36] using the entanglement swapping a hidden layer of secure message under the conventional first layer of secure information sequence is build up. Later, in 2013, a quantum images watermarking strategy is proposed based on flexible representation for quantum images (FRQI) [37]. Also another quantum image watermarking strategy was proposed by W .W. Zhang et al., in 2013. In the protocol proposed by W. W. Zhang et al., watermark image is embedded into the fourier coefficients of the quantum carrier image, in which the carrier images will not be visually affected by the watermark images [38]. Afterwards, X. Song et al. proposed a dynamic watermarking scheme for quantum images based on Hadamard transform [39]. Recently, a novel multi-party quantum steganography protocol based on quantum secret sharing is proposed by L. Liu et al. [40]. Very Recently, a blind LSB steganography in the form of quantum circuits have been proposed by N. Jiang et al. [41]. The proposed LSB based quantum steganography algorithms are based on the novel enhanced quantum representation (NEQR) for quantum images. The first algorithm is plain LSB in which the pixels LSB are substituted by message bits directly. The second algorithm is block LSB in which a message bit is embedded into a number of pixels that belong to one image block [41].

In this paper a novel LSB based quantum watermarking protocol is proposed. In the presented scheme using a quantum representation of digital images, a m-bit embedding key K 1 and m-bit extracting key K 2 a m-pixel gray scale image is embedded in and extracted from a m-pixel carrier image. This paper is organized as follows: The next section introduces the novel enhanced quantum representation of digital images (NEQR protocol) proposed by and LSB based quantum image steganography algorithm. Our proposed protocol for quantum watermark is presented in Section 3. Section 4 presents the software simulation of the protocol. Finally, a short conclusion is given in Section 5.

2 The Least Significant Bit (LSB) Based Quantum Image Steganography Algorithm

A Novel Enhanced Quantum Representation of digital images (NEQR protocol) was proposed in 2013 [23]. According to the NEQR protocol, a quantum image can be represented as follows:

$$ |I\rangle=\frac{1}{2^{n}}\sum\limits^{2^{2n}-1}_{i=0}|c_{i}\rangle\otimes|i\rangle, $$
(1)
$$|c_{i}\rangle=|c^{q-1}_{i}...{c^{1}_{i}}{c^{0}_{i}}\rangle,{c_{i}^{k}}\in\{0,1\},k=q-1,...,1,0, i=0,1,...,2^{2n}-1. $$

The two parts in the NEQR protocol, |c i 〉 and |i〉 encode information about the color and their corresponding positions in the image, respectively. In this view, the size of the quantum image is 2n×2n. Where, the location information |i〉 includes two parts: the vertical and the horizontal parts,

$$ |i\rangle=|y\rangle|x\rangle=|y_{n-1},y_{n-2}...y_{0}\rangle|x_{n-1},x_{n-2}...x_{0}\rangle, y_{j}x_{j}\in\{0,1\}, $$
(2)

It encodes the first n-qubit |y n−1〉,|y n−2〉,...,|y 0〉 along the vertical location and the second n-qubit |x n−1〉,|x n−2〉,...,|x 0〉 along the horizontal axis. Therefore, NEQR needs q + 2n qubits to represent a 2n×2n image with gray range 2q.

Based on NEQR protocol, a least significant bit (LSB) based quantum image steganography algorithm has been recently proposed Nan Jiang et al., [11], where by using a LSB embedding circuit a binary 2n×2n image message |M〉 is embedded in a 2n×2n cover image |I〉 with gray range 2r. Also, a extracting circuit has been presented for extracting the embedded image.

The NEQR representation of the cover image |I〉 and the message image |M〉 can be written as below:

$$ |I\rangle=\frac{1}{2^{n}}\sum\limits^{2^{2n}-1}_{i=0}|c_{i}\rangle\otimes|i\rangle, $$
(3)
$$|c_{i}\rangle=|c^{r-1}_{i}...{c^{1}_{i}}{c^{0}_{i}}\rangle,{c_{i}^{k}}\in\{0,1\},k=r-1,...,1,0, i=0,1,...,2^{2n}-1. $$
$$|i\rangle=|y\rangle|x\rangle=|y_{n-1},y_{n-2}...y_{0}\rangle|x_{n-1},x_{n-2}...x_{0}\rangle, y_{j},x_{j}\in\{0,1\} $$
$$ |M\rangle=\frac{1}{2^{n}}\sum\limits^{2^{2n}-1}_{i=0}|m_{i}\rangle\otimes|i\rangle, m_{i}\in\{0,1\}, i=0, 1, ..., 2^{2n}-1. $$
(4)

In the circuit of plain LSB embedding, 2n CNOT gates are used to test whether the position information of |I〉 and |M〉 is the same. If they are equal, the least significant bit \(|{c_{i}^{0}}\rangle \) of |I〉 and the message bit |m i 〉 will be swaped to get the stego image.

In the extracting circuit 2n Hadamard gates are employed to turn the initial all |0〉 state to an empty binary image. Afterwards, using 2n CNOT gates, if the position information of |I〉 and |M〉 is equal, the least significant bit \(|{c_{i}^{0}}\rangle \) of |I〉 and the message bit |m i 〉 will be swaped to get the message [20].

3 A Novel Quantum Watermark Based on LSB

Considering the least significant bit (LSB) based quantum image steganography algorithm, a protocol for quantum LSB based quantum watermarking is proposed, where, for the aim of copyright prove, a watermark image |W〉 is embedded into a carrier image |C〉. Now let us present the protocol for LSB quantum based watermarking.

According to NEQR scheme, the carrier image |C〉 and the watermark image |W〉 can be written as below:

$$ |C\rangle=\frac{1}{2^{n}}\sum\limits^{2^{2n}-1}_{i=0}|c_{i}\rangle\otimes|i\rangle, $$
(5)
$$|c_{i}\rangle=|c^{r-1}_{i}...{c^{1}_{i}}{c^{0}_{i}}\rangle,{c_{i}^{k}}\in\{0,1\},k=r-1,...,1,0, i=0,1,...,2^{2n}-1. $$
$$ |W\rangle=\frac{1}{2^{n}}\sum\limits^{2^{2n}-1}_{i=0}|w_{i}\rangle\otimes|i\rangle, w_{i}\in\{0,1\}, i=0, 1, ..., 2^{2n}-1, $$
(6)

where:

$$|i\rangle=|y\rangle|x\rangle=|y_{n-1},y_{n-2}...y_{0}\rangle|x_{n-1},x_{n-2}...x_{0}\rangle,|y_{j}x_{j}\rangle\in\{0,1\}. $$

The LSB quantum based watermarking protocol includes two procedures, the embedding Procedure and the extracting one. A simple outline for the embedding procedure and the extracting procedure in our schema is given in Fig. 1a and b respectively.

Fig. 1
figure 1

The outline of the embedding procedure and the extracting procedure

In the proposed protocol, two image key: |K1〉 and |K2〉 is considered as embedding key and extracting key respectively, i.e., |K1〉 is a 2n×2n binary image embedding key that the embedder used this for watermarking. while |K2〉 is an other 2n×2n binary image extracting key that is generated during the embedding procedure. In NEQR view, |K1〉 and |K2〉 can be represented as follows:

$$|K1\rangle=\frac{1}{2^{n}}\sum\limits^{2^{2n}-1}_{i=0}|K1_{i}\rangle\otimes|i\rangle, $$
$$ |K2\rangle=\frac{1}{2^{n}}\sum\limits^{2^{2n}-1}_{i=0}|K2_{i}\rangle\otimes|i\rangle, $$
(7)

where:

$$K1_{i}\in\{0,1\}, K2_{i}\in\{0,1\}. $$
$$|i\rangle=|y\rangle|x\rangle=|y_{n-1},y_{n-2}...y_{0}\rangle|x_{n-1},x_{n-2}...x_{0}\rangle,|y_{j}x_{j}\rangle\in\{0,1\}. $$

The embedding procedure and the extracting procedure can be presented as follows:

3.1 The Embedding Procedure

The embedding procedure of the proposed protocol can be accomplished in two steps:

  1. 1.

    Preparation step:

    1. (a)

      If the size of watermark image is less than that of carrier image, it should be polished to the size of carrier image. i.e., the watermark image is covered by the carrier one. In other terms, the area in watermark image corresponding to the exposed region in carrier image is filled out with the corresponding pixels in the carrier image; by doing so, the watermark image would be the same size as the carrier image.

    2. (b)

      In the proposed protocol, to improve the power to resist invalid attack and accordingly enhance the security, prior to the embedding procedure, the watermark image has to be scrambled [the image scrambling transforms a meaningful image into a meaningless or disordered image].

      Suppose that the watermark image is binary 2n×2n with color range 21. This means colors in watermark image are 0 or 1 (white or black). In the NEQR representation, the watermark image is represented as below:

      $$|W\rangle=\frac{1}{2^{n}}\sum\limits^{2^{2n}-1}_{i=0}|w_{i}\rangle\otimes|i\rangle, w_{i}\in\{0,1\}, i=0, 1, ..., 2^{2n}-1, $$
      $$ |i\rangle=|y\rangle|x\rangle=|y_{n-1},y_{n-2}...y_{0}\rangle|x_{n-1},x_{n-2}...x_{0}\rangle, y_{j}, x_{j}\in\{0,1\}, $$
      (8)

      where, |w i 〉 is color information in position |i〉. Here the image-scrambling method renders the image content unintelligible based on the keys only known to the operator.Consider a 2n×2n image, and two 2n-bit keys M={M(1),M(2),...,M(2n)} and N={N(1),N(2),...,N(2n)}. For scrambling, assume M(i) and N(j) are the ith and jth bits of M, N keys respectively. If \(M(i)\bigoplus N(j)=1\), then the color value at position (i,j) of watermark image is applied by the I operation; otherwise, the color value at position (i,j) of watermark image is applied by the X operation, where,

      $$I=\left( \begin{array}{cc} 1 & 0 \\ 0 & 1 \\ \end{array} \right), X= \left( \begin{array}{cc} 0 & 1 \\ 1 & 0 \\ \end{array} \right). $$
      (9)

      Take 4×4 image for as an example. Let M=1,0,1,0 and N=0,0,1,1, then the scrambled image is shown in Fig. 2, from which we can see that a meaningful image is scrambled into a meaningless one. The quantum circuit corresponding to the scrambling is shown in Fig. 3.

      The inverse image-scrambling procedure is similar to that of the scrambling procedure with the scrambled image as the input. The gates used in the inverse image-scrambling procedure is the same as the circuit for image-scrambling, but the order is inverse. Thus the resulted image is the original image.According to the quantum image scrambling mentioned above, the resized watermark image is scrambled by the embedder.

  2. 2.

    Embedding step:

    After preparation step, for embedding, the embedder produces a 2n×2n binary image embedding key K1 . This key will be used to determine the position that the watermark pixels will be embedded in and is only known to the embedder. Then, each position in watermark image |W〉 will be compared with the positions in carrier image |C〉.

    1. If the positions are equal, then the corresponding color values will be compared.

      1. If the color value |W i 〉 and the color value \(|{C^{0}_{i}}\rangle \) are equal, no changes will be made.

      2. If the color value |W i 〉 and the color value \(|{C^{0}_{i}}\rangle \) are not equal, then:

        • if the color value |K1 i 〉=0 then the color value |W i 〉 will be embedded in \(|{C^{0}_{i}}\rangle \) (it means, a not gate is applied to the LSB of |C i 〉 ). Simultaneously, the color value |K2 i 〉 is set to 1.

        • if color value |K1 i 〉=1, then no change is needed. Simultaneously, the color value |K2 i 〉 is set to 1.

    By doing so, the watermark image is embedded into the carrier image.

Fig. 2
figure 2

The left is the original image, the right is the scrambled image

Fig. 3
figure 3

The quantum circuit for scrambling

3.2 Quantum Watermark Images Extracting Procedure

Here, it will be shown how the copyright owner can extract watermark image from the carrier Image using |K1〉 and |K2〉. Prior to the extraction, an empty 2n×2n binary image, i.e., W o u t is prepared by the embedder, where,

$$|W_{out}\rangle=\frac{1}{2^{n}}\sum\limits^{2^{2n}-1}_{i=0}|w^{i}_{out}\rangle\otimes|i\rangle, |w^{i}_{out}\rangle=0, $$

On the other hands, all of the color values in |W o u t 〉 is set to 0. The extracting procedure can be done in the following steps:

For(i:0 to i:22n−1),

  • if(K2 i =1) then

    • if (K1 i =0) then \(w^{i}_{out}={c^{0}_{i}},\) else if (K1 i =1) then \(w^{i}_{out}={c^{0}_{i}}\oplus 1.\)

By completing the extraction procedure, one can see that the original scrambled polished watermark image could be extracted. Quantum circuit for the watermarking procedure is presented in Figs. 4a and 4b. Finally, by applying inverse image scrambling algorithm, the original polished watermark image will be simply extracted.

Fig. 4
figure 4

Quantum watermarking procedure

Needless to say that in the protocol, a quantum comparator circuit is needed for comparing procedure. Wang et al. [3] proposed a quantum comparator circuit presented in Fig. 5. The comparator compares a and b, where |a〉=|a n−1...a 1 a 0〉 and |b〉=|b n−1...b 1 b 0〉, a i ,b i ∈0,1,i = n−1,...,1,0. Qubits |c 1〉 and |c 0〉 are outputs.

  • If c 1 c 0=10, then a>b

  • If c 1 c 0=01, then a<b

  • If c 1 c 0=00, then a = b

Fig. 5
figure 5

Quantum comparator

In Fig. 4, the embedding circuit and the extracting circuit are shown as block diagrams. The comparator block, the embedding block and the extracting blocks are shown in Figs. 56a and b. respectively.

Fig. 6
figure 6

Quantum circuit for the embedding procedure and the extracting procedure

4 Simulations of Quantum Watermark Embedding and Extracting Procedure

To execute the protocol more convincingly, it is simulated using a classical computer with Intel(R) Core(TM) 2 Duo CPU E7300 2.66 GHz, 2.00 GB Ram equipped with the MATLAB 2009 environment.

The peak-signal-to-noise ratio (PSNR), is one of the most used quantity in classical image processing for comparing the fidelity of a watermarked image with its original version. Here the PSNR is considered as our embedded carrier image evaluation quantity by transforming the quantum images into classical forms. It is most easily defined via the mean squared error (MSE), which for two m×n monochrome images (the original carrier image I and its watermarked version K) is defined as

$$ MSE=\frac{1}{mn}\sum\limits^{m-1}_{i=0}{\sum}^{n-1}_{j=0}\left[(I(i,j)-K(i,j)^{2})\right]. $$
(10)

The PSNR is defined by

$$ PSNR=20log_{10}\left( \frac{MAX_{I}}{\sqrt{MSE}}\right) $$
(11)

where, M A X I is the maximum pixel value of image I. In our scheme, I and J correspond to the original image and the watermark image respectively. All of the gray-carrier images used in our simulations are shown in Fig. 7, and their corresponding PSNR values with different watermark images are presented in Table 1. According to Fig. 7 and Table 1, it can be seen that the watermark image’s embedding doesn’t affect the carrier images visual effect. And the PSNR is acceptable for use.

Fig. 7
figure 7

The carrier images and the watermark images used in our simulations. a-f are carrier images. g-i are watermark image

Table 1 All the images’s PSNR in our simulations

Another tool for evaluating of the fidelity of a watermarked image with its original version of an image is the image’s histogram. An image histogram, shows frequency of pixels intensity values. In an image histogram, the x axis shows the gray level intensities and the y axis shows the frequency of these intensities. Histograms has many uses in image processing. One of the applications is the analysis of the image [42]. By just looking at an image’s histogram histogram, one can predict important data about an image. By comparing the histogram graphs of two images one can find in what content the images are match. For more convince following in Fig. 8 the histogram graphs of the six original images and the histogram graphs of their corresponded watermarked images where the camera image is considered as a watermark image is presented. According to the Fig. 8 the histogram of the watermarked images are in good agreement with the original ones.

Fig. 8
figure 8

The histogram graphs of the six original images and the histogram graphs of their corresponded watermarked images (camera image is watermarked

Finally for comparing the results of the proposed scheme with the previous one, the presented LSB based quantum watermarking is compared with Nan Jiangs algorithm [42] in Table 2. Although the steganography and the watermarking are two different kinds of data hiding methods with different objectives, since the Nan Jiang’s algorithm for quantum steganography and our proposed protocol for image watermarking are following the same method in data hiding (LSB method), comparing the (PSNR) of the two protocols would be a useful tool for comparing the fidelity of a watermarked/stegano image with its original version. According to Table 2, one can see that comparing with the previous Nan Jiang’s algorithm for quantum steganography, in the proposed LSB based quantum watermarking scheme about six percent improvement is achieved for PSNR quantity.

Table 2 The peak-signal-to-noise ratio (PSNR) for LSB based quantum watermarking algorithm and Nan Jiang’s algorithm

5 Conclusion

The essential goal of watermarking is to resist not only the geometric distortion attack but also the signal processing attack. The performance of a watermarking method is depended on various parameters to be considered. In classical information there is no watermarking procedure resists all types of attack. But, still many researchers are working on finding better technique which will give more robust. In this paper, a novel LSB based quantum watermarking protocol is presented in which through m-bit embedding key K 1 and m-bit extracting key K 2, a m-pixel gray scale image is watermarked in a m-pixel carrier image by the original owner of the carrier image. In this scheme to represent quantum images, the Novel Enhanced Quantum Representation of digital images (NEQR protocol) presented by Zhang, Yi, et al. in 2013 [23] is employed. A close inspection of the presented LSB based quantum watermarking algorithm indicates that only the legal owner of the original carrier image knows the extracting key K 2, no attacker can reach the watermarked secret image, so the presented watermarking is a robust watermark protocol. Furthermore, by analyzing the histogram graphs one can see that the histogram graphs of the original images and their corresponding watermarked images are in a good agreement and the original cover image and the watermarked signal are perceptually indistinguishable, so the protocol is imperceptible. Finally, compare with the Nan Jiang’s LSB based quantum steganography algorithm [42], in the presented LSB based quantum watermarking about six percent improvement is observed in the PSNR.