• 沒有找到結果。

Process for Embedding Secret Data

Chapter 3 Data Hiding in WebM Videos for Covert Communication

3.2 Embedding of Secret Data into WebM Videos

3.2.2 Process for Embedding Secret Data

In this section, we will describe the detailed algorithm of the proposed method for hiding secret message data into cover videos by changing the frequency coefficients into pre-defined patterns. A flowchart of the proposed data embedding process is shown in Figure 3.5.

Beforehand, we define in the following the aforementioned 16 data patterns for use in the proposed algorithms where we use the notations N and 0 to denote the meanings “non-zero” and “zero,” respectively.

Data pattern i (i = 0 to 15): a 44 block with its positive-sloped diagonal line

being filled with four symbols S4

S

3

S

2

S

1 of N‟s and 0‟s, which correspond to the binary value b4

b

3

b

2

b

1

of i in the following way:

if bj = 0, then Sj = N; otherwise, Sj = 0, j = 1, 2, 3, 4.

Figure 3.4 illustrates the 16 data patterns. For example, when i = 3, the corresponding binary value is i = 310 = 00112, so we define pattern 3 as the 44 block with its positive-sloped diagonal line being filled with the four symbols S4

S

3

S

2

S

1 = 00NN.

And when i =10, the corresponding binary value is i = 1010 = 10102, so we define

pattern 10 as the 44 block with its positive-sloped diagonal line being filled with

S

4

S

3

S

2

S

1 = N0N0.

30

Figure 3.4 The sixteen data patterns for use to embed message data.

Algorithm 3.1 Process for computing the data hiding capacity of a video sequence.

Input: a video sequence V and a pre-selected threshold T.

Output: the number C of macroblocks in V

which may be used to embed data patterns without causing intolerable distortion.

Steps.

1. Perform the following steps for each macroblock MB in the prediction frames of

V.

1.1 Save the original quantized coefficients of the chroma color channels (including the U channel and the V channel) in the macroblock MB.

1.2 Check the coefficients of each subblock SB of the chroma color channels:

if the original coefficientsof SB do not satisfy data pattern 0, then modify them to be so by changing 0 in them to be 1;

else, do nothing.

1.3 (Computing the resulting distortion) Calculate the mean square quantization error (MSQE) between the saved content MBo of the original macroblock

31

where i =1 and 2 represent the U channel and the V channel, respectively, and each of MBo and MBo

' means an 88 vector of coefficients.

where Speak means the maximum possible pixel value of the image.

1.5 Calculate the average PSNR value PSNRavg of the chroma color channels:

2 index to label the modified macroblock MB' in the following way:

if PSNRavg is smaller than the pre-selected threshold T, then set the the ROI map index value to be 1, meaning that macroblock MB is

data-embeddable;

else, use the default value of the ROI map index which is 0, meaning that macroblock MB is non-data-embeddable.

2. Increment the value C by one if the ROI map index is set to be 1.

3. Repeat Steps 1 and 2 until all macroblocks are processed.

In Step 2 above, if the ROI map index is set to be 1, it means that this macroblock can be used to embed data without causing intolerable distortion in the resulting macroblock. Also, the number C is used to specify the data hiding capacity

32

of this video sequence in unit of macroblock. In addition, the Parseval theorem [19]

states that mean square error (MSE) in the pixel domain is equivalent to the mean square quantization error (MSQE) in the DCT domain because the DCT is a normalized orthogonal transformation. So in Steps 1.3 and 1.4 above, we may also use the original PSNR definition described by Eq. (3.3) below to calculate the PSNR values:

where Speak means the maximum possible pixel value of the image.

With the data embedding capacity C computed, we can now describe the proposed method for data embedding as an algorithm in the following.

Algorithm 3.2 Process for embedding secret data into a WebM video.

Input: a video V, a secret key K, a random number generator f, and a secret message S.

2. (Randomizing the secret message) Transform the secret message S into a binary string B, use the secret key K as a seed to generate a sequence Q of random numbers using the random number generator f, and randomize B with Q to get a randomized binary string B'.

3. Calculate the total number N of macroblocks which are needed for embedding B'

33

by:

32 . the length of B'

N  (3.5)

4. Use the secret key K and the random number generator f to generate a sequence

RS of N random integer numbers with C as the maximum number in the

sequence, and sort them into an ascending order.

5. Divide B' into a linear array A of 4-bit segments.

Stage 2 --- embedding message data into the video.

6. Perform the following steps to embed message S into each unprocessed macroblock MB in every prediction frame of V, assuming V is large enough to embed the entire message.

6.1 Save the original quantized coefficients of the chroma color channels in

MB.

6.2 Check the coefficients of each subblock SB of the chroma color channels:

if the original coefficientsof SB do not satisfy data pattern 0, then modify them to be so by changing 0 in them to be 1;

else, do nothing.

6.3 Calculate the mean square quantization error (MSQE) between the saved content MBo of the original macroblock MB and the content MBo

' of the

modified macroblock MB' of the chroma color channels:

2

o o

( )

MSQEiMBMB (3.6)

where i =1 and 2 represent the U channel and the V channel, respectively, and each of MBo and MBo

' means an 88 vector of coefficients.

6.4 Calculate the value of the peak signal-to-noise ratio (PSNR) PSNRi of the chroma color channels for i = 1 and 2:

34

where Speak means the maximum possible pixel value of the image.

6.5 Calculate the average PSNR value PSNRavg of the chroma color channels:

2 index to label the modified macroblock MB' in the following way:

if PSNRavg is smaller than the pre-selected threshold T, then set the the ROI map index value to be 1, meaning that macroblock MB is

data-embeddable;

else, use the default value of the ROI map index which is 0, meaning that macroblock MB is non-data-embeddable.

6.7 Increment the value of a pre-defined random selection counter Cv by one if the ROI map index of this macroblock is set to be 1.

6.8 (Embedding the secret data patterns at random locations in the input video) If Cv is equal to the next unprocessed random number in RS (meaning that the currently macroblock is chosen randomly for message hiding), then conduct the following steps to embed eight 4-bit segments (=32 bits) of the message data; if not, go to Step 6.9.

(1) Take eight unprocessed 4-bit elements from A, denoted as A1 through A8, and for each element Ai, define for it a corresponding data pattern Pi such that if Ai = (b1

b

2

b

3

b

4)2 = d10, then Pi is just data pattern d (e.g., if Ai

= 10012 = 910, then Pi = data pattern 9).

(2) Check the coefficients of each of the eight corresponding subblocks of the chroma color channels with four in the U channel and the other four

35

in the V channel, denoted as SBj, j = 1, 2, …, 8:

if the original coefficientsof SBj do not match those of data pattern

P

i, then modify them to be so by changing those mismatching ones in SBj to be the corresponding ones of data pattern Pi; else, do nothing.

6.9 Embed an ending pattern in the next macroblock by setting its ROI map index to be 1 if the entire secret message in array A has been embedded (i.e., if all elements in A have been processed); otherwise, go to Step 6 to repeat the above process.

The random sequence RS generated in Step 4 above is used to represent positions where the secret message can be embedded. In the same step, the value N represents the number of macroblocks we need to embed the entire secret message. Selecting N elements from RS and using them in Step 6.8 means that the message data are embedded into random positions. By this way, we can reduce the opportunity for an attacker to get the secret message. Also, because the VP8 encoder always encodes frames in raster-scan order, we sort the N elements in an ascending order.

In Step 5, the proposed hiding method is based on the use of the 16 pre-defined data patterns, so we have to divide the randomized binary string B' into 4-bit segments to correspond to the 4-bit message data embeddable in the positive-sloped diagonal line of each data pattern. For example, if a string is 000111000101110000111000001110101111, after we divide the string into a data pattern array, the resulting elements in the data pattern array A are 1, 12, 5, 12, 3, 8, 3, 10, and 15. In Step 6.7, the initial value of the random selection counter is set to be 0.

In Step 6.9, the ending pattern is used to specify when to stop extracting message data in the extraction process.

36

Figure 3.5 A flowchart of embedding process.

37

3.3 Extraction of Secret Data from