• 沒有找到結果。

A simple and high-hiding capacity method for hiding digit-by-digit data in images based on modulus function

N/A
N/A
Protected

Academic year: 2021

Share "A simple and high-hiding capacity method for hiding digit-by-digit data in images based on modulus function"

Copied!
7
0
0

加載中.... (立即查看全文)

全文

(1)

A simple andhigh-hiding capacity methodfor hiding

digit-by-digit data in images based on modulus function

Chih-Ching Thien, Ja-Chen Lin

Department of Computer and Information Science, National Chiao Tung University, Hsinchu, 300, Taiwan, ROC Received5 August 2002; accepted14 June 2003

Abstract

This study presents a simple method for high-hiding capacity. The basic concept uses a modulus operation. The proposed methodhas the following advantages: (1) the proposedmethodoutperforms the simple LSB substitution methodgiven the same range (0–m − 1) of data digits in the embedded data; (2) the proposed method achieves good image vision quality without the needfor post-processing; (3) the proposedmethodis almost as simple as the LSB methodin both coding and decoding; (4) the smaller error advantage over the simple LSB substitution method can also be mathematically veri2ed; (5) the error is smaller than (m − 1)=2 for almost every pixel; (6) the proposedmethodhas high-hiding capacity (for example, the proposedmethodcan hide a 256 × 256 or 256 × 512 image in a 512 × 512 host image).

? 2003 Pattern Recognition Society. Published by Elsevier Ltd. All rights reserved. Keywords: Steganography; LSB substitution; Modulus operation; High-hiding capacity

1. Introduction

Concealing data in images is increasingly important and has numerous applications [1–4]. Although hiding data by replacing the least signi2cant bits (LSB) of the gray level of each pixel is probably the easiest approach, this method might cause poor visual quality or waste storage space, as explainedbelow.

The LSB approach usually assumes that the base of the numerical data being hidden is a whole power of 2. (For example, 1-bit LSB means the hidden number is treated as a

binary number because 21= 2, 2-bit LSB means the hidden

number is treatedas a number of base 22=4, etc.) When the

base of the number is not a power of 2, a base transform can be usedto switch the input number to its binary equivalent. Sometimes, this kindof transform is not applicable/suitable.

Corresponding author. Department of Computer and Infor-mation Science, National Tsing Hua University, 1001 Ta Hsueh Road, Hsinchu 30050, Taiwan. Tel.: 03-5715900; fax: +886-03-5721490.

E-mail address:jclin@cis.nctu.edu.tw(J.C. Lin).

For example, if the system is usedon-line, andthe incremen-tal data that keep on coming in are decimal and of variable length (say, 87597257364, then 129, then 76887564923, then 9654988, then 45, andso on), then it is diEcult to trans-form data to binary numbers for the on-line real-time hiding, because nothing can be done about the transform on receiv-ing 8759725736 (at least not until the 2nal digit 4 is received andthe number is known to be 87597257364). Of course, the precise transform, (87597257364)10= (1 · · · 10100)2, (129)10= (10000001)2, etc., can be skippedandinsteadthe so-called “digit-by-digit” transform, (9 = (1001)2; : : : ; 0 = (0000)2), can be used to transform the 11-digit decimal number 87597257364 into a binary sequence 1000–0111– · · ·–0100. However, using the 4-bit LSB substitution methodto embedthe 4-bit binary sequence, results in poor visual performance (as pointedout below andin Figs.2(a)

and3(a)).

The LSB approach is limitedmainly in that it often causes arti2cial edges in the areas where pixel values vary smoothly (see the false contours on the shoulder of the “Lena” in

Figs.2(a) and3(a); Section3explains why false contours

appear in the smooth area). These arti2cial edges seriously

0031-3203/$30.00 ? 2003 Pattern Recognition Society. Published by Elsevier Ltd. All rights reserved. doi:10.1016/S0031-3203(03)00221-8

(2)

Nomenclature

yi gray value of the ith pixel of the original (host) image

ˆyi yi is replacedby ˆyi after embedding data digit xi

ˆyiLSB the ith gray value resulting from applying the LSB substitution method

m the digits used in the data are {0; 1; : : : ; m − 1}

xi the ith embedded data digit (hence, xi∈ {0; 1; : : : ; m − 1})

k number of substitution bits in a pixel (for the LSB method)

di the value ( ˆyiLSB− yi) d

i the value ( ˆyi− yi)

damage the visual quality of the stego images because they look abnormal. Notably, even if the smooth area in which arti2cial edges appear is small, these arti2cial edges are still highly visible because human vision is more sensi-tive to the modi2cation of smoothly varying areas in an image than to the modi2cation of textured areas. Conse-quently, hackers are likely to suspect that information is hidden within an image that is treated in this way, compro-mising the security of the hidden information. Unfortunately, most ordinary images (host images) contain several areas in which pixel values smoothly vary, andhence the LSB approach becomes inapplicable. This study attempts to de-sign a high-hiding-capacity method (e.g. hiding a 512×256 image in a 512 × 512 host image) which has the advan-tages of the LSB method(i.e. simplicity), can be usedfor real-time (digit-by-digit) processing, and most importantly, achieves better visual quality than the LSB approach (not only avoiding the arti2cial edges mentioned above, but also reducing the distortion at each pixel of the host image after data embedding).

To achieve this goal, this study develops a method based on a modulus operation that is a modi2cation of the LSB method. To clarify the basis of the proposed method, the well-known simple k-bit LSB substitution methodis de-scribed2rst. Suppose that people wish to embedthe ith digit xi (0 6 xi¡ m; m = 2k) of the data into a pixel with a gray value of yi (0 6 yi6 255) in the host image. Assume that yi= m × ti+ bi;

where bi = yimod m, ti = yi=m , andso both ti and bi are non-negative integers. The resulting gray value ˆyiLSB replacing yiis

ˆyiLSB= (yi− bi) + xi: (1) In later days, the embedded data digit xi can be extracted from ˆyiLSBby

xi= ˆyiLSBmod m: (2)

The proposedmethodis basedon observation of the above equations andthe property of modulus operation. The resulting gray value ˆyi generatedby the proposedmethod is ˆyi = yi − bi + xi+ lm where l is an integer suitably chosen from {0; 1; −1}, as explainedin Section2. 2. Proposed method and some related mathematical properties

2.1. Proposed method

Assume that m kinds of symbols are used in the data, and hence the digital system (i.e. the digits being used) rep-resenting the embedded data is {0; 1; 2; : : : ; m − 1}.

More-over, suppose that the goal is to embedthe ith digit xi

(0 6 xi¡ m) of the data into the pixel with a gray value of

yi (0 6 yi6 255) in the host image. First,

bi= yimod m; (3)

di= xi− bi (4)

are evaluated. Then d

i is assessedusing the following rule:

d i=                          di if   m − 1 2  6 di6 m − 1 2 ; di+ m if (−m + 1) 6 di¡   m − 1 2  ; di− m if m − 1 2 ¡ di¡ m: (5) (Notably −(m − 1)=2 6 d i6 (m − 1)=2, as statedin Property 1 later.) Finally, use

ˆyi= yi+ di (6a)

as the resulting gray value to replace yi. In a few cases, the ˆyi in Eq. (6a) may fall outside the valid gray value range,

that is, ˆyi¿ 255 or ˆyi¡ 0. Shouldthis occur, ˆyi is reset

using the following equation: ˆyi=

yi+ di+ m if yi+ di¡ 0;

yi+ di− m if yi+ di¿ 255:

(6b) If m happens to satisfy 2k= m for some integer k, then Eq.

(6b) can be reduced to

ˆyi= yi+ di; (6c)

the proof is omittedhere to save space. The ˆyi obtained using Eq. (6c) is equivalent to the ˆyiLSB obtainedin Eq.

(1) because of Eq. (4). Notably Eq. (6b) is seldom used. For example, if the hidden data are decimal numbers, then 0–m−1 is 0–9, andthus (m−1)=2 =4 and (m−1)=2 = 5; so Property 1 below ensures that Eq. (6a) is never

over-Kow or underover-Kow provided the original gray yi of the host

image satis2es 4 6 yi6 250. (Many well-known images

such as Lena, Jet, andMonkey, have no pixels outside the range 4–250.)

(3)

Extracting the data digit xi from the image is very easy. Just calculate

xi= ˆyimod m (7)

just as with the LSB method(see Eq. (2)).

In fact, as long as the decoding formula is Eq. (7), the

digit xicouldbe encodedby xi+ tim for any validinteger ti,

andthe proposedmethodsimply selects the best ti, namely

that which generates the gray value xi+ tim closest to the

original gray value yi. The search for the best xi+ tim in

fact can be reduced to the search for the best ˆyi= yi− bi+

xi + lm, where l ∈ {0; 1; −1}, so that ˆyi, is closest to yi.

Eq. (5) helps to determine this l automatically, because Eqs.

(4)–(6a) imply ˆyi=yi+di=yi+di+lm=yi−bi+xi+lm

with l chosen from {0; 1; −1}. Conversely, Eq. (1) means that the LSB methoddoes not choose l (its l is always 0), hence its error cannot be smaller than that using our method. 2.2. Some mathematical properties of the proposed method

Property 1 below gauges the distortion created by the proposed method. Property 2 then gives the distortion comparison at each pixel.

Property 1. In Eq. (6a), the distortion d

ibetween the

orig-inal gray value yi andthe resulting gray value ˆyi is in the

range −(m − 1)=2 –(m − 1)=2.

Property 2. If m happens to satisfy 2k=m for some integer

k, then at each pixel the gray value distortion of the k-bit LSB methodis never smaller than the gray value distortion causedby the proposedmethod.

Property 1 is due to Eq. (5), whereas Property 2 results from the paragraph below Eq. (7). Moreover, Property 2

deals with the case when m = 2k for some integer k. For

the general case when m does not necessarily equal any

2k for any integer k, Properties 3 and4 below can still be

usedto estimate the mean square error (MSE) causedby the proposedandLSB methods, respectively. The MSE is then comparedbetween the two methods in both Properties

4and4. Lemma1is for proving Property 3 only.

Lemma 1. In the general case (that is, embedding with Eq. (6a)), then for any given gray value yi {(m−1)=2 ; : : : ; 255−(m−1)=2}, the proposed method, denoted as Fyi : x → ˆy = Fyi(x), is a bijection function

(one to one and onto) from the set A = {0; 1; : : : ; m − 1} onto the set Cyi : {yi − (m − 1)=2 ; : : : ; yi; : : : ; yi +

(m − 1)=2}. (In notation, x ∈ A−−−−−−→ ˆy ∈ Cˆy=Fyi(x) yi:)

Proof. If x1 and x2 are both mappedto the same ˆy, then Eq. (7) implies that x1 = ˆy mod m and x2 = ˆy mod m.

Consequently, x1 = x2. The mapping thus is one to one.

The “onto” part is provedbelow. Property 1 implies that yi − (m − 1)=2 6 ˆy 6 yi+ (m − 1)=2, so the range

of the mapping must be containedin the set Cyi. Notably,

both A and Cyihave m numbers, andthe mapping is already

demonstrated to be one to one, so the mapping from A to

Cyi must be onto.

Property 3. If the embedded data X is uniformly dis-tributed, then the expected MSE in the host image resulting

from the proposedmethodis approximately (m2− 1)=12

when m is an oddinteger, andis approximately (m2+ 2)=12

when m is an even integer.

Proof. Eq. (6b) is rarely used(see the paragraph between Eqs. (6c) and(7)), andthus only the general case (i.e. Eq. (6a)) is considered here. First, the expectation of the

square error E(( ˆY − yi)2) is checkedfor a single pixel yi.

Here, yi denotes the original gray value of the host

im-age, while ˆY represents a random variable denoting the gray value of the resulting pixel. Since X is uniformly distributed over the range 0–m − 1 andthe mapping between X and

ˆY is one to one andonto (see Lemma 1), ˆY is also

uni-formly distributed (over the range yi− (m − 1)=2 –yi+

(m − 1)=2), see Property (1). Therefore, Property 1 (with

the ˆyithere replacedby ˆY) reads

E((di)2) = E(( ˆY − yi)2)

=   m−1 2 2 +· · ·+(−1)2+02+12+· · ·+ m−1 2 2 m : (8) Case 1: When m is an odd integer. Because

 m − 1 2  6 ˆY − yi= di6 m − 1 2

(see Property 1) andthe oddinteger m implies (m−1)=2 = (m − 1)=2 = (m − 1)=2, −(m − 1)=2 6 d

i6 (m − 1)=2 can be derived. Therefore, d

i is uniformly distributed over −(m − 1)=2–(m − 1)=2, andEq. (8) then becomes

E((d i)2) =  − m−12 2 +  − m−12 +1 2 +· · ·+02+· · ·+m−1 2 2 m = 2 02+ 12+ · · · +  m − 1 2 2 m =2  m − 1 2   m + 1 2  m  6 m = m 2− 1 12 :

(4)

Case 2. When m is an even integer, the proof is similar to Case 1.

From Cases 1 and2, it can be concludedthat E(( ˆY −yi)2) does not depend on pixel position i. Consequently, the ex-pectation value of the square error is the same for each pixel. Accordingly, the expectation of MSE for the whole host im-age is identical to that of MSE for a single pixel.

The following discusses the expectation value of the MSE for the simple k-bit LSB substitution method. Notably, when people try to use a digit-by-digit approach to embed data each digit of which is in the range 0–m−1, then k =log2m bits are usedfor substitution in the LSB substitution method. Property 4. Let the digits used in the embedded data X be 0–m − 1, andlet k = log2m. If the embedded data X and B (=y mod(2k)) are both uniformly distributed, then the expectation value of the MSE resulting from the simple k-bit LSB substitution methodis (2×22k−3m×2k+2m2−1)=6. (If log2m is an integer, then the expectation value is (m2−1)=6.) Proof. The expectation of the MSE is E(( ˆYLSB− Y )2), where ˆYLSB denotes the resulting value of the LSB substi-tution methodcorresponding to the original gray value Y . The following can be derived:

E(( ˆYLSB− Y )2)

= E((B − X )2) (9)

= E(B2− 2BX + X2)

= E(B2) + E(X2) − 2E(B)E(X ) (10) =  i b2i 2k +  i xi2 m − 2  i bi 2k  i xi m (11) = ((2k− 1)2k(2 × 22k k− 1))=6 + ((m − 1)m(2m − 1))=6 m −2 ((2k− 1)22k k)=2 ((m − 1)m)=2m = (2k− 1)(2 × 26 k− 1)+ (m − 1)(2m − 1)6 −2 (2k− 1)2 (m − 1)2 = 2 × 22k− 3m × 26 k+ 2m2− 1 

= m26− 1 while log2m is an integer 

:

Eq. (9) follows from Eq. (1), while Eq. (10) follows from B being independent of X (for B is relatedto the image only, not to the data X ). Moreover, Eq. (11) follows from that

fact the possible values of biare all in the range 0–(2k− 1),

while those of xi are all in the range 0–m − 1.

Property 4. Let k = log

2m. Assume both B (=y

mod(2k)) andthe data X (with digits in the range 0–m − 1)

are uniformly distributed. Then the expected value of the MSE of the k-bit LSB methodis never smaller than that of the proposedmethod.

Property 4. Assume both B (=y mod(2k)) andthe

embedded data X (with digits in the range 0–m − 1) are

uniformly distributed. If m = 2k for some integer k, then

the expectation value of MSE causedby the proposed

methodis 1

2+ 32(1=(m2− 1)) of that causedby the simple

LSB substitution method.

Properties 4and4are both trivial results of Properties

3 and4. In the special case that m = 2k for some integer k,

Property 4is also a direct result of Property 2.

3. Experimental results

This section presents anddiscusses the experimental re-sults using the proposedmethod. The simple LSB substitu-tion methodandthe GA-improvedLSB substitusubstitu-tion method [5] are also implementedto provide a comparison. m = 16 (that is, four LSBs) is taken as an example. The images testedin the present experiment are all 8-bit images, as

dis-playedin Fig.1. Figs.1(a)–(d) shows the data images of

size 512 × 256 each; Figs.1(e) and(f) display the host

images of size 512 × 512 each. Each of Figs.1(a)–(d) is

embedded into each of Figs.1(e) and(f) (with m = 16),

andthe resulting PSNR is listedin Table1. The

correspond-ing theoretic PSNR (accordcorrespond-ing to Properties 3 and 4) are

also calculatedandpresentedin the last row of Table 1.

Table1indicates that the proposedmethodachieves higher

PSNR than the simple or GA-improvedLSB substitution [5] methods (around 2.83 or 1:40 dB better, respectively). Ad-ditionally, the theoretic PSNR of both the proposed method andthe simple LSB substitution method(calculatedfrom Properties 3 and4, respectively) closely approximate the experimental results.

Fig.2displays the images resulting from the above

ex-periment. Figs.2(a)–(c) display the three images resulting

from embedding Fig.1(a) into Fig.1(e) (with m = 16)

us-ing the three diNerent methods. Fig.2(a) shows the image

resulting from the simple LSB substitution method, while

Figs.2(b) and(c) illustrate the images resulting from the

GA-improvedLSB substitution methodandthe proposed method, respectively. Clearly, the proposedmethodachieves better performance in terms of vision quality than the other two methods. Moreover, the false contour on the shoulder is

(5)

(a) (b)

(c) (d)

(e) (f)

Fig. 1. The test images in the experiment: (a)–(d) are “data” images of size 512 × 256; (e) and(f) are “host” images of size 512 × 512.

Table 1

Experimental PSNR of the resulting images (with m = 16) generatedusing the simple andGA-improvedLSB substitution methods, andthe proposedmethod

Host = Lena Host = Baboon

The simple The GA- Our The simple The GA- Our

LSB methodimproved methodLSB methodimproved method

LSB methodLSB method Scene 32.28 34.08 34.79 32.31 33.99 34.82 Jet 32.02 34.16 34.76 32.08 34.28 34.81 TiN 31.30 32.90 34.80 31.30 32.97 34.82 Milk 32.27 32.44 34.83 32.27 32.42 34.79 Theoretic 31.85 34.81 31.85 34.81 value

Theoretic values (the expectedvalues assuming uniform distribution) given by Properties 3 and4 are also includedfor comparison.

obvious in Figs.2(a) and(b), but not in Fig. (c). The arti2-cial edges causedby the simple LSB methodare explained easily below. In the area where pixel values smoothly vary (e.g. a small portion of the shoulder of Lena), the sim-ple LSB encoding method converts the area into an area

with “uniformly distributed pixels” when the hidden data are uniformly distributed. The conversion thus changes the average gray value of the area. For example, if the gray values of the pixels in the smooth area are in the range

(6)

Fig. 2. Three resulting images with m = 16: (a)–(c) denote the resulting images by embedding Fig.1(a) into Fig.1(e) using three diNerent methods; (a) is the image using the simple LSB substitution method, while (b) and (c) are those using the GA-improved LSB substitution methodandthe proposedmethod, respectively.

average gray value Oy, then after the conversion, the average gray value of the area becomes (i + 1

2) × 2k, which is in-dependent of Oy, andthe distortion becomes big. However, since the methoddescribedhere always selectedthe closest valid value (to the host value) when encoding data, it (al-most) preserves the average gray Oy of the encoding area. (The preservation can be easily provedby calculating the expectation E(d) (similar to Eq. (8), but without squaring

each term), andobtaining the result that E(d) = 0 (i.e. no

change) if m is odd; or E(d) =1

2 if m is even.) Therefore,

no arti2cial edges exist.

The 2nal experiment embedded randomly generated data into the Lena. The randomly generated data contain 512 × 512 digits, each of which is randomly picked from the integers in the range 0–9. (Some scienti2c data or im-portant data may resemble the random numbers in a certain range, for example, important phone numbers may be em-bedded in an image, where each digit is in the range 0–9.)

Fig.3shows the resulting images. In Fig.3, (a) is obtained

using the simple LSB method, while (b) is obtained using the present method. The vision quality using the proposed methodobviously is superior to that using the simple LSB method.

4. Concludingremarks

This work proposes a simple embedding method based on the modulus operation. As notedin the abstract andshown in the 2gures, the methodis obviously better than the simple LSB substitution method. On the other hand, compared with the GA-improvedLSB method[5], the proposedmethodhas

better PSNR (see Table1), better image quality (see Fig.2),

andmost of all, is considerably simpler andfaster (with a

coding time approximately1

2 of that with the GA-improved

LSB method).

This work conducts some mathematical analysis, including:

(1) the range of the visual distortion (gray value shift) at each pixel of the host image (Property 1);

(2) the error “at each pixel” is never worse than the LSB substitution methodwhen m = 2kfor a certain k (Prop-erty 2);

(3) the expectation value of the MSE of the proposed method(Property 3);

(4) the expectation value of the MSE of the LSB substitu-tion method(Property 4);

(7)

Fig. 3. Experimental results of embedding randomly generated decimal digits (512 × 512 digits and each digit is 0–9) in Lena: (a) is the resulting image obtainedby the simple LSB method, (b) is the resulting image obtainedby the proposedmethod. Notably, m = 10 here, andthus m is not a whole power of 2.

(5) the expectation value of our MSE will not exceedthat of the LSB substitution method(Properties 4and4). The proposedmethodis easy andfast. In fact, the extrac-tion of the proposedmethodis the same as that of the simple LSB substitution method(see Eqs. (2) and(7)). Therefore, the proposedmethodcan replace the simple LSB method in any application in which the simple LSB methodwas adopted [6–9].

Acknowledgements

This work was supportedby the National Science Council, ROC, under Grant NSC 91-2213-E009-097. We thank the referee whose comments have greatly improvedthis paper. References

[1] W. Bender, D. Gruhl, N. Morimoto, A. Lu, Techniques for data hiding, IBM Systems J. 35 (3–4) (1996) 313–316.

[2] W. Bender, F.J. Paiz, W. Butera, S. Pogreb, D. Gruhl, R. Hwang, Applications for data hiding, IBM Systems J. 39 (3–4) (2000) 547–568.

[3] E. Adelson, Digital signal encoding and decoding apparatus, US Patent, No. 4939515, 1990.

[4] L.F. Turner, Digital data security system, Patent IPN WO 89/08915, 1989.

[5] R.Z. Wang, C.F. Lin, J.C. Lin, Image hiding by optimal LSB substitution andgenetic algorithm, Pattern Recognition 34 (3) (2001) 671–683.

[6] W.N. Lie, L.C. Chang, Data hiding in images with adaptive numbers of least signi2cant bits basedon the human visual system, International Conference on Image Processing, IEEE Part Vol. 1, Kobe, Japan, 1999, pp. 286–290.

[7] Y.C. Hou, P.M. Chen, Y.F. Chiao, Steganography: an eEcient data hiding method, Conference on Intelligent Systems, Vol. 4, NC, USA, 1998, pp. 211–214.

[8] F.A.P. Petitcolas, R.J. Anderson, M.G. Kuhn, Information hiding—a survey, Proc. IEEE 87 (7) (1999) 1062–1078. [9] J. Fridrich, M. Goljan, Images with self-correcting capabilities,

International Conference on Image Processing, IEEE Part Vol. 3, Kobe, Japan, 1999, pp. 792–796.

數據

Table 1 indicates that the proposedmethodachieves higher
Fig. 1. The test images in the experiment: (a)–(d) are “data” images of size 512 × 256; (e) and(f) are “host” images of size 512 × 512.
Fig. 2. Three resulting images with m = 16: (a)–(c) denote the resulting images by embedding Fig
Fig. 3. Experimental results of embedding randomly generated decimal digits (512 × 512 digits and each digit is 0–9) in Lena: (a) is the resulting image obtainedby the simple LSB method, (b) is the resulting image obtainedby the proposedmethod

參考文獻

相關文件

[This function is named after the electrical engineer Oliver Heaviside (1850–1925) and can be used to describe an electric current that is switched on at time t = 0.] Its graph

– The The readLine readLine method is the same method used to read method is the same method used to read  from the keyboard, but in this case it would read from a 

6 《中論·觀因緣品》,《佛藏要籍選刊》第 9 冊,上海古籍出版社 1994 年版,第 1

Robinson Crusoe is an Englishman from the 1) t_______ of York in the seventeenth century, the youngest son of a merchant of German origin. This trip is financially successful,

fostering independent application of reading strategies Strategy 7: Provide opportunities for students to track, reflect on, and share their learning progress (destination). •

According to the Heisenberg uncertainty principle, if the observed region has size L, an estimate of an individual Fourier mode with wavevector q will be a weighted average of

In the past researches, all kinds of the clustering algorithms are proposed for dealing with high dimensional data in large data sets.. Nevertheless, almost all of

Following the supply by the school of a copy of personal data in compliance with a data access request, the requestor is entitled to ask for correction of the personal data