You are on page 1of 10

PIXEL REPLACEMENT TECHNIQUE

USING
STEGANOGRAPHY
-A HIGH LEVEL SECURITY THROUGH OBSCURITY-
BY
P.VINCENT PAUL & A.M.VIGNESH,
BE, Third year, Paavai college of engineering,
Affiliated to Anna university-Coimbatore
Namakkal -18.

Presented by:

P.VINCENT PAUL, (III-BE), E.mail:vincentpvp89@gmail.com, Contact: 9443217887.


A.M.VIGNESH, (III-BE), E.mail:vignesham.ece@gmail.com, Contact: 9585278358.

Elecronics and Communication Engineering


Paavai College OF Engineering
Namakkal

PIXEL REPLACEMENT TECHNIQUE


USING
STEGANOGRAPHY
-A HIGH LEVEL SECURITY THROUGH OBSCURITY-
BY
P.VINCENT PAUL & A.M.VIGNESH
BE, Third year, Paavai college of engineering,
Affiliated to Anna university-coimbatore
Namakkal -18.

CONTENTS: So, to deceive the hackers, people have started


to follow a technique called ‘Steganography’. It
1. ABSTRACT is not an entirely new technique and has been in
2. STEGANOGRAPHY DEFINITION the practice from ancient times. In this method,
3. HISTORY OF STEGANOGRAPHY the data is hidden behind unsuspecting objects
4. STEGANOGRAPHY TYPES like images, audio, video etc. so that people
4.1 Physical Steganography cannot even recognize that there is a second
4.2 Digital Steganography message behind the object. Images are
4.3 Blog Steganography commonly used in this technique.
4.4 Printed Steganography
In this paper, we have proposed a technique for
5. STEGANOGRAPHY TECHNIQUES hiding data secretly behind images. The existing
5.1 EMBEDDING A FILE techniques for image Steganography have some
5.2 STGANALYSIS serious drawbacks and we have tried to
overcome those with ours. Here, the pixels in
6. DRAWBACKS OF CURRENT the images are replaced with the new ones,
TECHNIQUE which are almost identical to the old ones, in a
manner that can be used to retrieve back the
7. PIXEL REPLACEMENT TECHNIQUE hidden data.
7.1 THE ALGORITHM
2. STEGANOGRAPHY:
8. IMPLEMENTATION
9. ADVANTAGES Steganography is a term used to describe files
10. FUTURE STEGANOGRAPHY that have other types of files secretly embedded
11. CONCLUSION inside. Usually, when we talk about
Steganography, we mean the embedding of a
1. ABSTRACT: text file, or a secret message, inside an image.
Not only is the message itself hidden, but the
As we know, the field of cryptography has got fact that a message exists is hidden. It is in this
more attention nowadays. More and more way that steganography is a method of
complex techniques for encrypting the concealing the fact that communication is taking
information are proposed every now and then. place in addition to actually concealing a file.
But, as usual, when a small step is made to
improve the security, more work is done in the “The goal of Steganography is to hide messages
opposite direction by the hackers to break it. inside other harmless messages in a way that
Thus they are able to attack most of these does not allow any enemy even to detect that
algorithms and that too, successfully. there is a second secret message present.”
The advantage of steganography over Development following that was slow, but has
cryptography is that messages do not attract since taken off, going by the number of 'stego'
attention to themselves. Plainly visible programs available: Over 725 digital
encrypted messages. No matter how steganography applications have been identified
unbreakable and will arouse suspicion, and may by the Steganography Analysis and Research
in themselves be incriminating in countries Center.
where encryption is illegal. Therefore, whereas
cryptography protects the contents of a message, Content-Aware Steganography hides
steganography can be said to protect both information in the semantics a human user
messages and communicating parties. assigns to a datagram. These systems offer
security against a non-human adversary/warden.
3. HISTORY:
The first recorded uses of steganography can be 4.3 BLOG-STEGANOGRAPHY:
traced back to 440 BC when Herodotus Messages are fractionalized and the (encrypted)
mentions two examples of steganography in The pieces are added as comments of orphaned web-
Histories of Herodotus. Demaratus sent a logs (or pin boards on social network
warning about a forthcoming attack to Greece platforms). In this case the selection of blogs is
by writing it directly on the wooden backing of the symmetric key that sender and recipient are
a wax tablet before applying its beeswax using; the carrier of the hidden message is the
surface. Wax tablets were in common use then whole blogosphere.
as reusable writing surfaces, sometimes used for
shorthand. Another ancient example is that of 4.4 PRINTED STEGANOGRAPHY:
Histiaeus, who shaved the head of his most Digital steganography output may be in the
trusted slave and tattooed a message on it. After form of printed documents. A message, the
his hair had grown the message was hidden. The plaintext, may be first encrypted by traditional
purpose was to instigate a revolt against the means, producing a ciphertext. Then, an
Persian. innocuous covertext is modified in some way to
But now in digital era the term as to contain the ciphertext, resulting in the
steganography is used in computer stegotext. For example, the letter size, spacing,
communications. And provides high typeface, or other characteristics of a covertext
vulnerablity to attacks. can be manipulated to carry the hidden message.
Only a recipient who knows the technique used
4. STEGANOGRAPHIC TYPES: can recover the message and then decrypt it.
Francis Bacon developed Bacon's cipher as such
4.1 PHYSICAL STEGANOGRAPHY: a technique.

Hidden messages on paper written in secret


inks, under other messages or on the blank parts 5. STEGANOGRAPHIC
of other messages. TECHNIQUES IN COMPUTERS:
Messages written in morse code on knitting yarn
and then knitted into a piece of clothing worn by How Steganography is done in terms of
a courier. computers? There are several ways, some of
Messages written on the back of postage stamps. which become very complicated to understand.
The steganographic techniques in computers
4.2 DIGITAL STEGANOGRAPHY: involve
• Embedding a file
Modern steganography entered the world in • Steganalysis
1985 with the advent of the personal computer
applied to classical steganography problems.
being used for JPEG compression, but they
come into play in steganography as well. In a
JPEG file, the image is made up of these
coefficients, and when a file is
steganographically embedded into a JPEG
image, the relation of these coefficients is
altered. Instead of actual bits being changed like
5.1 EMBEDDING A FILE: in LSB steganography, it is the relation of the
coefficients to one another that is altered,
LEAST SIGNIFICANT BIT holding a secret message.
STEGANOGRAPHY:
One simple method is LSB, or Least 5.2 STEGANALYSIS:
Significant Bit Steganography. An image is Stegananalysis means the way a
nothing more than strings and strings of bytes, stegonagraphic image is detected. Remember, it
each byte representing a different color. The last is not just the message within the image that is
few bits in a color byte, however, do not hold as being searched; it is the fact that a hidden file
much significance as the first few. This is to say exists within the image that is most important to
that two bytes that only differ in the last few bits find. Stegananalysis can sometimes (but, very
can represent two colors that are virtually rarely) be done using visual detection. Visual
indistinguishable to the human eye. For detection simply means using ones eye to
example, 00100110 and 00100111 can be two literally look at the image to see if any visible
different shades of red, but since it is only the changes have occurred. Since the original image
last bit that differs between the two, it is is almost never known, however, it proves
impossible to see the color difference. LSB difficult to compare an image with an embedded
Steganography, then, alters these last bits by file with what it looked like beforehand. This
hiding a message within them. task of simple visual detection is easier,
however, if there is not a gradual change of
color in the image.

Statistical analysis is what is frequently used in


steganography detection. This is done using
advanced statistics techniques. Basically what is
REAL PIXEL EMBEDDED PIXEL done is the color pairs in an image are
COLOR COLOR
measured, meaning it is observed how close
each color in the image to its adjacent color.
These two colors, which do not differ greatly,
are known as a close color pair. In a
steganographic image, the occurrence of each
LSB individual color approaches the occurrence of its
color pair. This is to say that the individual
REPLACED PIXELS (NOT VISIBLE colors become less different when a file is
COMMONLY) embedded into the image. The occurrences of
these colors are measured using statistics.
DISCRETE COSINE TRANSFORM
STEGANOGRAPHY:
Another method of steganography RQP (RAW QUICK PAIRS) METHOD:
involves using the DCT (Discrete Cosine One specific technique is the RQP
Transform) coefficients in JPEG files. DCT (Raw Quick Pairs) Method. In this method, the
coefficients are more frequently thought of as ratios between the close color pairs and all color
pairs are measured in an image. Then, a pixels will be scanned for a possible
message is deliberately embedded in the image relation which will be used to trace out
and the same measurements are taken again. If the actual characters.
there is a large difference between the two  Only 24 bit messages are suitable and 8
measurements, then it is unlikely a message has bit images are to be used at great risk.
been embedded in the original.  Extreme Care needs to be taken in the
selection of the cover image, so that
changes to the data will not be visible in
the stego-image.
 Commonly known images, such as
famous paintings must be avoided.

Observe the following two images [FIGURE 2].


The one on the left is the original image, and the
one on the right is the same image with a text 7. THE PIXEL REPLACEMENT
file embedded in it. The change is easy to detect TECHNIQUE:
visually, since the color changes in the original Because of the drawbacks in the currently
image are not gradual. When there is a followed techniques, we propose a new
noticeable contrast between the colors, it technique for hiding data in images. Here, we
becomes easier to detect an embedded file. replace the existing pixels in the image with the
new ones in such a way that no difference is
visible between the steganographed and the
original image.

7.1 THE ALGORITHM:


Encoding:
The Algorithm used for encoding in
this technique can be described with the
following steps.
A.ORGINAL IMAGE 1. Get the Image, Message to be hidden and the
Password.
2. Encrypt the message and the password.
3. Move some rows below the first row in the
image and fix a reference position near the left
edge for odd characters and near the right for
even characters.
4. For each character in the original data do find
a position corresponding to that character search
B.EMBEDDED IMAGE
the surrounding pixels and find a pixel value
FIGURE-2
closer to all of them replace the current pixel
and the reference pixel with this value move to
the next row.
6. DRAWBACKS IN THE CURRENT 5. Set a pixel value as a threshold.
TECHNIQUES: 6. Repeat steps 4 and 5 for the Password from
the bottom of the image.
 Extremely liable to attacks like Image
Manipulation techniques where the
Decoding:
The Algorithm for retrieving the
original message from the steganographed
image follows this sequence.

1. Get the Image and the Password.


2. Move to the bottom row in the image where
password hiding starts.
3. Find the value of the reference pixel.
4. Search the entire row for the same pixel 8. IMPLEMENTATION:
value.
5. Find the position of that pixel and decode the With the algorithm described in
character. brief, let us describe the pixel replacement
6. Repeat steps 3 thro 5 till the threshold is technique in detail. First, we shall see how the
reached. original message and the password are hidden
7. Concatenate all the characters found so far into the image and then we’ll discuss how to
(Actual Password). retrieve message for the authorized person who
8. If the found password does not match the knows the correct password.
given password return as error.
9. Move to the top row in which the first STEP 1: Encrypting the Message & Password:
character of original data was stored. First, the original message and the
10. Repeat the sequence followed in steps 3 to 7 password are got from the user. Then, they are
to get the original message. encrypted using any of the encryption
11. Display the result. algorithms like RSA, DES etc. This encryption
step is an additional safety feature added to the
technique to ensure maximum safety. Then, this
encrypted message is fed as the input to the next
step.

Original message: “GOD IS GREAT”


Encryption type : RSA or DES
After encryption : “TAERG SI DOG”
Image:

[Image splited into pixels]

STEP 2: Choosing a position to hide the


character:
The actual process of Steganography
starts here. The Image is scanned from the top
row – wise. First few rows are omitted and a
suitable row is reached. The message is
split into individual characters. The following
process is repeated for all the characters in the
message. A position for hiding the character is
chosen according to some relation with that
character. The relation can be something like the
ASCII value of the character, the order of
occurrence of that character in the Alphabetical
or Reverse order if it is an alphabet etc.
For example, the position of the
character ‘G’ can be chosen as:
ASCII Value of ‘G’ = 71,
So, position = 71 – 50 = 19.
(Only e.g. any value instead of 50 can be used) Pixels where data is stored

STEP 3: Finding a Suitable Color:


Once a position is chosen, the values
of all the pixels surrounding the pixel in that
position are found. Since this position is usually
not near the edge of the image, there will be 8
pixels surrounding it. A pixel value, i.e., a color,
is chosen so that it does not differ much from
those of the 8 pixels. This is the most difficult
step in the whole process. The value will differ
only by a small value. Such a small change in
the color will be indiscernible to the users.
STEP 5: Setting a Threshold:
The final step in hiding the message
is to set a threshold pixel in a fixed position to
indicate the end of the encrypted message. This
is essential for decoding the message from the
image. Otherwise, we cannot find the end of the
message.

STEP 4: Replacing the pixels:


Now, with the color to be replaced
being found, it’s time to replace the pixels with
the new color. A position near to the left side of
the row is fixed as the reference position for the
odd numbered character i.e., the 1st, 3rd, 5th
character and so on. Similarly, for the even
STEP 6: Hiding the Password:
numbered characters, a position close to the
The same steps of choosing the color,
right side of the row is selected as the reference
replacing the pixels and setting a threshold are
position. These reference positions are the same
repeated for hiding the password but the only
for all the characters. When the reference
difference is that the image is scanned row –
position is chosen, the pixel in that position is
wise from the last row instead of from the first
replaced with the new color. Then, the pixel in
row.
the already found position for the character (in
our e.g., this is 19) is also replaced with the new
color.

STEP 7: Retrieving the Message:


The process of retrieving the original
message from the steganographed image is
similar to that of the hiding process except in
the reverse order. First, the password is got from
the user. The image is scanned from the last row
and the row in which the password hiding
started is reached. The reference pixel value is
found and the position of that color in that row
is noted. Then, again the relation used
previously for finding the position is used to get
the original character. This can be explained as:
If the position is 19, then
19 + 50 = 71,
The character of ASCII value 70 is ‘G’.
Similarly, the other characters are found till the 10. FUTURE OF
threshold is reached and all of them are STEGANOGRAPHY:
concatenated to get the original password. Now, Steganography is still a fairly new
the given password and the original are checked idea. There are constant advancements in the
and if they match, then further processes are computer field, suggesting advancements in the
done, otherwise, an error message is displayed. field of steganography as well. It is likely that
If the password matches, then the image is there will soon be more efficient and more
scanned from the top and the starting row from advanced techniques for steganalysis. A hopeful
where the data hiding started is reached. The advancement is the improved sensitivity to
same steps of finding the reference pixel and the small messages. Knowing how difficult it is to
position of the other pixel are repeated again till detect the presence of a fairly large text file
the threshold. Then, all the characters are joined within an image, imagine how difficult it is to
and the original message is displayed. detect even one or two sentences embedded in
an image! It is like finding a microscopic needle
in the ultimate haystack. What is scary is that
such a small file of only one or two sentences
may be all that is needed to commence a
terrorist attack. In the future, it is hoped that the
technique of steganalysis will advance such that
it will become much easier to detect even small
messages within an image.
9. ADVANTAGES OF PIXEL
REPLACEMENT TECHNIQUE:
 Cost of cracking the hidden message is
extremely high.
 The data cannot be easily decoded
without the key using Image 11. CONCLUSION:
Manipulation techniques. To overcome the drawbacks in the existing
 Any type of image, 8 or 24 bits can be cryptography and Steganography
used. Techniques, we have proposed a new technique
 There is no increase in the size of the for hiding data in images. This technique is less
image due to data in it. prone to attacks and since the data is strongly
 There are no constraints on the choice of encrypted and the cost of retrieving it by
the image. unauthorized persons is extremely high. Since
the pixels are replaced with almost identical
pixels, it is difficult even to identify that there is
a second message hidden. So, we hope that this
technique will be used widely in the future.

REFERENCES
[1]. “Steganography” by Markus Kahn,
Steganography Mailing List.
[2]. “Network and Internetwork Security” by
William Stallings, Addison-
Wesley.
[3]. “Steganography” by Dorian A. Flowers
Xavier, University of Louisiana
[4]. http://www.thur.de/ulf/stegano
[5]. http://www.cs.uct.ac.za
[6]. http://www.jjtc.com/stegdoc
[7]. “Privacy on the net - steganography”,
Michael Berkowitz.
[8].http://www.tamos.com/privacy/steganoen.ht
m.

You might also like