Você está na página 1de 11

A Secure Spatial Domain Image

Steganography Using Genetic Algorithm


and Linear Congruential Generator

Pratik D. Shah and R.S. Bichkar

Abstract Significant increase in data traffic over the Internet has given rise to
many data security issues. Steganography is a technique which is used to hide the
existence of secret communication. Hence, it is extensively used to solve the issues
related to data security. In this paper, a secure and lossless spatial domain image
steganography technique is proposed. Stream of secret data is hidden in quarter part
of image by identifying suitable locations to hide 2 bits of secret data in each pixel,
resulting in generation of coefficients corresponding to the location of match. These
coefficients are hidden in remaining part of image using LSB replacement
steganography. Genetic algorithm is used to find best possible location to hide these
coefficients in the image, making the proposed technique very secure and almost
impossible to extract secret data from it. The result of the proposed technique is
compared with LSB replacement steganography where in same amount of secret
data is embedded. It is observed that the proposed technique is much superior as
compared to LSB steganography. It provides improvement in MSE and PSNR
values; in addition, the degradation in histogram is also minimal thus eliminating
histogram attack. Average PSNR value of stego-image obtained from proposed
technique is 53.11 dB at two bits per pixel data embedding rate compared to 52.21
obtained by LSB technique.

Keywords Genetic algorithm (GA)  LSB steganography  Steganalysis

P.D. Shah (&)  R.S. Bichkar


G. H. Raisoni College of Engineering and Management, Pune, Maharashtra, India
e-mail: shahpratik219@gmail.com
R.S. Bichkar
e-mail: rajankumar.bichkar@raisoni.net

© Springer Nature Singapore Pte Ltd. 2018 119


S.S. Dash et al. (eds.), International Conference on Intelligent Computing
and Applications, Advances in Intelligent Systems and Computing 632,
https://doi.org/10.1007/978-981-10-5520-1_12
120 P.D. Shah and R.S. Bichkar

1 Introduction

Steganography is an art of hiding the existence of secret communication [1]. In


steganography, huge amount of secret data is hidden in cover media to conceal it
from the attack of eavesdropper’s and unauthorized persons [2]. Steganography can
be done in many digital file formats e.g. video, text, image, audio, etc., but the
formats with high degree of redundancy are more suitable. In image steganography,
secret data is hidden inside a normal image. The secret information can be in any
file format such as text, image, excel file [3]. The image used for hiding the data is
called as cover image, and the image obtained after embedding the secret data onto
the cover image is called as stego-image. The main aim of steganography is to
reduce the difference between stego-image and cover image so that it can conceal
the existence of any secret communication. The performance of an image
steganography technique is mostly evaluated using four parameters viz. imper-
ceptibility, payload capacity, robustness and security [1]. Imperceptibility is the
ability of a steganography technique to be undetected by visual inspection. Payload
capacity is the amount of secret data that can be hidden inside the cover image.
Robustness is the resistance of steganography technique against image manipula-
tion attacks like cropping, scaling, rotation, compression. Security is the ability of
steganography system to resist the attacks of steganalysis system. Steganalysis is
study of detecting messages hidden using steganography [4].
Image steganography can be categorized as spatial domain steganography and
transform domain steganography. In spatial domain image steganography tech-
nique, the data hiding is performed directly on the pixel values of the cover image.
Spatial domain techniques include methods which operate at bit level such as bit
insertion and noise manipulation [5]. Transform domain techniques utilize the
domain-specific characteristics of image to embed data on it. The image is first
transformed to frequency domain using numerous transforms like DCT, DFT,
DWT, curvelet transform, contourlet transform [6]. In these techniques, the data is
embedded on the coefficients of transformed image instead of direct pixels and then
the image is retransformed to spatial domain.
In last decade, enormous amount of work is carried out in the field of image
steganography but very few studies have explored the use of metaheuristic and
stochastic optimization operators in improving the result of steganography. Kanan
and Nazeri [7] proposed genetic algorithm-based image steganography technique in
which they used genetic algorithm to find the proper locations in cover image to
hide secret data. The data was hidden using LSB replacement steganography, GA
was used to find out starting location and direction for data embedding. The output
was tunable, i.e. it generated various different stego-images, any one of which can
be selected based on desired results and application. Average PSNR value of
45.12 dB was obtained during various experiments. Wang et al. [8] proposed a
secure steganographic method to bypass RS steganalysis attack. Data is hidden in
first LSB bit of the image, and second LSB bit is modified so that image by passes
RS attack. Genetic algorithm is used to search for best adjustment matrix which is
A Secure Spatial Domain Image Steganography … 121

used to modify second LSB of image so that the stego-image bypasses RS analysis
and also provide a better PSNR value. Average PSNR value of 41.2 dB was
obtained during various experiments. Nosrati et al. [9] proposed a before embed-
ding steganographic scheme. In this technique, the secret information is hidden in
image segments of cover image. Genetic algorithm is used to find the suitable
locations in cover image to embed the secret information.
The rest of the paper is organized as follows: Sect. 2 briefly explains genetic
algorithm. The proposed algorithm is explained in detail in Sect. 3. Experimental
results and discussion are presented in Sect. 4. Section 5 concludes the paper.

2 Genetic Algorithm

Genetic algorithm is biologically motivated metaheuristic technique used to solve


both constrained and unconstrained optimization problems. It is population-based
approach driven by the principle of natural evolution based on Darwin’s theory [10].
Each population is potential solution for a given search and optimization problem.
Fitness function is used to assess the quality of each possible solution. The solution
with high fitness value will survive and form a new population of the next gener-
ation. Genetic algorithm operators like reproduction, crossover and mutation are
used to obtain new generations. It is an iterative process which is carried out till the
desired result is obtained or till the number of predetermined iterations is reached.
Over successive iterations the population evolves towards a near-optimal solution.

3 Proposed Technique: Optimally Mapped Least


Significant Bit Replacement Steganography

Proposed technique is a modified variant of LSB replacement steganography. In


this technique, secret data is not hidden using LSB replacement method but instead
a new approach called data mapping is proposed. In data mapping, two bits of
secret data are embedded in every pixel. In grey scale image, each pixel consists of

Fig. 1 Co-efficient Embedding position Coefficient


generation (‘**’ indicates the
location at which the secret 010001** 0
data is embedded) 01000**0 1
0100**00 2
010**100 3
01**0100 4
0**00100 5
**000100 6
*100010* 7
122 P.D. Shah and R.S. Bichkar

eight bits, so there are eight possible locations for mapping the secret data bits on
each pixel of cover image. Based on location of match, we generate corresponding
coefficients, as illustrated in Fig. 1.
If there is no match between secret data bits and cover image pixel, then these
bits are embedded in LSBs of cover image pixel. It is mostly possible to embed two
bits of secret data in each pixel without changing its value. However to successfully
recover the secret data, we should know the value of coefficients. We propose to
hide these coefficients in the unused part of image using genetic algorithm to find
the most optimal embedding locations.
Figure 2 illustrates the proposed mapping process with the help of an example in
which 4 bytes of secret data is embedded in 4  4 cover image. Figure 2a shows
four bytes of secret data and its binary representation. Figure 2b shows 4  4 cover
image and its binary representation along with the position of match between secret
data and cover image pixel highlighted. Figure 2c shows the coefficients generated
by mapping.
In proposed technique, secret data is embedded in 1/4th part of the image and rest
part of the image is used to save the coefficients generated from data mapping. For a
grey scale image with 256  256 resolution, we can use 128  128 pixels to hide
the secret data; hence, the resultant data embedding capacity is 2  128  128 =
32,768 bits. In this case, a matrix of size 128  128 is generated for the coefficients.
From Fig. 2c, it can be observed that value of coefficients is in the range of 0–7;
hence, each coefficient requires 3 bits for embedding. The coefficients matrix is split
into three-bit planes. These three-bit planes are optimally embedded in LSBs of

(a)
13 98 57 129 0000110 1 0110001 0 0 01 1 1 0 0 1 1 0 0 0 0 0 01

(b)
57 59 62 68 00111001 00111011 00111110 01000100
71 73 58 97 01000111 01001001 00111010 01100001
47 56 98 78 00101111 00111000 01100010 01001110
67 68 98 125 01000011 01000100 01100010 01111101

(c)
1 6 1 2
2 2 6 4
6 3 0 3
5 0 2 0

Fig. 2 Proposed mapping process to hide secret data in cover image. a Secret data and its binary
representation. b Cover image (4  4 pixels) and its binary representation. c Generated coefficient
matrix
A Secure Spatial Domain Image Steganography … 123

remaining 3/4th part of image using genetic algorithm. The task of finding an optimal
match between coefficient matrix and LSBs of cover image is modelled as search and
optimization problem. Genetic algorithm is employed to solve this search and
optimization problem. Each bit plane of coefficient matrix is divided into blocks of
size 8  8 yielding 256 blocks. An optimal sequence of 256 numbers is searched to
embed these blocks of coefficients in the rest of image. Linear congruential generator
(LCG) is used to generate a pseudo-random sequence, and genetic algorithm is used
to modify the parameters which control the result of LCG. LCG requires initial seed
value, a multiplying factor and an offset to generate sequence of m numbers; it is
illustrated in Eq. 1. Xn + 1 is the value of next integer in the sequence, Xn is the
value of present integer, a is the multiplying factor, c is the offset value and m is the
length of sequence.

Xn þ 1 ¼ ða  Xn þ cÞ mod m ð1Þ

Various sequences can be generated with different values of a, Xn and c. The


proposed algorithm uses the sequence generated by LCG to embed the coefficients
on cover image. The sequence generated may not be the best sequence to embed
coefficients on cover image; hence, we use genetic algorithm to control the
parameters and generate new solutions which might be more suitable.
Genetic algorithm is a population-based method; hence, every population is a
possible solution to the search and optimization problem. The proposed chromo-
some consists of three genes as depicted in Fig. 3.
Each gene in the proposed chromosome is of 8 bits. These three genes are used
to control the sequence generated by LCG. The first gene of the chromosome is
multiplier which is of eight-bit length, second is offset and third one is initial seed
X0, both of them are of eight-bit length. Initial seed X0 decides the initial value of
the pseudo-random sequence.
Initial population is selected randomly. The population size is set to hundred,
and these population will fight for their existence and also to seed populations in
next generation. The efficiency of each individual is evaluated using fitness func-
tion. In this case, fitness function is defined as the number of optimally mapped
coefficients values on the LSBs of cover image. More the similarity between the
coefficients value and the LSBs of cover image more the fitness of a population. We
randomly choose five populations and based on fitness of these populations two are
selected to seed next generation. We use crossover and mutation operators to obtain
next generation populations. This process is repeated until all the populations are
chosen to compete with each other in tournament selection competition. The pro-
cess of generating new solutions is repeated till 50 iterations.

Fig. 3 Chromosome
structure
Multiplier (a) Offset (c) Initial seed (X0)
124 P.D. Shah and R.S. Bichkar

Algorithm for embedding data in cover image


1. Map two bits of secret data on each cover image pixel and generate coefficient
based on position of match.
2. Hide the data in 1/4th part of image and generate coefficients for the same.
3. Divide the coefficients matrix in three-bit plane.
4. Divide each bit plane into blocks of size 8  8.
5. Generate pseudo-random sequence using LCG.
6. Use GA to optimize parameters of LCG to generate a sequence which produces
optimal match between coefficients and LSBs of cover image.
7. Obtain the final chromosome after 50 iterations and hide it as a secret key.
Algorithm for extracting secret data from stego-image
1. Obtain secret key which is chromosome of GA.
2. Generate pseudo-random sequence using the secret key and LCG.
3. Extract data from LSBs of cover image in the sequence obtained by LCG to get
bit planes coefficient matrix.
4. Obtain all the three-bit planes and combine them to obtain coefficient matrix.
5. Extract secret data from the 1/4th part of image using coefficient matrix.
The proposed method is a lossless method because it does not have any bit error
rate. The security of algorithm is very high because it is difficult for anyone to
extract secret data from stego-image as knowledge of secret key is necessary to get
the sequence used to hide the coefficients.

4 Experimental Results and Discussion

To perform experiment, we have selected standard grey scale test images. The
resolution of cover image is 256  256, and the secret data is also a grey scale
image with resolution 64  64. The performance of proposed technique is com-
pared with 2-bit LSB replacement steganography with same data embedding
capacity. To perform experimentation, Matlab 8.1 version was used. MSE and
PSNR of stego-images are obtained by Eqs. 2 and 3, respectively, where M and
N are total number of rows and columns in the image, respectively. Xij and Yij are
pixel values of ijth location of original image and stego-image, respectively.

1 XM X N  2
MSE ¼ Xij  Yij ð2Þ
MN i¼1 j¼1

ð255Þ2
PSNR ¼ 10  log10 ð3Þ
MSE
A Secure Spatial Domain Image Steganography … 125

Fig. 4 Test images used in experiment. a–e Cover images (baboon, lena, barbara, house and
cameraman). f Secret data image (boat)

Subjective analysis and histogram analysis are also performed on the results
obtained from the both techniques. The test images used for experimentation are
shown in Fig. 4. Five natural images are chosen as cover images; they are Baboon,
Lena, Barbara, House and Cameraman. Boat image is used as secret data image.

4.1 Imperceptibility Analysis

Imperceptibility analysis is done to measure the amount of change in original image


during the process of data embedding. In imperceptibility analysis, the stego-image
obtained from LSB replacement steganography and proposed technique are com-
pared with respect to MSE and PSNR parameters. MSE is the cumulative squared
error between original image, i.e. cover image and stego-image. MSE values should
be as less as possible, lesser the value of MSE better the imperceptibility. On the
other hand, PSNR is used to obtain peak signal to noise ratio. PSNR value of
stego-image should be as greater as possible, since high PSNR value will ensure a
better visual quality of stego-image.
Table 1 shows a comparison of MSE and PSNR values of proposed technique
and LSB replacement technique at 2 bits per pixel data embedding rate. In this
experiment, boat image is used as secret data image for all five cover images.
126 P.D. Shah and R.S. Bichkar

Table 1 Comparison of the proposed technique with LSB steganography (the boat image is used
as secret data)
Cover image Proposed technique LSB replacement
MSE PSNR MSE PSNR
Baboon 0.23 54.43 0.39 52.18
Lena 0.38 52.33 0.39 52.20
Barbara 0.27 53.80 0.40 52.17
House 0.35 52.64 0.38 52.27
Cameramen 0.37 52.36 0.39 52.23

Fig. 5 PSNR values of stego-images

Fig. 6 Stego-images:
a Baboon stego-image
obtained from LSB
steganography, b Baboon
stego-image obtained from
proposed technique, c Lena
stego-image obtained from
LSB steganography, d Lena
stego-image obtained from
proposed technique
A Secure Spatial Domain Image Steganography … 127

The results clearly suggest the superiority of proposed optimally mapped LSB
technique over LSB replacement technique. The PSNR values of stego-image
obtained from proposed techniques are higher compared to LSB steganography for
various images which prove the efficiency of proposed technique. The MSE value
of all stego-images obtained from proposed technique is less than 0.38 which
undoubtedly indicates that there is very less amount of deviation between cover
image and stego-image. Hence, it can be said that proposed technique is highly
imperceptible. Figure 5 illustrates the comparison between PSNR values of
stego-image obtained from proposed technique and LSB replacement steganogra-
phy for various images. Figure 6 shows the stego-images obtained from LSB
steganography and proposed technique for Baboon and Lena image.

4.2 Histogram Analysis

In histogram analysis, the distortion between histogram of cover image,


stego-image obtained from LSB replacement steganography and proposed opti-
mally mapped LSB technique is compared. Baboon image is selected to perform
histogram analysis. The histogram of cover image, stego-image obtained from
proposed method and LSB technique is shown in Figs. 7, 8 and 9, respectively.
It can be observed that there is a huge amount of variation in histogram
of stego-image obtained from LSB replacement steganography and histogram of
original image, whereas the proposed technique produced very less amount of
distortions in the histogram of stego-image. Histogram analysis of proposed tech-
nique would not generate any suspicion regarding existence of secret message in the
stego-image since it does not generate any typical pattern in histogram. However on
the other hand, histogram analysis of LSB steganography makes the existence of

Fig. 7 Histogram of original cover image


128 P.D. Shah and R.S. Bichkar

Fig. 8 Histogram of stego-image obtained from proposed technique

Fig. 9 Histogram of stego-image obtained from LSB replacement technique

secret data very evident because its stego-image produces a step pattern. In this step
pattern, one pixel value of histogram is suppressed and the adjacent value is
increased which can be easily detected by histogram analysis.

5 Conclusion

This paper proposes a genetic algorithm-based lossless spatial domain image


steganography scheme with special emphasis on security. The result of the pro-
posed optimally mapped LSB technique illustrates its superiority over LSB
replacement steganography in both subjective and objective analysis. The proposed
A Secure Spatial Domain Image Steganography … 129

technique is highly imperceptible since it causes very less changes in stego-image


making it extremely difficult to detect the existence of secret data by visual
inspection. The proposed technique is extremely secure since the secret data
embedded in stego-image cannot be extracted by without the knowledge of secret
key. Even if the secret key is obtained the sequence generation is challenging and
further more challenging is to use the sequence to extract secret data from image.
In this paper, histogram analysis of stego-images obtained from both techniques
is also performed. Histogram analysis reveals the weakness of LSB replacement
technique against histogram attack as it generates a particular pattern which may
arouse suspicion to the eavesdropper. On the other hand, the proposed technique
produces very less changes in histogram of stego-image; hence, it is robust against
histogram attack. Future work will be focused on improving the time complexity of
proposed technique and also on exploring possibility of using other sequence
generators which provide more control over the generation of sequence.

References

1. Cheddad A., Condell J., Curran K. and Mc Kevitt P.: Digital Image Steganography: Survey
and Analysis of Current Methods. Signal Processing, vol. 90, no. 3, pp. 727–752, (2010).
2. Chugh G., Yadav R. and Saini R.: A New Image Steganographic Approach Based on Mod
Factor for RGB Images. International Journal of signal processing, image processing, and
pattern recognition, vol. 7, no. 3, pp. 27–44, (2014).
3. Subhedar M.S. and Mankar V.H.: Current status and key issues in image steganography: A
survey. Computer science review, vol. 13, pp. 95–113, (2014).
4. Fridrich J., Goljan M. and Du R.: Reliable detection of LSB steganography in color and
grayscale images. In Proceedings of the 2001 workshop on Multimedia and security: new
challenges, pp. 27–30, (2001).
5. Li B., He J., Huang J. and Shi Y.Q.: A survey on image steganography and steganalysis.
Journal of Information Hiding and Multimedia Signal Processing, vol. 2, no. 2, pp. 142–172,
(2011).
6. Chanu Y. J., Tuithung T. and Singh K.M.: A short survey on image steganography and
steganalysis techniques. In Proceedings of 3rd National Conference on Emerging Trends and
Applications in Computer Science, pp. 52–55, (2012).
7. Kanan H.R. and Nazeri B.: A novel image steganography scheme with high embedding
capacity and tunable visual image quality based on a genetic algorithm. Expert Systems with
Applications, vol. 41, no. 14, pp. 6123–6130, (2014).
8. Wang S., Yang B. and Niu X.: A secure steganography method based on genetic algorithm.
Journal of Information Hiding and Multimedia Signal Processing, vol. 1, no. 1, pp. 28–35,
(2010).
9. Nosrati M., Hanani A. and Karimi R.: Steganography in Image Segments using Genetic
Algorithm. In proceedings of Fifth International Conference on Advanced Computing &
Communication Technologies, pp. 102–107, (2015).
10. Goldberg and David E.: Genetic algorithms. Pearson Education India, (2006).

Você também pode gostar