103 CHAPTER IV: INTELLIGENT RANDOM IMAGE STEGANOGRAPHY 4.1. INTRODUCTION Of the spatial domain stego methods [5, 14, 76-80, 125, 169-171], the LSB embedding [14, 76-78, 169-171] scheme has been extensively used to hide secret data because of its simplicity and speed of implementation, which offers a higher concealment capacity [14, 16, 19, 47, 83, 172] and simultaneously, improved control over the quality of the stego-image [14, 169-171]. In the LSB embedding process, raster scans [3, 5, 14, 76, 78, 125, 202] and random scans [10, 77, 81, 191-193] have been adapted to hide the confidential data in the visited pixel. Between these two types of scan, the random scan is preferred over the raster scan to increase the level of complexity faced by the intruders. However, the real challenge lies in attaining a good imperceptibility of the stego-image and sharing the secret key for retrieving the original message. Chan et al. [169] proposed an Optimal Pixel Adjustment Process (OPAP) to enhance the quality of the stego-image by simple LSB substitution method through a raster scan. The OPAP tries to vary the value of Most Significant Bits (MSB) next to the k th bit, up to which the secret data are embedded. Yang [170] has proposed an LSB substitution method using the raster scan to improve stego-image quality by adapting an Inverted Pattern (IP) approach. In this technique, the secret message has been processed prior to embedding, i.e., some secret data are inverted and some are kept unaltered. The IP approach is believed to have a better image quality than that of OPAP. Although it yields a higher payload and image quality, it is still of concern because the approach has adapted the simple raster scan.
37
Embed
CHAPTER IV: INTELLIGENT RANDOM IMAGE STEGANOGRAPHY …shodhganga.inflibnet.ac.in/bitstream/10603/17471/13/13_chapter_04… · In the LSB embedding process, raster scans [3, 5, 14,
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
103
CHAPTER IV: INTELLIGENT RANDOM IMAGE STEGANOGRAPHY
4.1. INTRODUCTION
Of the spatial domain stego methods [5, 14, 76-80, 125, 169-171], the LSB
embedding [14, 76-78, 169-171] scheme has been extensively used to hide secret data
because of its simplicity and speed of implementation, which offers a higher concealment
capacity [14, 16, 19, 47, 83, 172] and simultaneously, improved control over the quality
of the stego-image [14, 169-171]. In the LSB embedding process, raster scans [3, 5, 14,
76, 78, 125, 202] and random scans [10, 77, 81, 191-193] have been adapted to hide the
confidential data in the visited pixel. Between these two types of scan, the random scan is
preferred over the raster scan to increase the level of complexity faced by the intruders.
However, the real challenge lies in attaining a good imperceptibility of the stego-image
and sharing the secret key for retrieving the original message.
Chan et al. [169] proposed an Optimal Pixel Adjustment Process (OPAP) to
enhance the quality of the stego-image by simple LSB substitution method through a
raster scan. The OPAP tries to vary the value of Most Significant Bits (MSB) next to the
kth
bit, up to which the secret data are embedded. Yang [170] has proposed an LSB
substitution method using the raster scan to improve stego-image quality by adapting an
Inverted Pattern (IP) approach. In this technique, the secret message has been processed
prior to embedding, i.e., some secret data are inverted and some are kept unaltered. The
IP approach is believed to have a better image quality than that of OPAP. Although it
yields a higher payload and image quality, it is still of concern because the approach has
adapted the simple raster scan.
104
Provos et al. [10] have proposed a hide-and-seek software technique for the
random selection of pixels for embedding secret data, thereby generating the stego-
image. In these random approaches, all the pixels of the cover image are not used to
conceal the secret data, which in turn affects the payload and the good imperceptibility.
Tuomas Aura [77] has proposed a stego method adapting a random embedding procedure
in which a stego key and a secure hash function are used to generate a sequence of unique
pixel addresses for embedding.
It has been established that the random or the raster scan-based stego techniques
are not preferable to achieve maximum stego-image quality, minimum key length and
greater complexity against intruders. Several of the proposed stego methods have
computed stego image quality by considering a particular type of confidential data. These
data may be text or numbers or even a combination of the two, but the available stego
methods do not consider the nature of the confidential data when enhancing the quality of
the stego image.
To overcome these limitations, two types of novel adaptive random k-bit
embedding stego methods are implemented with the aim of achieving higher
imperceptibility, higher payload, optimised key length and enormous complexity against
hackers by significantly considering the nature of the confidential data. In the first
method, by fixing raster scan as the traversing path, four different forms of same
confidential data — namely, binary, inverted binary, gray and inverted gray have been
adapted for embedding. Of the four versions, the version giving the least MSE is
embedded on a row-by-row basis. In the second proposed method, four different random
walks—namely, Z scan SFC, Hilbert SFC, Zigzag SFC and Moore SFC [191-193] are
105
considered for k-bit LSB embedding. Before embedding the confidential data, the cover
image considered has been divided into an equal number of repeated smaller blocks as
discussed in Chapter 3. During the embedding procedure, the four random scans have
been tested for k-bit embedding in each smaller block; the scan, which results in the
minimum MSE and maximum PSNR for that block, has been adapted for embedding.
The optimum random walk for each block of the entire image is identified and fixed.
Consequently, the pattern of each fixed random walk has been recorded and kept as the
secret key. In this way, the nature of the text and its matching with each block for
minimum MSE and maximum PSNR has been accomplished.
4.2. ADAPTIVE RANDOM METHOD 1: ENCODED CONFIDENTIAL DATA
A schematic diagram of the proposed method is given in Fig 4.1 and 4.2. Initially
the secret data or message is encrypted using Data Encryption Standard (DES) [1], which
is a symmetric key cryptography algorithm. The cover image is split into separate rows.
The order of rows considered for embedding data is chosen using a Pseudo Random
Number Generator (PRNG) with a chosen seed. For each row, a try is made to embed
binary and inverted binary form of data, gray and the inverted gray form of data. The
encoded form of the confidential information on the selected row, which offers minimum
MSE is chosen and fixed for the same.
106
This binary / inverted binary / gray and inverted gray data pattern is stored as
Inverted Pattern Key (IPkey). Thus, on an average MSE is reduced to a greater extent.
The Stego image, IPkey and the seed will be communicated to the receiver for data
retrieval.
Figure.4.1. Block diagram for confidential data embedding.
107
4.2.1. Algorithm for random k-bit adaptive embedding
Inputs:
1. Sampled cover image C
2. Secret data bit stream M
3. Key E for encryption
Outputs:
1. Stego image (S), containing embedded secret data
2. KEY (used for recovery)
Algorithm for embedding:
Step-1 : Encrypt the secret data (M) using DES with key E
Figure.4.2. Block diagram for confidential data extraction.
108
Step-2 : Let P = length of secret data stream M (in number of bits) obtained from Step-1
Step-3 : Split the cover image C into separate rows . Let N = Total number of rows
Step-4 : Generate an array of N pseudo-random numbers (PRN )in the range [0,N-1]
where each number occurs only once. Let the seed be stored in a text file
Step-5 : Invert the bit array M to give M . Encode the bit array M using Gray Code to
give G and invert G to give G
Step-6 : Let i=1 (Here, i is the row counter)
Step-7 : Select PRNG[i]th
block and perform the following operations
A .Selective Embedding
{ a. Let r = pixel index array (for traversal)
b. For ( j = 1 to length(r) ) do (Here j is the pixel counter)
{
i. Replace k LSBs of jth
pixel of the selected block with k bits
from M to give O[i,1]
}
c. Compute MSE.
d. For ( j = 1 to length(r) ) do (Here j is the pixel counter)
{
i. Replace k LSBs of jth
pixel of the selected block with k bits
from M to give O[i,2]
}
e. Compute MSE .
f. For ( j = 1 to length(r) ) do (Here j is the pixel counter)
{
i. Replace k LSBs of jth
pixel of the selected block with k bits
from G to give O[i,3]
}
g. Compute MSEGray.
h. For ( j = 1 to length(r) ) do (here j is the pixel counter)
{
i. Replace k LSBs of jth
pixel of the selected block with k bits
from G to give O[i,4]
}
g. Compute MSEGray .
h. If MSE is greatest,
KEY[i]=”00”
Else if MSE is greatest,
KEY[i]=”01”
Else if MSEGray is greatest,
KEY[i]=”10”
Else
KEY[i]=”11”
Assign MSE[i]=Minimum MSE.
}
109
B. Choose STEG[i] as the value of O for which MSE is minimum
C. P = P - k. (Reduce length as k bits have been embedded)
D. If P>0 then assign i=i+1. Else, goto step-8 (that is check whether message is
finished)
E. If i>N then goto step-8 (check whether End of file(EOF) is reached for cover
image)
F. Goto Step-7
Step-8 : Save the array STEG as the stego image array S
Step-9 : Save S into an image file and KEY in a text file
Step-10: Communicate S, KEY and seed used to generate PRNG
Recovery process
The same PRN sequence is generated using the received seed. Using the KEY, the
pattern is identified for different rows. Recovery modules are run to recover the secret.
The result is then decrypted using DES to get the secret message back
4.2.2. Algorithm for random k-bit adaptive recovery
Inputs:
1. Stego image (S), containing embedded secret data
2. Key E for decryption, KEY in text file from embedding process
3. Seed to generate PRNG
Output:
1. Secret data bit stream M
Algorithm for extraction
Step-1 : Split the stego image S into separate rows. Let N = Total number of rows
Step-2 : Generate a array PRNG of N pseudo-random numbers in the range [0,N-1]
where each number occurs only once.
Step-3 : Let i=1 (Here, i is the row counter)
Step-4 : Select PRNG[i]th
row and perform the following operations:
A. Get Message M using retrieval
B. If KEY[i,1]=”01”
M[i]= M [i]
Else if KEY[i,1]=”10”
M[i]=MGray[i]
Else if KEY[i,1]=”11”
M[i]= MGray [i]
110
Else
M[i]=M[i]
C. Assign i= i+1 (increment row count)
D. If i>N goto step-5 else goto Step-4
Step-5: Decrypt M using DES and write it to text file as output.
4.2.3. Mathematical model for row wise, inverted pattern LSB embedding
General Formulae
a. 1’s Complement of a number
xx k )12( (4.1)
where k = number of bits
x = number to be inverted in bits
x = 1’s complement of the number
for example, take a 4 bit binary representation of a number ‘2’ [0010] as x
here k = 4 so, 2)12( 4 x
= (16-1)-2
x = 13[1101] complement of [0010] ‘2’
b. LSB embedding
Si = Ci - Ci mod 2k + mi (4.2)
where k = number of bits to be embedded
Ci = Cover Pixel
Si = Stego Pixel
mi = k – bit message block in decimal
for example, let k = 4 Ci = 16[0001000] and mi is ‘2’ [0010] as mi
Si = 16- 16 mod 24 + 2
= 16-16mod16+2 = 18
Si = 18[00010010]
c. LSB recovery
mi = Si mod 2k (4.3)
where symbols are same as equation 2
Let Si = 18[00010010]
To extract the last 4[since k=4] bits, we have
mi = 18 mod 24 = 18 mod 16 = 2 [0010]
111
d. Four flavours of secret data
a. Plain data – m(i,j)
b. Inverted data - m (i, j)
c. Gray Coded data – g(i,j)
d. Inverted Gray Coded data – g'(i,j)
e. R rows
In each cover image, there are ‘R’ number of rows, each of same length D, where
R× D = Mc×Nc (4.4)
Where Mc×Nc are the dimensions of the cover image
Each row is denoted as ri , where i N and i R
i.e., Set of rows = {ri, i N and i R}
Each row ri is in turn a matrix, denoted as
ri = [ri1, ri2,……., riD] where i N and i R (4.5)
In other words, each row has D pixels.
f. Message data (secret) to be embedded [k bit length]
m(i, j) , where i = row identifier
j = Pixel inside a row
The complement of m (i, j) is denoted as m (i, j)
g. Embedding procedure
Let the cover image be C with Mc×Nc pixels.
Let it be divided into R blocks named ri, ri,……., riR , each having equal number of
pixels D
R x D = Mc×Nc (4.6)
Also , ri = [ri1, ri2,……., riD], where i N and i R
Let ‘k’ be the number of LSBs to be replaced in cover pixels
Let the secret message be a matrix M, where each elements of M is made up of k
bits
Then we can denote the message to be embedded in the ith
row, jth
pixel as m(i, j)
Let s(i, j) denote the stego value of jth
pixel in the ith
row, when message m(i, j) is
embedded in cover pixel rij.
Alternatively m (i, j) is embedded instead of m(i, j) then
112
the stego pixel is denoted as s (i, j) s(i, j) = rij-rijmod2
k+ m(i, j)(Applying equation 2) and (4.7)
s (i, j) = rij-rijmod2k+ m (i, j)( Applying equation 1)
sg(i,j) = rij-rijmod2k+ g(i, j)
sg'(i, j) = rij-rijmod2k+ g'(i, j)
If we consider R blocks of stego image as s1,s2,…………..sR
Then,
si = s(i) or s (i) or sg(i) or sg'(i) where MSE is minimum and s(i) = { s(i, j) , j N
and j D }
key matrix is denoted as
K = [K1,K2,……..KR]
Where Ki is chosen based on the following conditions
00 – if m(i,j) is embedded
01 – if m ʹ(i, j) is embedded
10 – if g(i,j) is embedded
11 – if gʹ (i,j) is embedded
h. Retrieval procedure
Key matrix is denoted as
K = [K1,K2,……..KR]
The preliminary, unprocessed message mu (i,j) can be extracted from pixels in
stego image as :-
mu (i,j) = s(i,j) mod 2k from equation (3)
the actual message m(i,j) can be extracted by processing mu (i,j) as follows
m(i,j) is chosen from the following conditions based on Ki value.
mu(i,j) - if corresponding Ki=00
(2k – 1) – mu(i,j) , if Ki =01
g-1(i,j) , if Ki=10 (if g-1 denotes inverse of gray code function)
g'-1(i,j) = (2k – 1) – g-1(i,j) ( if Ki=11 )
(if g'-1 denotes inverse of inverted gray code function)
4.2.4. Worst case MSE
The worst case MSE for a block with D pixels is defined as
MSEw (i) =
D
jD 1
1(2
k – 1)
2
= D
-1 [D (2
k – 1)
2 ]
113
= (2k – 1)
2 (4.8)
MSE for ith
row, when m(i) (actual data) is embedded, is given as
D
j
jicjisDiMSE1
21 )),(),(()(
When inverted data m (i) is embedded, then, MSE for the same parameters is
denoted as
D
j
jicjisDiMSE1
21 )),(),(()(
When gray coded data g(i) is embedded, then MSE for the same parameter is
denoted as
D
j
gg jicjisDiMSE1
21 )),(),(()(
When inverse gray coded data gʹ(i) is embedded, then MSE for the same
parameter is denoted as
D
j
g jicjisDigMSE1
21 )),(),(()(
According to the embedding procedure, minimum MSE is chosen. The minimum