You are on page 1of 6

ENHANCING SECURITY IN IMAGE

STEGANOGRAPHY USING EDGE


DETECTION METHOD
Renuka B, Roushan A K, Shanti Priya K
Kings Engineering College, Anna university, IT

Abstract- We consider an edge detection method to find The following are the criteria of the edge
the edge of the image and then hide our secret message
detection method. The first and most obvious is low
using LSBMR technique. Cover image is cropped and
then rotated, secret message is then embedded in the error rate. It is important that edges occurring in
rotated image. The process is reversed in order to place images should not to be missed and that there be NO
the cropped image in its original position; now the stego responses to non-edges. The second criterion is that
image looks exactly same as the cover image. Thus our the edge points be well localized. In other words, the
work is highly secure. distance between the edge pixels as found by the
detector and the actual edge is to be at a minimum. A
Keywords- Steganography, cover image, stego image, third criterion is to have only one response to a single
LSBMR, Edge detection method. edge. This was implemented because the first 2 were
not substantial enough to completely eliminate the
INTRODUCTION
possibility of multiple responses to an edge.
According to many different methods for
communication now-a-days, and as a result of In Practice, two properties, undetectability
spreading the Internet all around the world, and embedding capacity, should be carefully
motivation of hiding secret message in different considered when designing a Steganographic
multimedia and secure communication via Internet is algorithm. Usually, the larger payload embedded in a
increased. Steganography is one of the most popular cover, the more detectable artifacts would be
ways for secret communication which differs introduced into the stego. In many applications, the
inherently with cryptography. In both methods, secret most important requirement for Steganography is
message is transformed between two groups, undetectability, which means that the stegos should
transmitter and receiver. However, the main purpose be visually and statistically similar to the covers
in cryptography is to make massage concept while keeping the embedding rate as high as possible.
unintelligible. So eavesdroppers could not guess its
concept, while steganography aims to hide secret Unlike LSB replacement and LSBM, which
message and secret communication. In steganography deal with the pixel values independently, LSB
secret message can be hidden in voice, video, text matching revisited (LSBMR) uses a pair of pixels as
and image. an embedding unit, in which the LSB of the first
pixel carries one bit of secret message, and the
Images that are used for inserting and hiding relationship (odd–even combination) of the two pixel
secure data are called ‘cover image’ and the image values carries another bit of secret message. In such a
where secret bits are inserted is called ‘stego image’. way, the modification rate of pixels can decrease
from 0.5 to 0.375 bits/pixel (bpp) in the case of a
Edges characterize boundaries and are maximum embedding rate, meaning fewer changes to
therefore a problem of fundamental importance in the cover image at the same payload compared to
image processing. Edges in images are areas with LSB replacement and LSBM.
strong intensity contrasts – a jump in intensity from
one pixel to the next. Edge detecting an EDGE DETECTOR ALGORITHM
image significantly reduces the amount of data and Based on the above criteria, the canny edge
filters out useless information, while preserving the detector first smoothes the image to eliminate and
important structural properties in an image. noise. It then finds the image gradient to highlight
regions with high spatial derivatives. The algorithm

1
then tracks along these regions and suppresses any (columns) and the other estimating the gradient in the
pixel that is not at the maximum (non maximum y-direction (rows). They are shown below:
suppression). The gradient array is now further
reduced by hysteresis. Hysteresis is used to track The magnitude, or EDGE STRENGTH, of the
along the remaining pixels that have not been gradient is then approximated using the formula:
suppressed. Hysteresis uses two thresholds and if the
magnitude is below the first threshold, it is set to zero |G| = |Gx| + |Gy|
(made a nonedge). If the magnitude is above the high
threshold, it is made an edge. And if the magnitude is
between the 2 thresholds, then it is set to zero unless
there is a path from this pixel to a pixel with a
gradient above T2.

A. Step 1
In order to implement the edge detector
algorithm, a series of steps must be followed. The
first step is to filter out any noise in the original
image before trying to locate and detect any edges. C. Step 3
And because the Gaussian filter can be computed
using a simple mask, it is used exclusively in the Finding the edge direction is trivial once the gradient
algorithm. Once a suitable mask has been calculated, in the x and y directions are known. However, you
the Gaussian smoothing can be performed using will generate an error whenever sum X is equal to
standard convolution methods. A convolution mask is zero. So in the code there has to be a restriction set
usually much smaller than the actual image. As a whenever this takes place. Whenever the gradient in
result, the mask is slid over the image, manipulating a the x direction is equal to zero, the edge direction has
square of pixels at a time. The larger the width of the to be equal to 90 degrees or 0 degrees, depending on
Gaussian mask, the lower is the detector's sensitivity what the value of the gradient in the y-direction is
to noise. The localization error in the detected edges equal to. If GY has a value of zero, the edge direction
also increases slightly as the Gaussian width is will equal 0 degrees. Otherwise the edge direction
increased. The Gaussian mask used in my will equal 90 degrees. The formula for finding the
implementation is shown below edge direction is just:
theta = invtan (Gy / Gx)
D. Step 4
Once the edge direction is known, the next step is to
relate the edge direction to a direction that can be
traced in an image. So if the pixels of a 5x5 image are
aligned as follows:
x x x x x
x x x x x
x x a x x
x x x x x
x x x x x

Then, it can be seen by looking at pixel ‘a’, there are


B. Step 2 only four possible directions when describing the
After smoothing the image and eliminating the surrounding pixels - 0 degrees (in the horizontal
noise, the next step is to find the edge strength by direction), 45 degrees (along the positive
taking the gradient of the image. The Sobel operator diagonal), 90 degrees (in the vertical direction),
performs a 2-D spatial gradient measurement on an or 135 degrees (along the negative diagonal). So now
image. Then, the approximate absolute gradient the edge orientation has to be resolved into one of
magnitude (edge strength) at each point can be found.
these four directions depending on which direction it
The Sobel operator uses a pair of 3x3 convolution
masks, one estimating the gradient in the x-direction is closest to (e.g. if the orientation angle is found to
2
be 3 degrees, make it zero degrees). Think of this as of T2 to start but you don't stop till you hit a gradient
taking a semicircle and dividing it into 5 regions. below T1.

a. Before applying algorithm b. After applying algorithm

The above show the images before and after


applying the algorithm. Thus the edge of the image is
successfully found and then message will be
Therefore, any edge direction falling within embedded.
the yellow range (0 to 22.5 & 157.5 to 180 degrees)
is set to 0 degrees. Any edge direction falling in LSBMR STEGANOGRAPHY
the green range (22.5 to 67.5 degrees) is set to 45 In the data embedding stage, the scheme
degrees. Any edge direction falling in the blue first initializes some parameters, which are used for
range (67.5 to 112.5 degrees) is set to 90 degrees. subsequent data preprocessing and region selection,
And finally, any edge direction falling within the red and then estimates the capacity of those selected
range (112.5 to 157.5 degrees) is set to 135 degrees. regions. If the regions are large enough for hiding the
given secret message, then data hiding is performed
E. Step 5 on the selected regions. Finally, it does some post
processing to obtain the stego image. Otherwise the
After the edge directions are known, non maximum scheme needs to revise the parameters, and then
suppression now has to be applied. Non maximum repeats region selection and capacity estimation until
suppression is used to trace along the edge in the can be embedded completely.
edge direction and suppress any pixel value (sets it
equal to 0) that is not considered to be an edge. This Please note that the parameters may be
will give a thin line in the output image. different for different image content and secret
message . We need them as side information to
f. Step 6 guarantee the validity of data extraction. In practice,
such side information (7 bits in our work) can be
Finally, hysteresis is used as a means of embedded into a predetermined region of the image.
eliminating streaking. Streaking is the breaking up of In data extraction, the scheme first extracts the side
an edge contour caused by the operator output information from the stego image. Based on the side
fluctuating above and below the threshold. If a single information, it then does some preprocessing and
threshold, T1 is applied to an image, and an edge has identifies the regions that have been used for data
an average strength equal to T1, then due to noise, hiding. Finally, it obtains the secret message
there will be instances where the edge dips below the according to the corresponding extraction algorithm.
threshold. Equally it will also extend above the
threshold making an edge look like a dashed line. To In this paper, we apply such a region adaptive
avoid this, hysteresis uses 2 thresholds, a high and a scheme to the spatial LSB domain. We use the
low. Any pixel in the image that has a value greater absolute difference between two adjacent pixels as
than T1 is presumed to be an edge pixel, and is the criterion for region selection, and use LSBMR as
marked as such immediately. Then, any pixels that the data hiding algorithm. The details of the data
are connected to this edge pixel and that have a value embedding and data extraction algorithms are as
greater than T2 are also selected as edge pixels. If follows.
you think of following an edge, you need a gradient
A. Data Embedding

3
• Step 1: The cover image of size of is first on the secret key , until all the hidden bits are
divided into non overlapping blocks of extracted completely. For each qualified embedding
pixels. For each small block, we rotate it by a random unit, say, , where ,we
degree in the range of as extract the two secret bits as follows:
determined by a secret key . The resulting image
is rearranged as a row vector by raster scanning.
And then the vector is divided into non overlapping
embedding units with every two consecutive pixels
, where assuming is We eventually get the secret bits by
an even number.

Two benefits can be obtained by the random


rotation. First it can prevent the detector from getting
the correct embedding units without the rotation key
, and thus security is improved. Furthermore,
both horizontal and vertical edges (pixel pairs) within
the cover image can be used for data hiding.

• Step 2: According to the scheme of LSBMR, 2


secret bits can be embedded into each embedding
unit. Therefore, for a given secret message, the
threshold for region selection can be determined as
follows. Let be the set of pixel pairs whose absolute
differences are greater than or equal to a parameter

Proposed scheme. (a) Data embedding. (b) Data extraction.


Then we calculate the threshold by

EXPERIMENTAL RESULTS
where , is the size of the secret In this section we will show our
message , and denotes the total number of elements experimental results. From the edge its pixel value is
in the set of . Please note that when, the proposed found out and the following process will take place as
method becomes the conventional LSBMR scheme, follows.
which means that our method can achieve the same
Specific cropping position is given
payload capacity as LSBMR (except for 7 bits).
accordingly to the image. Image will get cropped in
B. Data Extraction that position in the size of 200 × 200 pixel. In the
Cropped region, rotate it by a random degree in the
To extract data, we first extract the side range of {0, 90, 180, 270} now after rotation, text
information, i.e., the block size and the threshold will be embedded in a particular pixel value.
from the stego image. We then do exactly the same The following examples will explains how
things as Step 1 in data embedding. The stego image the data is embedded in the image pixel value.
is divided into blocks and the blocks are
then rotated by random degrees based on the secret
key . The resulting image is rearranged as a row
vector . Finally, we get the embedding units by Ex1:
dividing into non overlapping blocks with two
Let the message is welcome
consecutive pixels.
w è ASCII è 119 è binary value è 1110111
We travel the embedding units whose
absolute differences are greater than or equal to the bits 1110111
threshold according to a pseudorandom order based
4
Particular position (50 ,52) è pixel value è 4272668 c. Cropped image

First bit è 1 Thus after successfully cropping the image


is rotated and then the secret message is embedded.
Pixel value is 4272668è %2 è 0

Therefore add one to the pixel value: è 4272668.

Ex2:

Let the message is welcome

c è ASCII è 99 è binary value è 1100011

bits 1100011

Particular position (50 , 118) è pixel value è 1328993 d. Rotated image

First bit è 1

Pixel value is 1328993è %2 è 1

Therefore don’t change the pixel value è 1328993.

e. Stego image

Thus our experimental results has shown


that the stego image is exactly the same as the cover
a. Cover image image. Thus our work is highly secure.

The number of embedding regions of the


images differs accordingly to the images and their
respective edges. When the image has more number
of colors it will contain more no of edge.

For our experimental work, we have


considered 4 images and their respective edges.

b. Edge of the cover image

a. Car (edges=11933) c. Eye (edges=1538)

5
b.House(edges=10023) d. Nokia(edges=7790)\ [8] A. D. Ker, “Steganalysis of LSB matching in grayscale
images,” IEEE Signal Process. Lett., vol. 12, no. 6, pp.
441–444, Jun. 2005.

[9] M. Kharrazi, H. T. Sencar, and N. Memon, “Cover


selection for steganographic embedding,” in Proc. IEEE
12000 Int. Conf. Image Processing, Oct. 8–11, 2006, pp. 117–120.

[10] J. Fridrich, M. Goljan, and R. Du, “Steganalysis based


10000
on JPEG compatibility,” in Proc. Special Session on
Theoretical and Practical Issues in Digital Watermarking
8000 and Data Hiding, Multimedia Systems and Applications IV.
Denver, Co: , 2001, pp. 275–280.
6000
[11] G. Schaefer andM. Stich, “UCID: An uncompressed
4000 color image database,” Proc. SPIE Electronic Imaging,
Storage and Retrieval Methods and Applications for
2000 Multimedia, vol. 5307, pp. 472–480, 2003.

[12] S. Pereira, S. Voloshynovskiy, M. Madueno, S.


0
Marchand-Maillet, and T. Pun, “Second generation
Car House Eye Nokia benchmarking and application oriented evaluation,” in
column chart representing the difference between the images and
their respective edges Proc. 4th Int. Workshop on Information Hiding, 2001, vol.
2137, pp. 340–353.
CONCLUSION
[13] S. Voloshynovskiy, A. Herrigel, N. Baumgaertner, and
Visual quality and security of our stego images T. Pun, “A stochastic approach to content adaptive digital
are improved significantly compared to typical LSB- image watermarking,” in Proc. 3th Int. Workshop on
based approaches and their edge adaptive versions. Information Hiding, 1999, vol. 1768, pp. 211–236.
Furthermore, it is expected that our adaptive idea can
be extended to other Steganographic methods such as
audio/video Steganography.

REFERENCES

[1] J. Mielikainen, “LSB matching revisited,” IEEE Signal


Process. Lett., vol. 13, no. 5, pp. 285–287, May 2006.

[2] A. Westfeld and A. Pfitzmann, “Attacks on


steganographic systems,”in Proc. 3rd Int. Workshop on
Information Hiding, 1999, vol. 1768, pp. 61–76.

[3] J. Fridrich, M. Goljan, and R. Du, “Detecting LSB


steganography in color, and gray-scale images,” IEEE
Multimedia, vol. 8, no. 4, pp. 22–28, Oct. 2001.

[4] S. Dumitrescu, X.Wu, and Z.Wang, “Detection of LSB


Steganography via sample pair analysis,” IEEE Trans.
Signal Process., vol. 51, no. 7, pp. 1995–2007, Jul. 2003.

[5] A. D. Ker, “A general framework for structural


steganalysis of LSB replacement,” in Proc. 7th Int.
Workshop on Information Hiding, 2005, vol. 3427, pp.
296–311.

[6] A. D. Ker, “A funsion of maximum likelihood and


structural steganalysis,” in Proc. 9th Int. Workshop on
Information Hiding, 2007, vol.4567, pp. 204–219.

[7] J. Harmsen and W. Pearlman, “Steganalysis of additive-


noise modelable information hiding,” Proc. SPIE Electronic
Imaging, vol. 5020, pp. 131–142, 2003.

You might also like