Journal of Applied Mathematics

Volume 2013 (2013), Article ID 189706, 8 pages

http://dx.doi.org/10.1155/2013/189706

## A Steganographic Method Based on Pixel-Value Differencing and the Perfect Square Number

^{1}Department of Information Management, Chaoyang University of Technology, No.168, Jifeng E. Road, Wufeng District, Taichung 41349, Taiwan^{2}Department of Mathematics, Changhua University of Education, No.1, Jin-De Road, Changhua County 50058, Taiwan

Received 29 March 2013; Accepted 13 June 2013

Academic Editor: Carlos Conca

Copyright © 2013 Hsien-Wen Tseng and Hui-Shih Leng. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

The pixel-value differencing (PVD) scheme uses the difference value between two consecutive pixels in a block to determine how many secret bits should be embedded. There are two types of the quantization range table in Wu and Tasi's method. The first was based on selecting the range widths of [8, 8, 16, 32, 64, 128], to provide large capacity. The second was based on selecting the range widths of [2, 2, 4, 4, 4, 8, 8, 16, 16, 32, 32, 64, 64], to provide high imperceptibility. Most of the related studies focus on increasing the capacity using LSB and the readjustment process, so their approach is too conformable to the LSB approach. There are very few studies focusing on the range table design. Besides, it is intuitive to design it by using the width of the power of two. This work designs a new quantization range table based on the perfect square number to decide the payload by the difference value between the consecutive pixels. Our research provides a new viewpoint that if we choose the proper width for each range and use the proposed method, we can obtain better image quantity and higher capacity. In addition, we offer a theoretical analysis to show our method is well defined. The experiment results also show the proposed scheme has better image quantity and higher capacity.

#### 1. Introduction

The pixel-value differencing (PVD) [1] scheme provides high imperceptibility to the stego image by selecting two consecutive pixels and designs a quantization range table to determine the payload by the difference value between the consecutive pixels. Besides, it offers the advantage of conveying a large number of payloads, while still maintaining the consistency of an image characteristic after data embedding.

In recent years, several studies have been proposed to improve the PVD method. Wu et al.’s [2] presented a method combining pixel-value differencing and the LSB replacement method. Yang and Weng [3] proposed a multipixel differencing method that uses three difference values in a four-pixel block to determine how many secret bits should be embedded, and Jung et al.’s [4] proposed an image data hiding method based on multipixel differencing and LSB substitution. Liu and Shih [5] proposed two extensions of the PVD method, the block-based approach and Haar-based approach, and Yang et al. proposed an information hiding technique based on blocked PVD. Liao et al.’s [6] proposed a four-pixel differencing and modified LSB substitution, and Yang et al.’s [7] proposed a data hiding scheme using the pixel-value differencing in multimedia images.

Some studies focused on increasing the capacity [3, 5, 8] using LSB [2, 4] or a readjusted process [6, 7] to improve the embedding capacity or image quantity. Few studies focus on the range table design. Besides, it is intuitive to design it using the width of the power of two.

In this work, we design a new quantization range table based on the perfect square number to decide the payload by the difference value between the consecutive pixels. It differs from the design of Wu and Tsai’s scheme, in which the quantization range table is based on the range width of the power of two. The perfect square number provides an elegant mathematical model to develop a new quantization range table, which divides each range into two subranges for embedding different numbers of secret bits.

The remainder of this paper is organized as follows. Section 2 briefly describes Wu and Tsai’s PVD approach. Section 3 presents our scheme on how to create a new quantization table based on the perfect square number, how the embedding procedure works, and how to extract the secret data from the stego image. Section 4 offers a theoretical analysis and shows the experiment results. Finally, Section 5 concludes this paper.

#### 2. Review of Wu and Tsai’s PVD Approach

The gray-valued cover image is partitioned into nonoverlapping blocks of two consecutive pixels, states and . From each block, we can obtain a difference value ; then ranges from 0 to 255. If is small, then the block is located within the smooth area and will embed less secret data. Otherwise, it is located on the edge area, and it can embed a greater amount of secret data. The quantization range table is designed with contiguous ranges, and the range table ranges from 0 to 255. The number of secret bits hidden in two consecutive pixels depends on the quantization range table.

The embedding algorithm is described as follows.

*Step 1. *Calculate the difference for each block of two consecutive pixels and .

*Step 2. *Search the quantization range table for to determine how many bits will be embedded. Obtain the range in which , where and are the lower bound and the upper bound of , and is the number of embedding bits.

*Step 3. *Readsecret bits from the secret bit stream, and transform it into decimal value.

*Step 4. *Calculate the new difference. Ensure bothandare in the same range.

*Step 5. *Average to and. The new pixel valuesandare obtained by the following formula:

Repeat Steps 1–5 until all secret bits are embedded and the stego image is produced.

In the extracting phase, the same Steps 1 and 2 in the embedding algorithm are used. The differenceis computed for each two consecutive pixels in the stego image, and then the same quantization range table is searched to find. Compute, and transform into the binary stream. Repeat until all secret data is completely extracted.

#### 3. Proposed Scheme

In this section, the proposed scheme is described in three parts: the new quantization range table is based on the perfect square number, embedding procedure, and extraction procedure.

##### 3.1. The New Quantization Range Table Based on Perfect Square Number

We design a new quantization range table based on the perfect square number in Table 1. For each pixel value , choose the nearest perfect square number (we will define the nearest perfect square number later), then we have range for . The width of this range is , and the embedding bit length is . For each range , if the width of this range is larger than , then we divide this range into two subranges: and .

For example, if the pixel value is 34, the nearest perfect square number is 36; then we have range: . The width of this range is 12, and the embedding bit length is. Since 12 > 2^{3}, divide this range into two subrangesand.

By the definition of subranges, if the to-be-embedded secret bits equal one of the LSB bits in the first subrange, then we claim it can embed secret bits. Otherwise, the second subrange’s width is always , and it can embed secret bits. Therefore, we can guarantee one of the continuous series numbers equals the bits secret data which we want to embed.

There are two important concepts we want to emphasize here. First, if the difference value is located in the first subrange, there is no modification needed, so this design does not violate the basic concept of PVD and HVS (Human Visual System). Second, we notice almost the difference values belonging to rangeare used to embed the same size of data, 4 bits of secret data. Our design in Table 1 still coincides with the basic concept of PVD—embedding a lower amount of secret data in the smooth area and a greater amount of secret data in the edge area.

##### 3.2. Embedding Procedure

Before embedding secret data, the function *Nearest_PerfectSquare*() is defined to find the nearest perfect square number for difference value , where is the difference value of two consecutive pixels.

The function *Nearest_PerfectSquare*() returns the nearest perfect square number , and is the range number of. According to range number , the secret data is embedded into the cover image by the embedding procedure. The embedding procedure of proposed method is summarized as follows.

The proposed embedding procedure is as follows.

*Input.* The grayscale cover image pixel value , whereis a pixel index. *LSB*() isbits LSB binary stream for pixel value. *Secret*() represents bits binary secret data.

*Output.* The grayscale stego image pixel value .

*Step 1. *For each pair of two consecutive pixels, compute the difference value.

*Step 2. *Find the nearest perfect square number by function *Nearest_PerfectSquare*(), and is the range number of in Table 1.

*Step 3. *If , set new pixel-value difference value . According to PVD embedding scheme (Step 5), average to and . The new pixel values and are obtained by the following formula:

*Step 4. *If, compute the length of embedding bits. There are two cases. Search the first subrange [] and find a value in the subrange such that *LSB*() = *Secret*(), and then set . Otherwise, search the second subrange [] and find a value in the subrange such that *LSB*() = *Secret*(), and then set . Finally, average to and as Step 3 does, and then we obtain and .

We illustrate the embedding procedure in Figure 1.

For example, we choose a pair of two consecutive pixels (47,81) from the cover image; then,. The following two conditions are discussed.

*Case 1. *Secret data is “1110” or “1111” or “0000” or “0001.”

In the first subrange, the 4 LSBs are the same as the secret data (30 = 0001**1110**_{2}, 31 = 0001**1111**_{2}, 32 = 0010**0000**_{2}, 33 = 0010**0001**_{2}), so we can embed 4 bits of secret data. Suppose the to-be-embedded bits are “0000”; then the new difference value(32 = 0010**0000**_{2}). Finally, we modify (47,81) to (48,80).

*Case 2. *Otherwise, the second subrangeis used to embed 3 secret bits ranging from “000” to “111”. Suppose the to-be-embedded bits are “001”; then the new difference value(41 = 00101**001**_{2}). Finally, we modify (47,81) to (43,84).

We illustrated the embedding examples in Figure 2.

##### 3.3. Extraction Procedure

The extraction procedure of the proposed method is summarized as follows.

The proposed extraction procedure is as follows.

*Input.* The grayscale stego image pixel value . *LSB*() is a decimal number transform from bits LSB binary stream for pixel value . *Secret*() represents bits binary secret data.

*Output.* Secret data.

*Step 1. *For each pair of two consecutive pixels, compute the difference value.

*Step 2. *Find the nearest perfect square number by function *Nearest_PerfectSquare*(), and is the range number ofin Table 1.

*Step 3. *If , *Secret*(*4*)* = LSB*(). Otherwise, compute the length of embedding bits , search subrange from Table 1 to determine which subrange it belongs to, and extract the secret data (*Secret*() *= LSB*() for the first subrange and *Secret*()* = LSB*() for the second subrange). Finally, we extract all secret data.

We illustrate the extraction procedure in Figure 3.

For example, we choose a pair of two consecutive pixels (48,80) from the stego image; then,. Sinceis located in the first subrange, we can extract the secret data “**0000**” from 4 LSBs of 32 = 0010**0000**_{2}.

For another example, we choose a pair of two consecutive pixels (43,84) from the stego image; then,. Sinceis located in the second subrange, we can extract the secret data “**001**” from 3 LSBs of 41 = 00101**001**_{2}.

#### 4. Theoretical Analysis and Experiment Results

Lena, Baboon, Peppers, Jet, SailBoat, and Tiffany from the SIPI Image Database are chosen as the cover images. First, we give a theoretical analysis to show our method is well defined, and then the experiment results show the proposed scheme has higher imperceptibility.

##### 4.1. Theoretical Analysis

The stego image quality is measured by the peak signal-to-noise ratio (PSNR). The PSNR formula is defined as where MSE is the mean square error between the cover and stego images. For a cover image, whose width and height are and , MSE is defined as where and are the pixel values of the stego and cover images, respectively.

Suppose, the probability of distribution is uniform. Then we calculate the average payload and average MSE for each range () (or the perfect square number ) according to Table 1. The average payload is computed by the following formula: where is the total number in the first subrange,is the embedding bits in the first subrange, is the total number in the second subrange, andis the embedding bits in the second subrange. The average error for each range is calculated by the following formula:

For example,, average payload is , and the average error is .

The total MSE is estimated by where and are the width and average error for each range.

Therefore, we obtain the average payload and average MSE using the perfect square number, as illustrated in Table 2.

The same theoretical analysis using Wu and Tsai’s method is shown in Table 3.

From Tables 2 and 3, we calculate the payload and PNSR for Lena, Baboon, Peppers, Jet, SailBoat, and Tiffany and compare Wu and Tsai’s method and the proposed method by theoretical analysis in Table 4.

Our method clearly has greater capacity and higher PSNR than Wu and Tsai’s method, which proves the proposed method is well defined.

##### 4.2. Experiment Results

We also use the same test images as the real test shown in Figure 4, and the experiment results are shown in Table 5.

From Table 5, we found the experiment results have larger capacity and better PSNR than those of the theoretical analysis. The capacity and PSNR seem to be affected by the secret data, with more pixel-value difference falling in the first subranges and matching the secret data; we can obtain more capacities and less distortion.

#### 5. Conclusions

This work designs a new quantization range table based on the perfect square number. In particular, we propose a new technology to design the range table. The width of the range is no longer a power of two, and if the difference value is located in the first subrange, there is no modification needed. Therefore, this design has not violated the basic concept of PVD and HVS (Human Visual System). If we choose a proper width for each range and use the proposed method as mentioned above, we can obtain better image quantity and higher capacity. The theoretical analysis shows the proposed scheme is well defined and has larger capacity and higher PSNR than those of Wu and Tsai’s second type range table design. The experiment results also show the proposed scheme provides large capacity and high imperceptibility. In addition, our study ingeniously uses the perfect square number to achieve the goal.

#### References

- D.-C. Wu and W.-H. Tsai, “A steganographic method for images by pixel-value differencing,”
*Pattern Recognition Letters*, vol. 24, no. 9-10, pp. 1613–1626, 2003. View at Publisher · View at Google Scholar · View at Scopus - H. C. Wu, N. I. Wu, C. S. Tsai, and M. S. Huang, “Image steganographic scheme based on pixel-value differencing and LSB replacement methods,”
*IEE Proceedings Vision Image and Signal Processing*, vol. 152, no. 5, pp. 611–615, 2005. View at Google Scholar - C. H. Yang and C. Y. Weng, “A steganographic method for digital images by multi-pixel differencing,” in
*Proceedings of International Computer Symposium*, pp. 831–836, Taipei, Taiwan, 2006. - K.-H. Jung, K.-J. Ha, and K.-Y. Yoo, “Image data hiding method based on multi-pixel differencing and LSB substitution methods,” in
*Proceedings of International Conference on Convergence and Hybrid Information Technology (ICHIT '08)*, pp. 355–358, kor, August 2008. View at Publisher · View at Google Scholar · View at Scopus - J.-C. Liu and M.-H. Shih, “Generalizations of pixel-value differencing steganography for data hiding in images,”
*Fundamenta Informaticae*, vol. 83, no. 3, pp. 319–335, 2008. View at Google Scholar · View at Zentralblatt MATH · View at MathSciNet · View at Scopus - X. Liao, Q.-Y. Wen, and J. Zhang, “A steganographic method for digital images with four-pixel differencing and modified LSB substitution,”
*Journal of Visual Communication and Image Representation*, vol. 22, no. 1, pp. 1–8, 2011. View at Publisher · View at Google Scholar · View at Scopus - C.-H. Yang, C.-Y. Weng, H.-K. Tso, and S.-J. Wang, “A data hiding scheme using the varieties of pixel-value differencing in multimedia images,”
*Journal of Systems and Software*, vol. 84, no. 4, pp. 669–678, 2011. View at Publisher · View at Google Scholar · View at Scopus - C. H. Yang, S. J. Wang, C. Y. Weng, and H. M. Sun, “Information hiding technique based on blocked PVD,”
*Journal of Information Management*, vol. 15, no. 3, pp. 29–48, 2008. View at Google Scholar