You are on page 1of 5

Reversible Data Hiding in Encrypted Images Using

Reformed JPEG Compression
Xiaozhu Xie* Chin-Chen Chang
Department of Computer Science Department of Information Engineering and
Xiamen University of Technology Computer Science, Feng Chia University
Xiamen 361024, China Taichung 40724, Taiwan
Department of Information Engineering and
Computer Science, Feng Chia University
Taichung 40724, Taiwan

Abstract— A scheme of reversible data hiding in encrypted requires additional RDH computation. Unlike the previous
image (RDH-EI) with high embedding capacity is proposed in method, Liu [4] proposed a novel RDH-EI method, which
this paper. First, cover image is transformed to the quantized takes the LSBs of region of interest (ROI) as a part of secret
discrete cosine transform (DCT) coefficients, which are reformed message embedded into the cover image by LSB substitution.
and encrypted to generate the encrypted image. Then the secret Therefore, lossless ROI can be recovered with both the
message is embedded into the encrypted image in the location of encryption key and the embedding key. However, the method
zero alternating current (ac) coefficients to generate the marked in [4] is applicable only in the case of a cover image with a
encrypted image. The JPEG image can be recovered by using the small ROI.
encryption key. The secret message can be extracted using the
embedding key. The experimental results showed that the Other researchers have reserved room for embedding the
proposed scheme can obtain a high embedding ratio while message by compressing encrypted images. Johnson et al. [5]
ensuring that the recovered image will have good quality. developed an effective compression method for encrypted
images based on the Low Density Parity Check Code (LDPC
Keywords—reversible data hiding (RDH); image encryption; Code), which was a great contribution to the field of
JPEG compression compressing encrypted images. Later on, many scholars
proposed RDH-EI methods based on LDPC. A separable RDH-
I. INTRODUCTION EI method was proposed by Zhang [6], which reserved room
Reversible data hiding in encrypted images (RDH-EI) is in by compressing LSBs with LDPC. Qian et al. [7] extended
high demand in various fields, such as preventing information Zhang`s method to improve the embedding ratio. The method
leakage in cloud services, protecting patients’ privacy in in [7] divided the encrypted image into three sets, and then
medical diagnosis, and anti-theft for military secrets. The embedded the message into each set in a method similar to that
results of RDH-EI research are measured mainly by two chief in [6]. At the image recovery phase, Qian et al. [7] recovered
norms, i.e., the quality of the recovered image as evaluated by the image progressively, which means it was recovered one set
peak signal-to-noise ratio (PSNR) and the embedding capacity after another. Inspired by distributed source coding (DSC) [8-
as evaluated by embedding ratio, Re . Many researchers and 9], Qian and Zhang [10] proposed an RDH-EI method using
the most significant bits (MSB) plane and the LDPC-based
scholars have conducted extensive research aimed at increasing DSC, in which the maximum Re that can be achieved is 0.57
both PSNR and Re [1-4,6-9].
bpp. The schemes mentioned above achieve higher embedding
Some RDH-EI methods embed the message by directly capacity than those that directly modify the LSBs of the
modifying the least significant bits (LSBs) of encrypted images. encrypted image. However, the embedding ratio is still not
Zhang [1] proposed an RDH-EI scheme that involved flipping acceptable in some applications.
the three LSBs of two different sets in non-overlapping blocks Inspired by RDH in JPEG compressed images [11], we
to embed the secret message. Hong et al. [2] improved Zhang’s propose an RDH-EI method using JPEG compression to
method by calculating block smoothness using side-match to improve the embedding capacity. The proposed scheme is
decrease the error rate during the process of image recovery. described in Section ϩ , and the experimental results are
The embedding capacities of two methods in [1] and [2] rely
on the size of the blocks and keeping it low to ensure that the analyzed in Section Ϫ  Our conclusions are presented in
PSNR is high. Also, the two methods are inseparable between Section ϫ.
image decryption and message extraction. Ma et al. [3] divided
the cover image into two parts and then made room for II. PROPOSED SCHEME
embedding the message before encryption by embedding the
LSBs of one part into the other part using a traditional RDH A. Framework
method. Re in [3] can achieve up to 0.5 bpp. However, it
Supported by Natural Science Foundation of P. R. China under Grant
61503316, Natural Science Foundation of Fujian Province under Grant

as shown in Fig. if˄ck . As shown in Fig. and only a few coefficients are modified as shown in (1). To find the last non-zero marked encrypted image using the encryption key. respectively. the original image I Ck [ck . Denote the sized M u N is divided into 8 u 8 non-overlapping blocks. Framework of the proposed scheme Fig.. We must reform the ' ° ck .64 to generate Ck [ck .2 . ck .2 .. 3(a). 3(a).i ! 127˅ (1) quantized DCT coefficients for the following reasons: °c  128. as shown in B. we must transform these by applying reformed JPEG compression to vacate space. Aimed at directly transmitting the quantized DCT 1.. 3(b).. non-zero ac coefficients and direct current (dc) coefficients converge at the top left corner. Example of reforming process The framework of the proposed scheme is illustrated in Fig.. pk ] . coefficient values in the range [0. Process of reformed JPEG compression (a) (b) (c) (d) Fig. the vast majority of alternating current Step 2: To make the coefficient values range from 0 to 255. on index of the first nonzero coefficient as pk and embed pk into which DCT is performed.2.1.3.. otherwise. the “image. which is the last non-zero coefficient in the zigzag scanning order. we proposed to ­ 0. quantization table to generate the quantized DCT coefficients. where k is the block index.” compressed image is encrypted using the encryption key. ck .. The data hider embeds the secret message into the encrypted image Reforming steps: by using the embedding key to generate the marked encrypted Step 1: Find the last non-zero coefficient in zigzag scanning image. A JPEG image can be recovered directly from the order and record the position. Fig. i ® 255. 255] so as to look like an which is described in detail in the next section. Therefore. ck .i recorded. coefficients until the first non-zero coefficient. . 2. the original image is compressed coefficients to the recipient. to obtain the DCT coefficients. The information of positions for embedding data must be ¯ k . (ac) coefficients in high frequency are zeros. On the content-owner side. After that. The secret coefficient. these coefficients are quantized using the ck . Denote these coefficients in zigzag scanning order as According to JPEG compression.64 ] .1 .i  -128˅ embed the secret message into the zeros. Reformed JPEG Compression Fig.. 1. Then. if˄ck .1 . we zigzag reversely scan the quantized DCT message can be extracted with the embedding key.

pk 1 . Finally. j ) be a pixel pk in the location of ck . and LL LL  (63  pk ) . (2) length L . embed Otherwise. Rk ª¬ rk . embed the Step 4: Accessorial information. from which we retrieve plaintext form after the encryption phase. message E (I) R (I) \ r ( k *8. ck .2 . started to embed data in block k . Let e(i. pk 1 to ck . As depicted in encryption Step 3: Replace the zero coefficients from ck . where E (I) is the encrypted image. As described in the being extracted. go to the secret message into each block according to the following Step 5. C.. extract secret data in the form D. k *8) † K ENC . The initial LL ª L / 8º .. a. Step 1: Divide M ( I ) into non-overlapped blocks sized represents the pixels in R(I) except that r ( k *8.. k (1 d k d M u N / 64) is the block index... c.63 phase. Step 5: Convert the decimal secret data to the binary form. Therefore..64 . Input: marked image M ( I ) . k * 8) Output: secret message S . pk . Then. phase of “Reformed JPEG Compression”. we obtain secret message S by (5). denoted as Ek .1 . ck . rk . Step 3: If (63  pk )  LL . including the quantization remaining numbers into the next block by repeating a table.64 º¼ . a pixel in set Ck' .1 .2 . where 2 d i d pk . rk . (4) ek . pk  1 is the position value in E (I) . message into the encrypted image E (I) . the data hider embeds the secret of decimal numbers from ck . Because the dc coefficient is always positive.. Embed S ' to blocks in zigzag scanning order from 1 to obtain the reformed quantized block ' index pk  1 to 63 by replacing ek . e(k *8. R (I) \ r ( k * 8. embedded into R(I) from the appointed Rk in a similar Step 4: Embed L (represented by l bits ) into the blocks method depicted in the following section using a key shared in the same method.. Retrieve pk from Ek . As we know. (1 d i d 64) represents a pixel value in Ek . ck . ck' . Then convert each group with ' 8 bits to a decimal number sd (i ) . pk 1 to ck . divide E (I) into go to Step 4. where 1 d i d ª« L / 8º» . as shown in Fig. even it is greater than 255 when ' Step 3: Embed sd (i ) to E (I) from the appointed block Ek quality factor (QF) is large enough. 8 u 8 non-overlapping blocks. k *8) . (5) having 8 bits. steps: Step 4: Extract the remaining secret message from next Step 1: Use the embed key K EMB to encrypt the secret block by repeating Step 2 and Step3. k *8) is the plaintext of pk . (3) With embedding key K EMB . the recipient can decrypt the marked image M ( I ) directly to obtain a JPEG image. S ' S † K EMB .64 ] .i with sd (i ) . k *8) .i .. Encryption E...63 . pk values are stored Step 2: Zigzag scan the first block embedded into the secret in the location of r ( k *8.. update LL by (4). with each group S S † K EMB . Embedding key. as shown in Fig. Embedding data In the proposed method. he/she can extract the secret message. we do not do the computation of (1) to dc coefficient.. The algorithm is symbol ª º denotes a ceiling function meaning “the smallest described as follows: . and K ENC is the encryption key. ' ' Step 2: Split S into ª L / 8 º groups. Otherwise.2 . message S by (3): the front L bits are exactly the encrypted secret message S ' . where LL represents the number of decimal number for the secret message that are not operation.. The reformed ' quantized blocks synthesize the “reformed image” R(I) . which remains in the message to get Ck [ck . 3(c).1 . The With encryption key. with random numbers ranging from 0 to 255 generated by key b. ck' . Denote ª¬ck . pk  LL . extract secret data from ck . The overflow/underflow (can be controlled by the embedding key) as follows: information is recorded for recovering the image. pk 1 to ck . This accessorial information is necessary for recovering I from R(I) . First. L is the length of the secret message S . with the recipient. † is the XOR 8 u 8 . the marked blocks synthesize the marked image M ( I ) delivered to the recipient. pk º¼ integer greater than or equal to”.. go to Step 4.. The algorithm is as follows: embedding data in proper position. 3(d). key 1 and the overflow/underflow information is to c. Message Extraction and Image Recovery We do the encryption conditionally to the “reformed image” R(I) by (2) aimed at transmitting pk to data hider for When the recipient has the embedding key. If all decimal numbers sd (i ) ( 1 d i d «ª L / 8»º ) have been embedded.

EXPERIMENTAL RESULTS then retrieve pk from each block in the location of r (8. 37.67 5. encryption key K ENC .60. 41. 39.19. 36. 39.42 3.39.80. 34. Fig.4. 35. (a) QF=50. 37. 40.43.68. conducted the experiments on the original images shown in Fig. (b) QF=90 Input: Marked image M ( I ) . 39.87 4.38. 39.30. (6) image of the original image. he/she can extract the Step 2: With the shared key. and.03.06 5. and the secret message and recover the JPEG image using the overflow/underflow information can be extracted in the similar aforementioned algorithms.91 1.8) To verify the performance of the proposed scheme. 33.95 Pepper 6. When the recipient has both keys.08 2.87 4. .35. 40. 38.82 0.14. 37. respectively. 36. recover the JPEG R (I) M (I) \ m( k *8. PSNR} { Re . 38.81.20 4.08 2. Baboon 4.42. 37.10. 43.44. 39.56 Average value 5. Experimental results with QF=90. original quantized DCT coefficients.37.19.22 6.95 5. which preserved good quality.76 5. PSNR} Lena 6. PSNR} { Re .91. PSNRs(dB) and embedding rate Re (bpp) When compressed with different QFs QF 50 60 70 80 90 Image { Re . PSNR} { Re .05.17 3.09 6.48 4.74. 4(a’)-(e’) are the corresponding recovered images with QF = 90. 38. 41.51.70 Jet 6.53. the reverse operations of reforming steps described in the phase of “Reformed JPEG Compression” on blocks to restore the Output: Recovered image I .15. k *8) † K ENC .34 6.44 3. Comparison of recovered image quality between proposed scheme and Ma [3].60 (a) (b) Fig.99.37 Barbara 5. 38. (a) (b) (c) (d) (e) (a’) (b’) (c’) (d’) (e’) Fig. 4(a)-(e). Step 1: Decrypt directly using (6) to get the reformed image Step 5: Use quantization table to anti-quantize the R(I) . do key. Step 3: Divide R(I) into 8 u 8 non-overlapping blocks.51 4. share Step 4: With pk and overflow/underflow information. (a)-(e) Original images sized 512x512 ( (a) Lena (b) Barbara (c) Pepper (d) Jet (e) Baboon) .5.13. quantization table. 35.30 2. 37.67 5.97.42. 41. we respectively. (a’). and III. finally.46 5. PSNR} { Re .(e’) The corresponding recovered images TABLE 1. Equation (6) is the reverse transform of (2).84.06 5. way depicted in extraction phase.40 5. 42. quantized DCT coefficients.65. 38.

51-57. even with [2] W. 2013 Fig. Lin. vol. we plan to improve the quality of the recovered lower embedding ratios and worse image quality. Zhang. vol. W. vol. The results in Table 1 verify that the proposed scheme can while maintaining a good quality recovered image with an reach high embedding capacity up to 2.” IEEE DCT transform principle.S. [7] Z. pp. 2012. Therefore. vol. fewer zeros there are in its high frequency.5 bpp. 19. “Reversible Data Hiding in Encrypted Image Before embedding. Chen and H. and Q. the Signal Processing Letters. Zhao. we proposed a scheme of RDH-EI using 19. 49. Pradhan and K.C. no. Dong. “A ROI-based Reversible Data Hiding Scheme in Encrypted Medical Images. [10] Z. C. Y. P. pp.56 dB.13. pp. X. it maintains good quality. 2016. vol. First. X. vol. vol. pp. Ramchandran.6 bpp . pp. 636-646. 4.’s [3]. 4. 10. 2992-3006.” Journal of Visual scheme with QF = 90 and Ma [3]. 4. “Barbara” and “Baboon. pp. Johnson. can extract data from the marked image with the embedding [11] C. 52. such as image in our subsequent research. no. recovered image preserves good quality with an average PSNR value of 41. and C. Chang.2016. Encryption. “Reversible hiding in DCT-based key. pp. 626–643. “Distributed source coding using transformed to quantized DCT coefficients. reformed JPEG compression. 2012. such as “Lena” and required in some applications.” IEEE Transactions on Information Forensics and Security. 8. 2.” IEEE Transactions on Circuits and and encrypted to generate the encrypted image. Liu. Prabhakaran. [3] K. quantized DCT coefficients were reformed with Distributed Source Encoding. outperforms [3] when the embedding ratio is greater than 0. “On Compressing Encrypted Data. 199-202. Schonberg. P. 177. and it maintains the high PSNR value of 42. In this paper. 3. no. The experimental results demonstrated that the proposed scheme can obtain an average embedding ratio up to 2. the cover image is [9] S. Zhang. 2010. 2004. pp. From the results in Table 1.” On the contrary. Zhang. 23. L. S.” The reason for this is that the proposed scheme embeds the message into zeros in the high REFERENCES frequencies of the DCT-quantized blocks. “ Reversible Data Hiding in Encrypted Images Based on Progressive Recovery.” IEEE Signal Processign Letters.” IEEE Signal embedding ratios up to 0.5 [6] X. Li. of which the vast syndromes (DISCUS): Design and construction. “Reversible Data Hiding in Encrypted Image. vol.C. 2016. Yao. V. pp. Processing Letters. no. T. “Lena” . Zeng. 255-258.” IEEE Transactions on Information Forensics and Security. H. 2007. The proposed scheme on Signal Processing. Xin. PSNR decreases sharply when the embedding ratio increases [5] M.P.P. 553-562. Wu. M. “Separable Reversible Data Hiding in Encrypted bpp. D. the proposed method can still reach high Hiding in Encrypted Images Using Side Match. (5) shows a comparison of the quality of the recovered image with different embedding ratios between the proposed [4] Y. The results show that the Communication and Image Representation. F.1672-1676. Information Theory. Tseng. IV. Yu and F. no. In order to extend its “Jet. JPEG image can only be recovered with the encryption compressed images. 2768- 2786. Ishwar. The recipient Systems for Video Technology.60 dB. the embedding ratio reaches 3. Mar. no. “Efficient compression of encrypted grayscale images. 2011. key. “An Improved Reversible Data complex texture. vol. no. S. Qian and X. the more complex the image is. 2003. 26. 1097–1102. Liu.98 bpp with PSNR values 39. Qu and G. 18. 3. Data Hiding in Encrypted Images by Reserving Room Before Both schemes reserved room by compressing before encryption. And according to the [1] X. Hong.60 bpp while the average PSNR value of 41. vol. images with more complex texture have applications. pp.37 bpp using the test image 7. Zhang and G. M.R Feng. Zhang.” IEEE Transations on Image Process. we proposed to embed the secret message into the zeros. However.11. no. 526-532. 4. Apr. slightly in [3]. no.X Qian.” IEEE Transactions embedding ratio approaches 0.39. vol. we also can Although the proposed scheme still recovers a JPEG image conclude that images with simpler texture have higher with both keys. which is more than embedding ratios and better image quality.60 dB. CONCLUSION [8] W.” IEEE Transstion on majority of ac coefficients at high frequency is zeros. H. pp. X. Ma. no. “Reversible The proposed scheme was compared with Ma et al.37 dB when Image. N. D. W. and PSNR goes down to 25 dB when the Ramchandran. and K.” Information Sciences.