Professional Documents
Culture Documents
ON
2
INTRODUCTION TO
STEGNOGRAPHY
Introduction to Stegnography
Digital communication is essential part in everyone life. Often it is
desired that communication should be secret Two techniques are
available to accomplish this goal the Cryptography and the
Steganography.
In Cryptography the sender encrypts the message with a key and the
encrypted message is sent to receiver over an insecure communication
channel. On the other side, the receiver decrypts the received
encrypted message with a key and extracts the original message. The
key for sender and receiver can be same or different.
Huffman
Table
AC
Zig-zag Huffman
reordering coding
Color
88 Quantizer JPEG
components
DCT bit-stream
(Y, Cb, or Cr)
Difference Huffman
DC Encoding coding
Quantizatio
n
Table Huffman
Table
The following equations are used to compute the RGB values from
YCbCr .
R = Y + 1.371 (Cr 128)
G = Y 0.698 (Cr 128) 0.336 (Cb 128) (2)
B = Y + 1.732 (Cb 128)
These values ranges from -128 to +127 for Y, Cb and Cr, for R, G, B
in range 0 to 255
7
The JPEG Process
The following is an overview of the JPEG process.
2.Working from left to right, top to bottom, the DCT is applied to each
block.
8
The JPEG Process
Image Blocks :The pixels of each colour component are organized in
groups of (8 x 8) pixels (or data units). If the number of image rows
and columns is not a multiple of 8, the bottom row and the rightmost
column are duplicated as many times as necessary
The DCT Equation :The DCT equation given below computes the i,jth
entry of the DCT of an image.
1 N 1 N 1
( 2 x 1)i ( 2 y 1) j
D (i, j ) C (i ) C ( j ) P ( x, y ) cos cos
2N x 0 y 0 2N 2N
(3)
1
C (u ) if u is 0, else 1 if u 0
2
P(x, y) is the x,yth element of the image represented by the matrix P. N
is the size of the block that the DCT is done on. The equation
calculates (i,jth) entry of the transformed image from the pixel values
of the original image matrix. For the standard 8x8 block that JPEG
compression uses, N equals 8 and x and y range from 0 to 7
9
The DCT Matrix
1
Ti , j if i = 0
N
2 (2 j 1)i (4)
Ti , j cos if i > 0
N 2N
For an 8x8 block it results in this matrix:
10
Doing the DCT on an 8x8 Block
Since an image comprises hundreds or even thousands of 8x8 blocks of
pixels, the following description of what happens to one 8x8 block is a
microcosm of the JPEG process; what is done to one block of image
pixels is done to all of them. Because the DCT is designed to work on
pixel values ranging from -128 to 127, the original block is levelled
off by subtracting 128 from each entry to get matrix M.
Now perform the Discrete Cosine Transform, which is accomplished
by matrix multiplication.
D = T M T
11
Quantization
This block matrix now consists of 64 DCT coefficients, Dij, where i
and j range from 0 to7.The top-left coefficient, D00, correlates to the
low frequencies of the original image block. As one moves away from
D00in all directions, the DCT coefficients correlate to higher and
higher frequencies of the image block, where D77 corresponds to the
highest frequency.
Quantization :Quantization is achieved by dividing each element in
the transformed image matrix D by the corresponding element in the
quantization matrix, and then rounding to the nearest integer value. For
the following step, quantization matrix Q50 is used.
Di , j
Ci, j round
Q
i, j
12
Coding
all coefficients of C are converted by an encoder to a stream of binary
data (01101011...). After quantization, it is quite common for most of
the coefficients to equal zero. JPEG takes advantage of this by
encoding quantized coefficients in the zig-zag sequence shown in
Figure below .The advantage lies in the consolidation of relatively
large runs of zeros, which compress very well. The sequence in Figure
2 below (4x4) continues for the entire 8x8 block. The JPEG specifies
two entropy-coding methods: Huffman coding and arithmetic coding .
13
Fig 2. zig-zag sequence
THE PROPOSED
HIDING SYSTEM
The Proposed Hiding System
This stage includes two parts
1. Cryptography
2. Steganography
16
Modified Fibonacci Series Decoding (MFSD)
The DCT quantized coefficients value will be represented as sum of
non consecutive Modified Fibonacci number. For example Binary
and Modified Fibonacci number presentation of value 26 is given
below
17
Modified Fibonacci Series Decoding (MFSD)
Removing ambiguity in conversion of number into modified
Fibonacci number
Every single number can be represented in many different ways using
modified Fibonacci representation. For example the number 22 can be
represented using modified Fibonacci number into 000001000110 or
000000110110
000001000110 as 18+3 +1=22
000000110110 as 11+7 +3+1=22
To remove such ambiguity this thesis makes use of the following
algorithm, by using this algorithm there will be only one representation
in modified Fibonacci number for a given value
Given an array L (Modified Fibonacci array) having following values
L= [199 123 76 47 29 18 11 7 4 3 1 2]
18
Modified Fibonacci Series Decoding (MFSD)
NUM is the input number which has to be Convert into modified
Fibonacci number and SOL is the resultant array which will hold the
modified Fibonacci binary representation and its initial values are
SOL=[0 0 0 0 0 0 0 0 0 0 0 0]; This algorithm will convert
NUM into SOL (Modified Fibonacci representation).the steps are as
follow
Step1 Read the Number NUM for conversion and initialize i with
value 1 i.e. i=1;
Step2 repeat steps 3 to 5 while i<=12
Step 3 SOL[i]=NUM/L[i]
Step 4 NUM=NUM%L[i]
Step 5 Increment value I by one i.e. i=i+1;
Step 6 Display SOL
Step 7 End
Here / is integer division operator and % is modules or remainder
operator 19
Modified Fibonacci Series Decoding (MFSD)
A 7 bit encoder/decoder is proposed for generating stego image. It
takes 7 bits (b7, b6, b5, b4, b3, b2, b1) LSB of DCT quantized
coefficients by using modified Fibonacci representation as inputs
and produces 3 bits of outputs f3, f2, and f1. Figure 3 shows the
encoder/decoder generator.
21
0
0
1 1 1 1 0 1 1
1
0
24
Image preprocessing
In the second phase the proposed method use JPEG Image
preprocessing method upon cover image. For this partition a cover-
image O into non overlapping blocks of 8 X 8 pixels, and then use the
DCT(Discrete cosine transform) to transform each block into DCT
coefficients. The DCT coefficients are then scaled with a modified
quantization table. The quantization table is listed in Fig below. This
table is notably different from the quantization table of JPEG.
This is because the secret 16 11 10 16 1 1 1 1
message will be embedded in the 12 12 14 1 1 1 1 55
middle-frequency part of the 14 13 1 1 1 1 69 56
quantized DCT coefficients. This 14 1 1 1 1 87 80 62
new quantization table is obtained 1 1 1 1 68 109 103 77
by changing middle elements by 1 1 1 64 81 104 113 92
one in original quantization table. 1 1 78 87 103 121 120 101
1 92 95 98 112 100 103 99
26
Secret message embedding
In the third phase, the secret message will be embedded in the
middle frequency part of the quantized DCT coefficients for each
block Oi.
27
Secret message embedding
This method embeds S1,S2 and S3 into C1[0,4], S4,S5 and S6 into
C1[0,5], S7,S8 and S9 into C1[0,6], S10,S11 and S12 into C1[0,7], S13,S14
and S15 into C1 [1,3], and so on. The embedding order is listed in Fig 5
below
So each 8 x 8 pixel
block hides 26 x 3bit=78
bit encrypted message
29
Message Extracting Stage
The extracting procedure contains three phases.
After receiving the JPEG stego-image from the encoder, decode the
compressed data in the JPEG file by using the inverse entropy coding.
The JPEG stego-image file contains a quantization table and all the
compressed data. The inverse JPEG entropy coding contains Huffman
decoding and Run-Length decoding. Each block Ci can be
reconstructed after all the compressed data are decoded.
30
Message Extracting Stage
Next, extract the secret bits from the 26 middle-frequency coefficients
Ci[0,4],Ci[0,5],Ci[0,6],Ci [0,7], Ci[1,3],Ci[1,4],Ci[1,5],Ci[1,6],Ci[2,2],
Ci [2,3], Ci [2,4], Ci [2,5], Ci [3,1], Ci [3,2],Ci [3,3],Ci [3,4],Ci [4,0],
Ci [4,1], Ci [4,2], Ci [4,3], Ci [5,0], Ci [5,1], Ci [5,2], Ci [6,0], Ci [6,1],
and Ci [7,0],
The proposed method then imports the secret key k to the decryption
method to decrypt the secret message. Finally, the extraction of the
original message M is achieved.
31
TEST AND RESULTS
Test and Results
The testing is performed by taking the secret text of varying length and
the cover-image (Polar Bear Image) (256*173). Figure 6.1 shows the
cover image before encryption and hiding. Figure 6.2 shows the stego-
image after extracting and decryption. Figure 7.1 and 7.2 shows same
test with another image (Fighter Jet Image).
33
Fig. 6.1Polar Bear Image Before Stegnography Fig. 6.2.Polar Bear Image After Stegnography
Fig. 7.1. FighterJet Image Before Stegnography Fig. 7.2 Fighter Jet Image after Stegnography
Fig. 8. Graph Showing Result SNR versus No of character in text file for LSB and proposed DCT
for Polar Bear Image
Fig. 9. Graph Showing Result SNR versus No of character in text file for LSB and proposed DCT
for FighterJet Image
Fig. 10. Graph Showing Result PSNR versus No of character in text file for LSB and proposed
DCT for Polar Bear Image
Fig. 11. Graph Showing Result PSNR versus No of character in text file for LSB and proposed
DCT for FighterJet Image
Test and Results
Average Percentage Average Percentage
Image
Change for SNR Change for PSNR
39
Rreferences
[1] W. Stallings, Cryptography and Network Security: Principles and
Practice, third ed., Pearson Education, New Jersey, 2003.
[2] N. F. Johnson and S. Katzenbeisser, .A survey of steganographic
techniques, Information Hiding, pp.43-78. Artech House,
Norwood, MA, Journal,2000.
[3] Lou, D. C. and Liu, J. L.. Steganography Method for Secure
Communications. Elsevier Science on Computers& Security, 21,
5:pp. 449-460, 2002.
[4] J. Fridrich and M. Goljan,Practical steganalysis of digital images-
state of the art, Proc. SPIE Photonics West, San Jose, California,
Vol. 4675, pp. 1-13, Jan. 2002.
[5] Moerland, T., Steganography and Steganalysis, Leiden Institute
of Advanced Computing Science,www.liacs.nl/home/
tmoerl/privtech.pdf
40
41