Keywords

1 Introduction

Data hiding on images [1, 4,5,6, 8] is a technique to embed a secret data string into an image with two requirements. First, it is hard to distinguish between the embedded image and the host image. Second, the embedded secret data string should be extracted losslessly. In the domain of data hiding on images, the embedding capacity (the number of bits embedded into the host image) and the visual quality of the embedded image are two important factors. The goal of data hiding is to construct a scheme which obtains high embedding capacity while preserving good stego-image quality.

Turner [9] proposed a data hiding scheme called the least significant bit (LSB) replacement which embeds secret data into the least significant bits of the cover pixels. However, the embedded data by using this method may be detected by a steganalysis detector. To have a better resistance against steganalysis detectors, some reference matrices are applied in constructions of data hiding schemes based on the LSB replacement. Zhang and Wang [11] proposed a method based on exploiting modification direction (EMD) which constructs a magic matrix as a reference to modify the least significant bits of the cover pixels. Chang et al. [3] presented a Sudoku-based method which uses a well-known Sudoku matrix to construct a reference matrix. In addition, Sudoku-based data hiding scheme obtains higher embedding capacity and security than the EMD method. Inspired by the Sudoku method, Lin et al. [7] proposed an improved method which constructs a similar secret reference matrix. Chang and Wu [2] proposed a 2-level EMD method whose maximum embedding capacity is 2.32 bpp. Wu et al. [10] presented a magic-cube-based method which applies a magic cube as a 3-dimensional reference matrix. Their scheme can obtain higher embedding capacity than other existing methods while preserving high stego-image quality.

In this paper, we propose a new data hiding scheme (called PV) which uses a permutation vector to construct a 1-dimensional reference vector. Each cover pixel can be embedded at least 1 secret bit by modifying its LSBs according to the secret data and the generated reference vector. Experimental results show that our proposed scheme outperforms existing schemes in visual quality of stego-images when the embedding capacity is between 1.5 bpp and 3.32 bpp. In order to improve the stego-image quality with embedding capacity from 1 bpp to 1.5 bpp, we propose an improved permutation-vector-based data hiding scheme (called IPV). In this improved scheme, a 2-dimensional reference matrix is constructed based on permutation vectors. Experimental results show that the IPV scheme obtains high stego-image quality when the embedding capacity is between 1 bpp and 1.5 bpp.

The remaining part of the paper is organized as follows. In Sect. 2, we survey some existing data hiding schemes based on reference matrices. Next, in Sect. 3, we show our proposed data hiding scheme based on permutation vectors. In Sect. 4, we give experimental results for our proposed scheme and compare it with existing data hiding schemes. Finally we give a conclusion in Sect. 5.

2 Previous Works

In this section, we review recent data hiding schemes based on exploiting modification direction [11], Sudoku [3], and magic cube [10], respectively.

We view each cover image as a vector

$$ X=\{x_i:0\le x_i\le 255 \, \& \, 0\le i<(H\times W)\}$$

for a fixed order where H and W are the height and width of the cover image, respectively.

2.1 Data Hiding Based on Exploiting Modification Direction (EMD) [11]

Assume that the secret message \(s=(s_1,s_2,\ldots ,s_m)\) is a vector in the base-\((2n+1)\). The cover image X is partitioned into m consecutive pixel sets \(\{(x_{i1},x_{i2},\ldots ,x_{in}): 1\le i\le m\}\) of size n. For the i-th pixel set \((x_{i1},x_{i2},\ldots ,x_{in})\), the scheme first computes

$$\alpha _i=\sum _{j=1}^n(i\times x_{ij}) \, \mod \, (2n+1).$$

To embed the i-th digit \(s_i\) into the i-th pixel set \((x_{i1},x_{i2},\ldots ,x_{in})\), the scheme does the following steps:

  1. 1.

    If \(s_i=\alpha _i\), then keep \((x_{i1},x_{i2},\ldots ,x_{in})\) unchanged.

  2. 2.

    If \(s_i\ne \alpha _i\) and \(0< (s_i-\alpha _i)\le n\), then increase the value of \(x_{it}\) by 1 where \(t=s_i-\alpha _i\).

  3. 3.

    If \(s_i\ne \alpha _i\) and \(n< (s_i-\alpha _i)\), then decrease the value of \(x_{it}\) by 1 where \(t=2n+1-s_i+\alpha _i\).

2.2 Data Hiding Based on Sudoku [3]

Chang et al. proposed a data hiding scheme based on Sudoku [3]. A Sudoku is a \(9\times 9\) matrix like the one shown in Fig. 1 where each row contains every digit from 1 to 9 exactly once, and so do each column and each \(3\times 3\) block.

Fig. 1.
figure 1

An example of \(9\times 9\) Sudoku grid

In their method [3], Chang et al. extended a \(9\times 9\) Sudoku grid to a \(256\times 256\) reference matrix M first. Assume that the secret message \(s=(s_0,s_1,\ldots ,s_m)\) is a vector in the base-9. The cover image X is partitioned into m consecutive pixel pairs \(\{(x_{2i},x_{2i+1}): 0\le i\le m-1\}\). For the i-th pixel pair \((x_{2i},x_{2i+1})\), their scheme first computes

$$\alpha _i=M(x_{2i},x_{2i+1}).$$

To embed the i-th digit \(s_i\) into the i-th pixel pair \((x_{2i},x_{2i+1})\), their scheme does the following steps:

  1. 1.

    If \(s_i=\alpha _i\), then keep \((x_{2i},x_{2i+1})\) unchanged.

  2. 2.

    If \(s_i\ne \alpha _i\), then do the following:

    1. (a)

      In the \(9\times 9\) Sudoku grid containing the \((x_{2i},x_{2i+1})\)-entry of the matrix M, find the row vector SR, the column vector SC, and the \(3\times 3\) block SB which contain the \((x_{2i},x_{2i+1})\)-entry.

    2. (b)

      Find the \((x_R,y_R)\)-entry in SR, the \((x_C,y_C)\)-entry in SC, and the \((x_B,y_B)\)-entry in SB such that \(M(x_R,y_R)=M(x_C,y_C)=M(x_B,y_B)=s_i\).

    3. (c)

      Let \(SU=\{(x_R,y_R),(x_C,y_C),(x_B,y_B)\}\). Modify \((x_{2i},x_{2i+1})\) as \((x',y')=\arg \min \{|x-x_{2i}|+|y-x_{2i+1}|:(x,y)\in SU\}\).

2.3 Data Hiding Based on Magic Cubes (MC) [10]

Wu et al. proposed a data hiding scheme based on magic cubes [10]. For \(1\le k\le 8\), a \(2^k\)-magic cube is a three-dimensional matrix of size \(2^k\times 2^k\times 2^k\) in which every number from 0 to \(2^{3k}-1\) appears exactly once in the matrix. Given a \(2^k\)-magic cube M as a reference matrix, the scheme of Wu et al. [10] embeds the secret message into the cover image X in the following way.

Given a number t, let \((t)_2\) denote the binary representation of the number t. Assume that the secret message \(s=(s_0,s_1,\ldots ,s_{3m-1})\) is a vector where each entry \(s_i\) is a k-bit string. The cover image X is partitioned into m consecutive pixel triplets \(\{(x_{3i},x_{3i+1},x_{3i+2}): 0\le i\le m-1\}\). To embed the i-th secret message triplet \((s_{3i},s_{3i+1},s_{3i+2})\) into the i-th pixel triplet \((x_{3i},x_{3i+1},x_{3i+2})\), their scheme first computes the coordinate vector \((u_i,v_i,w_i)\) such that

$$M(u_i,v_i,w_i)=SN_i$$

where \(SN_i\) is the number whose binary representation is equal to \(s_{3i}\circ s_{3i+1}\circ s_{3i+2}\) where \(\circ \) denotes the concatenation. Now, their scheme modifies the pixel triplet \((x_{3i},x_{3i+1},x_{3i+2})\) by replacing the least k bits of \(x_{3i},x_{3i+1},x_{3i+2}\) with \((u_i)_2,(v_i)_2,(w_i)_2\), respectively. This completes the embedding procedure in their scheme.

3 The Proposed Data Hiding Scheme Based on Secret Permutation Reference Vectors

In this section, we describe the proposed embedding and extraction processes of our proposed scheme based on permutation vectors.

3.1 The Data Embedding Process

For a natural number k, let \(P_k\) denote the set of permutations on \(\{0,1,\cdots ,k-1\}\). The process randomly chooses a permutation \(\pi =(\pi _0,\pi _1,\ldots ,\pi _{k-1})\in P_k\). In order to construct a reference vector V of length 256, the proposed scheme expands the permutation vector \(\pi \) by repeating it until the length is at least 256. That is,

$$V=(\pi _0,\pi _1,\ldots ,\pi _{k-1},\pi _0,\pi _1,\ldots ,\pi _{k-1},\ldots ).$$

Assume that the secret message \(s=(s_0,s_1,\ldots ,s_{m-1})\) is a vector in the base-k. The cover image X is viewed as a vector \(X=(x_0,x_1,\ldots ,x_{m-1})\in \{0,1,\ldots ,255\}^m\). For the i-th pixel \(x_i\), the proposed scheme first computes \(\alpha _i=V(x_i)\). To embed the i-th digit \(s_i\) into the i-th pixel \(x_i\), the proposed scheme does the following steps:

  1. 1.

    If \(s_i=\alpha _i\), then keep \(x_i\) unchanged.

  2. 2.

    If \(s_i\ne \alpha _i\), then do the following:

    1. (a)

      Find the index \(t\in \{0,1,\ldots ,255\}\) such that \(|t-x_i|\) is minimum and \(V(t)=s_i\).

    2. (b)

      Replace the original pixel \(x_i\) by t.

3.2 The Data Extraction Process

In this subsection, we describe the extraction process of the proposed scheme. Let \(X'=(x_0',x_1',\ldots ,x_{m-1}')\) denote the stego-image after embedding the secret message \(s=(s_0,s_1,\ldots ,s_{m-1})\) into the original cover image X.

To extract \(s_i\) from \(x_i'\), the proposed scheme does the following steps:

  1. 1.

    Generate the permutation vector \(\pi =(\pi _0,\pi _1,\ldots ,\pi _{k-1})\in P_k\) which was previously constructed by the embedding process.

  2. 2.

    Generate the vector V which was previously constructed by the embedding process.

  3. 3.

    Compute \(V(x_i')\) and output it.

3.3 Expected Stego-Image Quality of the Proposed Scheme

We assume that the secret message \(s=(s_0,s_1,\ldots ,s_{m-1})\) is a random vector in the base-k since we always embed the secret message into the cover image after encrypting this message. In addition, PSNR is a known way to measure the similarity between the cover image \(X=(x_0,x_1,\ldots ,x_{m-1})\) and the stego-image \(X'=(x_0',x_1',\ldots ,x_{m-1}')\). The PSNR definition is as follows:

$$PSNR(X,X')=10\log _{10}\frac{255^2}{MSE(X,X')},$$

where

$$MSE(X,X')=\frac{1}{m}\sum _{j=0}^{m-1}(x_j-x_j')^2.$$

Given any cover image X, let \(X'\) be its stego-image after the proposed scheme embeds a random message into X. Then the expected value of \(MSE(X,X')\) is

$$\frac{2}{k}\left( \sum _{i=1}^{\lfloor (k-1)/2 \rfloor }i^2 \right) + \frac{k}{4}(\lceil \frac{k-1}{2}\rceil -\lfloor \frac{k-1}{2}\rfloor ).$$

For \(2\le k\le 10\), we list the expected MSE and PSNR in Table 1.

Table 1. Expected value of MSE and PSNR in the proposed scheme based on permutation vectors and the corresponding embedding capacity (EC).

We remark that the stego-image quality of the scheme of Zhang and Wang [11] is better than that of our proposed scheme when the embedding capacity is 1.16 bpp. In fact, the expected MSE and PSNR of their scheme are 2/5 and 52.11, respectively when the embedding capacity is 1.16 bpp. However, their scheme does not provide the expected MSE and PSNR when the capacity is 1 bpp.

3.4 The Improved Data Hiding Scheme Based on Permutation Vectors

In this subsection, we describe our improved scheme based on permutation vectors. The improved scheme is designed for improving the stego-image quality when the embedding capacity is from 1 bpp to 1.5 bpp.

The Data Embedding Process. We consider \(k=4\) or 5. The scheme randomly chooses a permutation \(\pi =(\pi _0,\pi _1,\ldots ,\pi _{k-1})\in P_k\) and constructs a reference vector V of length W as in the previous construction. Note that

$$V=(\pi _0,\pi _1,\ldots ,\pi _{k-1},\pi _0,\pi _1,\ldots ,\pi _{k-1},\ldots ).$$

Next, we define the reference matrix M such that the i-th row vector of M is \(V^i\) where \(V^i\) is defined in the following way:

$$V^i(j)=\pi _{\left( (j-2i)\mod k\right) },\,\,\text{ for } 0\le j\le W-1.$$

Note that \(V^0\) is identical to V. Assume that the secret message \(s=(s_0,s_1,\ldots ,s_{m-1})\) is a vector in the base-k. The cover image X is partitioned into m consecutive pixel pairs \(\{(x_{2i},x_{2i+1}): 0\le i\le m-1\}\). For the i-th pixel pair \((x_{2i},x_{2i+1})\), the improved scheme first computes

$$\alpha _i=M(x_{2i},x_{2i+1}).$$

To embed the i-th digit \(s_i\) into the i-th pixel pair \((x_{2i},x_{2i+1})\), the improved scheme does the following steps:

  1. 1.

    If \(s_i=\alpha _i\), then keep \((x_{2i},x_{2i+1})\) unchanged.

  2. 2.

    If \(s_i\ne \alpha _i\), then do the following:

    1. (a)

      Find the \((x',y')\)-entry in the matrix M such that \(M(x',y')=s_i\) and \(|x'-x_{2i}|+|y'-x_{2i+1}|\) is the minimum value.

    2. (b)

      Replace the original pixel pair \((x_{2i},x_{2i+1})\) by \((x',y')\).

The Data Extraction Process. Let \(X'=(x_0',x_1',\ldots ,x_{2m-1}')\) denote the stego-image after embedding the secret message \(s=(s_0,s_1,\ldots ,s_{m-1})\) into the original cover image X. To extract \(s_i\) from the pixel pair \((x_{2i}',x_{2i+1}')\), the proposed extracting scheme does the following steps:

  1. 1.

    Generate the permutation vector \(\pi =(\pi _0,\pi _1,\ldots ,\pi _{k-1})\in P_k\) and the reference matrix M such that \(M(i,j)=\pi _{(j-2i)\mod k}\).

  2. 2.

    Compute \(M(x_{2i}',x_{2i+1}')\) and output it.

We discuss the expected MSE and PSNR of our improved scheme in the next subsection.

Expected MSE and PSNR of Our Improved Scheme. For \(k=5\), for any (ij)-entry of the reference matrix M, the set

$$\{M(i,j),M(i+1,j),M(i-1,j),M(i,j+1),M(i,j-1)\}$$

is exactly the set \(\{\pi _0,\pi _1,\pi _2,\pi _3,\pi _4\}\) where we assume that \(i,j\ne 0\) or 255. Thus, the expected MSE of the stego-image is approximately 2/5, the corresponding expected PSNR is approximately 52.11, and the embedding capacity is \((\log _25)/2 \approx 1.16\) bpp.

For \(k=4\), for any (ij)-entry of the reference matrix M, the set

$$\{M(i,j),M(i+1,j),M(i-1,j),M(i,j+1),M(i,j-1)\}$$

must contain the set \(\{\pi _0,\pi _1,\pi _2,\pi _3\}\) where we assume that \(i,j\ne 0\) or 255. Based on this observation, the expected MSE of the stego-image is approximately 3/8, the corresponding expected PSNR is approximately 52.39, and the embedding capacity exactly equals 1 bpp. For reader’s convenience, we give a comparison in Table 2.

Table 2. Expected value of MSE and PSNR in the original and the improved proposed schemes and the corresponding embedding capacity (EC).

4 Experimental Results

In this section, some experimental results are provided to demonstrate the performance of the proposed schemes. In our experiment, we use four \(512\times 512\) test images shown in Fig. 2.

The stego-images are generated by embedding the randomly generated secret data stream. We compare the embedding capacity measured by bit per pixel (bpp) and the stego-image quality measured by PSNR. In Table 3, the performance of the proposed scheme is shown. The experimental result shows that the PSNR value is at least 40 dB when the embedding capacity is 3 bpp.

Fig. 2.
figure 2

Four test images (a) Lena (b) Baboon (c) Peppers (d) Airplane

Table 3. Embedding Capacity versus PSNR in the proposed (improved) scheme.
Fig. 3.
figure 3

The cover Lena image and stego-images of our proposed scheme. (a) Original image (b) Stego-image (k=3) (c)Stego-image (k=4) (d) Stego-image (k=5) (e) Stego-image (k=6) (f) Stego-image (k=7) (g) Stego-image (k=8) (h) Stego-image (k=9) (i) Stego-image (k=10)

Table 4. The comparison of the EMD method [11], the Sudoku method [3], the improved Sudouk method [7], the two-level EMD method [2], and the MC method [10].

In Fig. 3, the original Lena image and its stego-images generated by our proposed scheme are shown. Figure 3(a) is the original image and Fig. 3(b), (c), (d), (e), (f), (g), (h), (i) are with embedding capacity (in bpp) 1.59, 2, 2.32, 2.59, 2.81, 3, 3.17, 3.32, respectively. The visual quality of these stego-images are quite good as shown in Fig. 3.

In Table 4, we show comparison results of the EMD method [11], the Sudoku method [3], the improved Sudouk method [7], the two-level EMD method [2], and the magic-cube-based method [10]. By comparing experimental results presented in Tables 3 and 4, it is shown that our proposed schemes outperforms mentioned methods when the embedding capacity is less than or equal to 3 bpp. In particular, the stego-image quality of our proposed scheme (\(\ge 40\) dB) is much better than that (\(\le 39\) dB) of the scheme in [10] when the embedding capacity is 3 bpp.

5 Conclusion

In this paper, we construct two novel data hiding schemes based on permutation vectors. In our proposed schemes, a permutation vector is expanded to a reference vector and a reference matrix, respectively. By using the generated reference vector or matrix, the proposed schemes can embed the secret data into the cover image. Experimental results show that our proposed schemes outperform previous schemes on image quality when the embedding capacity is at most 3 bpp. Furthermore, the proposed schemes obtain high PSNR which is at least 40 dB when the embedding capacity is 3 bpp while known methods only achieve at most 39 dB under the same capacity restriction.