Madf
Madf
Prepared By:
Project Advisor:
Karachi - 75270
2
Prepared By:
Project Advisor:
Mrs. Uzma Parveen
ACKNOWLEDGEMENTS
First of all we would like to thank Almighty Allah for enabling us to complete this
project. We would also like to express our sincere gratitude to our project external
advisor Dr. Ghazanfar Monir. His knowledge of Steganography and digital signal
processing proved an enormous help.
We would also like to thank our internal advisor Ms Uzma Parveen and the IT for all of
their help.
ABSTRACT
For years, people have tried to communicate by hidden means. When trying to be
discrete in sending messages, one desires not to attract attention of unwanted people
so as to ensure privacy.
This project pursues the art of information hiding, and it creates software that
provides means of communication in a discrete manner. The technique we implied
here is Image Steganography.
Contents
CHAPTER 1........................................................................................................................................ 1
INTRODUCTION................................................................................................................................. 1
1.1 HISTORY............................................................................................................................................1
1.3 OBJECTIVE......................................................................................................................................... 5
CHAPTER 2........................................................................................................................................ 8
2.1 STEGANOGRAPHY................................................................................................................................8
2.4.2 CODING:.......................................................................................................................................25
CHAPTER 3...................................................................................................................................... 30
3.1.1 ENCODING:...................................................................................................................................30
3.1.2 DECODING:...................................................................................................................................31
3.2.4 ANALYSIS:.....................................................................................................................................44
CHAPTER 4...................................................................................................................................... 50
CHAPTER 5...................................................................................................................................... 69
CONCLUSION................................................................................................................................... 69
REFERENCES.................................................................................................................................... 71
APPENDICES:................................................................................................................................... 72
Chapter 1
INTRODUCTION
This chapter highlights the basic need of Steganography for information security and
the potential dangers to communication from intruders.
One of the reasons that intruders can be successful is because they know that secret
communication between two parties is taking place. Intruders may find ways to reveal
the information to others, modify it to misrepresent an individual or organization, or
use it for illegal purposes. In addition, the rapid growth of publishing and
broadcasting technology also require an alternative solution in hiding information.
The copyright such as audio, video and other source available in digital form may lead
to large-scale unauthorized copying. One solution to this problem is through the use
of Steganography. Steganography is a technique of hiding information in digital
media. In contrast to cryptography, it is not to keep others from knowing the hidden
information but it is to keep others from thinking that the information even exists.
1.1 History
The word steganography comes from the Greek Steganos, which means covered or
secret and –graphy mean writing. Therefore, steganography means, covered writing.
The use of Steganographic techniques have been used for centuries. The earlier forms
of these techniques were crude. Over time these techniques improved, increasing
speed, capacity and security of the transmitted message.
CHAPTER 1 2 INTRODUCTION
Greek historian Herodotus recorded the first use of Steganography. When Histiaeus
sent a message to his son in law, he shaved the head of a servant, tattooed the
message on the scalp and waited till the servants hair had regrown to dispatch him.
Another record was of Demeratus, who scraped wood with message and covered it
with wax so the message was undetectable.
Invisible ink has always been a popular form of Steganography. Ancient Romans
wrote between lines using invisible ink made of substances such as milk and fruit
juices. When heated, the secret message would become visible. GasperiSchottiwrote
the first book on Steganography called Steganographica.
Figure1.1
The major applications of Steganography are Data Hiding where the aim is to prevent
the message being detected by any other party, and Copyright Marking, where the
message to be inserted is used to assert copyright over a document.
There are many ways in which information can be hidden in digital media including
least significant bit embedding, digital watermarking and wavelet decomposition
algorithms.
The publishing and broadcasting industries have become interested in techniques for
hiding encrypted copyright marks and serial numbers in digital films, audio
recordings, books and multimedia products.
Digital watermarking is described as one of the possibilities to close the gap between
copyright issues and digital distribution of data. It is mainly based on Steganographic
techniques and enables useful safety mechanisms.
It acts as a very good medium for copyright issues as it embeds a symbol or a logo in
the form of a watermark, which cannot be altered manually
Steganography pays attention to the degree of Invisibility i.e. how well the
information is hidden in the cover image while watermarking is interested in the
robustness of the message and its ability to withstand attacks. The main purpose of
Steganography is to conceal data while that of watermarking is to prevent
transformation to the data.
The basic model of steganography consists of Carrier, Message and Password. Carrier
is also known as cover object, in which the message is embedded and serves to hide
the presence of the message. Basically, the model for steganography is shown
in Figure 1.2.
Figure 1.2
Message is the data that the sender wishes to remain confidential. It can be plain
text, cipher text, other image, or anything that can be embedded in a bit stream such
as a copyright mark, a covert communication, or a serial number. Password is known
as stego-key, which ensures that only recipient who knows the corresponding
decoding key will be able to extract the message from a cover-object. The cover-
object with the secretly embedded message is then called the stego-object.
1.3 Objective
The Internet as a whole does not use secure links, thus information in transit may be
vulnerable to interception as well. The importance of reducing a chance of the
information being detected during the transmission is being an issue now days. So, a
fundamental requirement of Steganography is that the hidden message carried by
stego-media should not be sensible to human beings. The other goal of
steganography is to avoid drawing suspicion to the existence of a hidden message.
This project will provide a solution in order to pass information in a manner that the
very existence of the message is unknown in order to repel attention of the potential
attacker. This will be achieved by embedding data invisibly in a digital image. Such an
approach of hiding information in digital media can be extended to copyright
protection Steganography, watermarking etc. The project will focus on
implementation of Steganographic tools for hiding information includes text and
image files using MATLAB.
The output of this project will be prototype software that can invisibly embed a secret
message to an image and can extract the embedded information if an image with
data embedded is provided to it. The emphasis will be to encode the secret
information in a manner such that its existence is concealed since the method of
Steganography fails if it causes someone to suspect the carrier medium.
Chapter 1: It will provide a general introduction to the project and its goals. It also
gives the history of the steganographic techniques used in different eras of time. In
the end it shows the breakdown of the report’s content.
Chapter 2: This section will provide an overview of the main areas of research that
were undertaken in preparation for the design and implementation section of the
project. It is hoped that the reader will gain an insight into the topics researched. It
will also provide a detailed account of the different hiding techniques and the
encryption algorithm devised over the course of the project.
Chapter 3: This section provides the basic methodology of the designed prototype
software. It will give an idea of the progression of one technique to the next.
Chapter 4: Will evaluate the techniques and algorithms used in the project.
Chapter 5: Conclusion
Chapter 2
2.1 Steganography
The growing possibilities of digital communications need the special means of security
especially on computer network. The network security has become more important
as the number of data being exchanged on the Internet increased. Therefore, the
secrecy and data integrity are required to protect against this has resulted in
remarkable growth of the field of information hiding.
Nowadays, large-scale copying of digital media such as audio, video files has become
common. This is because the digital format allows providing high image quality even
CHAPTER 2 9 BACKGROUND AND LITERATURE REVIEW
Fingerprint, the owner of the data set hides a serial number that uniquely identifies
the owner of the data set. This adds to copyright information to makes it easy to trace
any unauthorized used of the data set back to the owner. The publishing and
broadcasting industries have become more interested in techniques for embedding
encrypted copyright marks and serial numbers in digital films, audio recordings, books
and multimedia products.
Figure 2.1
A Steganographic System
Until recently, data hiding techniques got very much less attention from the research
community and industry than cryptography. This situation is, however, changing
increasingly and the first academic conference on this topic was organized in 1996.
Genome steganography:
Information hiding in documents by changing positions of lines and words, hiding the
information in html files.
A computer picture is an array of points called pixels. Digital pictures are stored in
either 24 bit or 8 bit pixel files.24 bit are larger files and not good for internet uses.
A pixel makes up the digital images raster data.
Before discussing how data is hidden in an image file, it is worth to get a fast review
of how images are saved in the first place. An image file is a binary file containing a
binary representation of the colour or light intensity of each picture element (pixel)
making the image.
Images use either 8-bit or 24-bit colour. When using 8-bit colour, there 256 colours
defined forming a palette for this image, each colour is represented by an 8-bit value.
A 24-bit colour scheme, as the term suggests, uses 24 bits per pixel and gives a much
better set of colours. In this case, each pixel is denoted by three bytes, each byte
showing the intensity of the three primary colours red, green, and blue (RGB),
respectively. The Hypertext Mark-up Language (HTML) format for representing
colours in a Web page normally uses a 24-bit format using six hexadecimal digits, each
pair representing the amount of red, blue, and green, respectively. The colour purple,
for example, would be displayed with red set to 100% (decimal 255, hex FF), green set
to 50% (decimal 127, hex 7F), and no blue (0), so we would take "#FF7F00" in the
HTML code.
The size of an image file is related to the number of pixels and the granularity of the
colour definition. A typical 640x480 pixel image using a palette of 256 colours would
need a file of about 307 KB in size (640 • 480 bytes), whereas a 1024x768 pixel high-
resolution 24-bit colour image would result in a 2.36 MB file (1024 • 768 • 3 bytes).
To avoid sending files of this large size, a number of compression schemes have been
made over time, majorly Bitmap (BMP), Graphic Interchange Format (GIF), and Joint
Photographic Experts Group (JPEG) file types. Not all are equally suitable for
steganography though.
GIF and 8-bit BMP files use that is known as lossless compression, a scheme that
makes the software able to exactly reconstruct the original image. JPEG, on the other
hand, uses lossy compression, which means that the expanded image is quite nearly
the same as the original but not an exact. While both methods allow computers to
save storage memory, lossless compression is much better suitable for applications
where the integrity of the original information must be kept, such as steganography.
While JPEG files can be used for stego applications, it is more common to hide data in
GIF or BMP files .The easiest method to hiding data within an image file is known as
least significant bit (LSB) insertion. In this technique, we can take the binary
representation of the secret text and overwrite the LSB of each byte within the cover
image. If we are using 24-bit colour, the amount of difference will be minimal and
invisible to the human eye. Suppose we have three adjacent pixels (nine bytes) with
the following RGB encodings:
We want to "embed" the following 9 bits of data (the secret data is usually
compressed before being hidden): 101101101. If we over write these 9 bits over the
LSB of the 9 bytes above, we have the following (where bits in bold have been
replaced):
Note that we have successfully embedded 9 bits but at a cost of only replacing 4, or
roughly 50%, of the LSBs.
In contrast steganography does not change the structure of the secret message, but
hides it inside a cover-image so it is not visible. A message in cipher text, for instance,
might give suspicion on the part of the receiver end while an “invisible” message
created with steganography will not. In other word, steganography prevents an
attacker from suspecting that the data even exists. In addition, the security of classical
steganography system depends on secrecy of the data encoding technique. Once the
encoding system is discovered, the steganography system is defeated.
Steganalysis is the technique of discovering and recovering the hidden message. But
first we have to determine if the image has some hidden information. For that we
need to check the size and colour palate. All stego software’s use a password to
create the stego image. Stego-only attack analyses the stego host file. Known cover
attack is used if both the original and stego infected file is available. A chosen
message attack is performed when a stego-media is generated using a predetermined
algorithm.
Information is embedded in the header of the image that contains the length of the
hidden message.
If the size of the image header embedded by the various tools is known, this
information could be used to verify the correctness of the guess password.
New technology in development uses stego signatures that are similar to virus or IDS
signatures.
A watermark is a form, image or text that is stunned onto paper, which provides proof
of its realism. Digital watermarking is an extension of the same concept. There are
two types of watermarks: visible watermark and invisible watermark. . The main
thought for any watermarking scheme is its robustness to various attacks.
Watermarking enslavement on the original image increases its robustness but at the
same time we need to make sure that the watermark is imperceptible. It is a
technique used to hide data or identifying information within digital Multimedia.
Image watermarking is becoming popular, especially for adding undetectable
identifying marks, such as author or copyright information. Because of this use,
watermarking techniques are often evaluated based on their invisibility,
recoverability.
Robustness
Speed
Content holder might want to openly and freely provide a partial view of
multimedia content bend sold. To make the preview commercially useless,
content is stamped with visible watermarks.
Fingerprinting:
Used to keep away from illegal and repetition, in which a distinct watermark
(a fingerprint) is embedded in each copy of data. If unauthorized copies are
found, the origin of the copy can be determined by retrieving the fingerprint
Content labeling:
Watermark inserted to point out the amount of copies official. Every time a
copy is made the hardware modifies the watermark at the same time it would
not create any more copies of the data. Commonly used in DVD technology.
Ownership Assertion:
‘A’ uses a private key to generate a watermark and embeds it in the document
and ‘A’ makes a watermarked image openly available. ‘B’ claims that he owns
the image derived from the public image ‘A’ produces the unmarked original
and establishes the presence of ‘A’s watermark.
Watermarking techniques can be broadly classified into two categories, such as:
Spatial domain methods are less complex as no transform is used, but are not robust
against attacks.
This is appropriate to the fact when image is inverse wavelet transformed watermark
is distributed erratically over the image, making the attacker difficult to read or
change. Among the transform domain watermarking techniques discrete wavelet
A watermark may be digital data that can be embedded into all forms of media
content, including digital images, audio, video and even certain objects. It can be
easily detected and read by computers, networks and a variety of digital devices,
validating the original content and/or initiating actions.
Wavelets have been efficiently utilized as a powerful tool in many assorted fields,
including approximation theory; signal processing, physics, astronomy, and image
processing.
There are also many ways how to sort the types of the wavelet transforms. Here we
show only the division based on the wavelet orthogonality. We can use orthogonal
wavelets for discrete wavelet transform progress and non-orthogonal wavelets for
continuous wavelet transform development. These two transforms have the following
properties:
The discrete wavelet transform returns a data vector of the same span as the input is.
Generally, even in this vector many data are almost zero. This corresponds to the fact
that it decomposes into a set of wavelets (functions) that are orthogonal to its
translations and scaling. Therefore we require such a signal to a same or lower
number of the wavelet coefficient spectrum as is the number of signal data points.
Such a wavelet spectrum is very high-quality for signal processing and compression,
for example, as we get no redundant information here.
The continuous wavelet transform in opposing returns an array one dimension well-
built that the input data. For a 1D data we obtain an image of the time-frequency
plane. We can easily see the signal frequencies evolution during the duration of the
signal and compare the spectrum with other signals spectra. As here is used the non-
orthogonal set of wavelets, data are correlated highly, so big redundancy is seen here.
This helps to see the results in a more humane form.
The Discrete Wavelet Transform (DWT), which is based on sub-band coding is found
to give way a fast computation of Wavelet Transform. It is easy to implement and
reduces the calculation time and assets required.
The one levels 2D-DWT is computed using filter banks as shown in Figure. The input
signal is passed through two stages of analysis filters. They are first processed by low-
pass and high-pass horizontal filters and are sub sampled by two. Consequently, the
outputs obtained from horizontal are processed by low-pass and high-pass vertical
filter. Note that: LL, LH, HL and HH are the sidebands. They are also called
Approximate, Vertical, Horizontal and Diagonal components.
Figure 2.2
In DWT we have 1-D, 2-D… n-D levels. 2DWT is used in our work. It uses the scaling
and wavelet functions of 1DWT. Below figure illustrate the 2DWT level. We can
increase levels at the cost of complexity. It is two times decomposition of original
signal via sub-division. To use any wavelet we have to select the filters and families
like Coiflets, haar, Symlet. We have selected Haar for our experimental work.
Figure 2.3
knowledge. The result of the process is encrypted information. The reverse process,
i.e., to make the encrypted information readable again, is referred to as decryption.
Encryption provides:
Authentication:
It protects personal data such as password.
Privacy:
Provides for confidentiality of private information
Integrity:
It ensures that a document or file has not been altered.
Almost all modern computers use the ASCII character set to store basic text. ASCII
stands for American Standard Code for Information Interchange. The character set
uses 7 of the 8 bits in a byte to encode 128 characters. The first 32 characters are
nonprinting control characters, such as tab, backspace, and end-of-line. The 128th
character is another nonprinting character that corresponds to the Delete key on your
keyboard. In between these control characters are 95 printable characters, including
a space, 10 digits, 26 lowercase letters, 26 uppercase letters, and 32 punctuation
marks.
MATLAB can easily display all the printable characters in the order determined by
their ASCII encoding.
Start with
x = reshape(32:127,32,3)'
x =
32 33 34 ... 61 62 63
64 65 66 ... 93 94 95
c = !"#$%&'()*+,-./0123456789:;<=>?
@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
`abcdefghijklmnopqrstuvwxyz{|}~
The last character of x is 127 which is a delete character but we have not displayed it
in c as it is non-printable.
char(32 )
is the same as
''
char (126)
is the same as
'~'
d = char(48:57)
d =0123456789
This string can be converted to the corresponding numerical values with double or
real. The statement
double (d) - '0'
Produces
0123456789
Comparing the second and third lines of c, we see that the ASCII encoding of the
lowercase letters is obtained by adding 32 to the ASCII encoding of the uppercase
letters. Understanding this encoding allows us to use vector and matrix operations in
MATLAB to manipulate text. The ASCII standard is often extended to make use of all
eight bits in a byte, but the characters that are displayed depend on the computer
and operating system you are using.
Our encryption technique involves modular arithmetic. All the quantities involved are
integers and the result of any arithmetic operation is reduced by taking the remainder
or modulus with respect to a prime number p. The functions rem(x,y) and mod(x,y)
both compute the remainder if x is divided by y. They produce the same result if x and
y have the same sign; the result also has that sign. But if x and y have opposite signs,
then rem(x,y) has the same sign as x, while mod(x,y) has the same sign as y. Here is a
table:
x = [37 -37 37 -37]';
37 107 7
-37 10 -7 3
37 -10 7 -3
-37 -10 -7 -7
We have chosen to encrypt text that uses the entire ASCII character set, not just the
letters. There are 95 such characters. The next larger prime number is p = 97, so we
represent the p characters by the integers 0:p-1 and do arithmetic mod p.
The characters are encoded two at a time. Each pair of characters is represented by a
2-vector, x.
For example, suppose the text contains the pair of letters 'TV'. The ASCII values for
this pair of letters are 84 and 86. Subtract 32 to make the representation start at 0
produces the column vector.
X= (5452)
The encryption is done with a 2-by-2 matrix-vector multiplication over the integer’s
mod p. The symbol ≡is used to indicate that two integers have the same remainder,
modulo the specified prime:
y≡Ax; mod p;
A= (712 262 )
For our example, the product AX is
Ax = (3800
1508 )
Y= (1753)
Converting this back to characters by adding 32 produces '1U'.Now comes the
interesting part. Over the integers modulo p, the matrix Aits own inverse. If
y≡Ax,mod p;
x≡Ay,mod p:
A = [71 2; 2 26]
I = mod(A^2,p)
A= (722 262 )
I= (10 01)
This shows us that the encryption function is an inverse of its own and hence the
same function can be used to encrypt and decrypt a message.
2.4.2 Coding:
The coding of the project observes the following steps
The image which is selected for steganography is broken down into RGB planes. This
is done to observe the changes of embedding encrypted data in these 3 planes. Now
we convert the image into its YCbCr planes. The human visual system is less sensitive
to color than to luminance (brightness). In the RGB color space the three colors are
equally important and so are usually all stored at the same resolution but it is possible
to represent a color image more efficiently by separating the luminance from the
color information and representing luma with a higher resolution than color. Thus
there came about the transformation of RGB to YCbCr.
are the components. Luminance is very similar to the grayscale version of the original
image. Cb is strong in case of parts of the image containing the sky (blue), both Cb
and Cr are weak in case of a color like green, and Cr is strong in places of occurrence
of reddish colors.
The Haar transform is basically one of the simplest and basic transformations from
the space/time domain to a local frequency domain. The advantages of Haar function
are that it is easily implementable and it reveals the space/time-variant spectrum.
This is why it is used in modern electrical engineering applications for image or signal
compression.
The Forward Discrete Wavelet Transform is very suitable to identify the areas in the
cover image where the secret data can be embedded effectively due to its excellent
space-frequency localization properties. If the secret encrypted data is embedded in
the lower frequency sub-bands (LL2) this degrades the image significantly, as usually
most of the image energy is stored in these sub-bands. Embedding in the low-
frequency subbands, however, could increase robustness significantly. In contrast, the
edges and textures of the image and the human eye are not generally sensitive to
changes in the high frequency subbands (HH2). This allows the encrypted data to be
embedded without being perceived by the human eye.
Figure 2.4
The 2D DWT returns one average and three details 2D coefficients arrays. The
coefficients arrays are organized in the following form:
Where cA, cH, cV, cD denote approximation, horizontal detail, vertical detail and
diagonal detail coefficients respectively. In this software the encrypted data is
embedded in the approximation detail as it produces a stego image with least
difference to the original image.
converted back to RBG planes to that is can be displayed. Then 2 level Inverse
Discrete Wavelet Transform (IDWT) is applied. The stego image is sent to the desired
user and decoding is performed at the receivers end to access the secret data. This
data is however encrypted, so decryption using the same algorithm (crypto.m) is done
to make the message readable.
The MSE represents the cumulative squared error between the compressed and the
original image, whereas PSNR represents a measure of the peak error. The lower the
value of MSE, the lower is the error.
To compute the PSNR, calculate the mean-squared error using the following equation:
2
∑ [ I1 ( m ,n )−I 2(m, n)]
MSE= M , N
M∗N
Here, M and N are the number of rows and columns in the input images, respectively .
Then compute PSNR using the following equation:
[ ]
2
R
PSNR=10 log 10
MSE
Chapter 3
1.Encoding
2.Decoding
Prototype
Steganography
Software
Encoding Decoding
Figure 3.1
3.1.1 Encoding:
It is basically the process in which the data will hidden into the host image.Encoding
consists of embedding the bit stream in the image. It is required that the bit stream
must be transparent as much as possible. For hiding the data into the host image
wavelet transform will be used.
CHAPTER 3 32 IMAGE WATERMARKING BASED
STEGANOGRAPHY SOFTWARE
Embedding:
Embedding includes hiding the data in the form of bit stream in the cover image such
that the data is invisible in the new or stego image. The flow chart for the embedding
process is shown in the figure 3.2.
Embedding can be done using a key so that only the desired party will be able to
extract the embedded data. It consists of
Bit stream generation
Converting image from RGB to YCBCR
Performing DWT on Y image.
Inserting watermark
Converting the image back to RGB
These steps for embedding have been explained in sufficient detail in the previous
chapter.
3.1.2 Decoding:
In the decoding process, the stego object will be fed into the system to decode the
embedded bit stream from the host image. It is the extraction of the data from the
image.
Extraction:
Extraction is extracting the bit stream of data from the stego image. It is mainly the
opposite of embedding.
Figure 3.3
Install the MATLAB software in your system. Save the GUI .m files and .fig files in
working directory of the MATLAB.
Write guide on the Command window. It will open the GUI environment in
the MATLAB.
guide
Hiding data into the image Retrieving data from the image
As you click the run fig,the first window of the GUI will appear.It contains two
Options: “Hiding data into the image” and “Retrieving data from the image”. Now
to perform embedding of data we select the first option.
1. Click on the “hiding data into the image” tab. A new window will appear. It
contains an action panel and image previews.
Select image:
Click the select image tab. It will give you browse option to load the image into
which you desire to embed the message.
Select Image
As your image is loaded, its preview will be shown in the preview plane.
Write data:
Click on “write data” button. An input dialogue box will be appeared on the
screen.
Encrypt Data: Now click on “Encrypt Data” tab to encrypt the message.
Encrypt Data
Stego image:
Stego image
Save image
Save image
Click on” Save image “button to save the stego image. Now the encrypted secret
message is embedded into the image. This image can be transmitted over the
internet or by other means safely without any suspicion of secret communication
taking place.
NowHiding
by clicking at the
data into theRetrieving
image Data form the image button
Retrieving wefrom
data get the
the window
image
shown below.
Select image:
Select image
Click onto the select image tab to select the image from which data is to be
retireved.The image which was sent to the user is selected and displayed.
Rerieve data:
The “retreive data” tab extracts the data from the stego image, but this data is
decrypted and hence unreadable.
Retrieve Data
Decrypt data:
To decrypt the secret message, the ‘decrypt data’ button is clicked. This button
simultaneously decrypts the data and displays it in a dialog box as shown below.
Decrypt Data
3.2.4 Analysis:
As the project is study based the image can be analysed at different stages by
clicking on the option “Analysis”.
Display original image:
Click on “Display Original image”. It will display the original image
Click on “Original image in RGB plane “button. You will get R, G and B components
of your original image separately.
Stego Image:
Stego image
RGB components of the stego image are displayed by clicking the “Stego Image in
RGB plane”.
For Y, Cb and Cr components of stego image, click “Stego Image in YCbCr plane”
Difference Image:
To see the difference of both images click on “Display Difference image “to get
the difference image.
Difference image
PSNR
Clicking on PSNR will give the peak to signal noise ratio of the image.
PSNR
Chapter 4
Hiding Revealing
Start
Application
Encryption Decryption
JPEG Message
Image file File
Figure 4.1
The Program Sequence
CHAPTER 4 53 EXPERIMENTS AND RESULTS
Figure 4.2
The Encryption Process
Information File
Image File
Figure 4.3
The Decryption Process
Figure 4.6
The embedding of data
Figure 4.7
The encryption of data
Figure 4.8
The extraction of data
50
100 150
150
200 100
250
50
300
350
0
400
450
-50
500
50 100 150 200 250 300 350 400 450 500
Comments:
The value of PSNR so obtained is 37.4194with 64 characters. The difference image shows the difference between the images; however
the difference is invisible by the naked eye.
Example 2: No of characters=130
stego Image
Diff. In Image
50
100 150
150
200 100
250
300 50
350
0
400
450
-50
500
50 100 150 200 250 300 350 400 450 500
Comments:
The value of PSNR so obtained is 33.500 with 130 characters. The difference image shows the difference between the images; however
the difference is invisible by the naked eye.
Example 3: No of characters=200
The word steganography comes from the Greek Steganos.This chapter highlights
the basic need of Steganography for information security and the potential
dangers to communication from intruders. Nowadays, most information is kept
electronically; consequently the security of this information has become an issue.
Besides cryptology, Steganography can be used to secure information. This is a
better method of information security as the existence of the information itself in
unknown.One of the reasons that intruders can be successful is because they
know that secret communication between two parties is taking place. Intruders
may find ways to reveal the information to others, modify it to misrepresent an
individual or organization, or use it for illegal purposes. In addition, the rapid
growth of publishing and broadcasting technology also require an alternative
solution in hiding information. The copyright such as audio, video and other
source available in digital form may lead to large-scale unauthorized copying. One
solution to this problem is through the use of Steganography. Steganography is a
technique of hiding information in digital media. In contrast to cryptography, it is
not to keep others from knowing the hidden information but it is to keep others
from thinking that the information even exists.
Figure 4.15
Figure 4.16
Host image
Data Embedded
50
100 150
150
200 100
250
300 50
350
400 0
450
500 -50
50 100 150 200 250 300 350 400 450 500
Figure 4.18
Figure 4.17
Difference image
Stego image
Comments:
The value of PSNR so obtained is 30.1420 with 200 characters. The difference image shows the difference between the images; however
the difference is invisible by the naked eye.
50
150
100
150
100
200
250
50
300
350
0
400
450
-50
500
50 100 150 200 250 300 350 400 450 500
Comments:
The value of PSNR so obtained is 38.6451 with 60 characters. The difference image shows the difference between the images; however
the difference is invisible by the naked eye.
Figure 4.24
Figure 4.23
Data Embedded
Host image
50 60
100 40
150 20
200 0
250 -20
300 -40
350 -60
400 -80
450 -100
500 -120
50 100 150 200 250 300 350 400 450 500
Figure 4.26
Figure 4.25
Difference image
Stego image
Comments:
The value of PSNR so obtained is 35.7352 with 130 characters. The difference image shows the difference between the images; however
the difference is invisible by the naked eye.
The word steganography comes from the Greek Steganos.This chapter highlights the
basic need of Steganography for information security and the potential dangers to
communication from intruders. Nowadays, most information is kept electronically;
consequently the security of this information has become an issue. Besides
cryptology, Steganography can be used to secure information. This is a better method
of information security as the existence of the information itself in unknown.One of
the reasons that intruders can be successful is because they know that secret
communication between two parties is taking place. Intruders may find ways to reveal
the information to others, modify it to misrepresent an individual or organization, or
use it for illegal purposes. In addition, the rapid growth of publishing and broadcasting
technology also require an alternative solution in hiding information. The copyright
such as audio, video and other source available in digital form may lead to large-scale
unauthorized copying. One solution to this problem is through the use of
Steganography. Steganography is a technique of hiding information in digital media. In
contrast to cryptography, it is not to keep others from knowing the hidden
information but it is to keep others from thinking that the information even exists.
50
150
100
150
100
200
250
50
300
350
0
400
450
-50
500
50 100 150 200 250 300 350 400 450 500
Comments:
The value of PSNR so obtained is 33.6473 with 200 characters. The difference image shows the difference between the images; however
the difference is invisible by the naked eye.
37.5
32.5
27.5
22.5
Mandril
PSNR
17.5 Peppers
12.5
7.5
2.5
60 100 130 150 200
Mandril 37.4194 34.4062 33.5 32.0866 30.24
Peppers 38.6451 37.156 35.7352 34.9357 33.6473
No of Characters
Comment:
Chapter 5
CONCLUSION
Steganography is a really interesting subject and a relatively untouched area
outside the main stream cryptography and system administration that most of us
deal with day after day.
The main aim of this project was to hide secret information in an image such that
it is invisible by the naked eye. We printed out the enhancement of the image
Steganography using bit replacing approach to provide a means of secure
communication. The encryption of the data using a stego key is applied to the
system during embedment of the message.
The Steganography prototype that we have designed provide for the purpose to
how to use any type of image format to hiding secret information inside their. The
master work of this application is in supporting any type of pictures without need
to convert to JPEG; however it saves tae stego image as a JPEG image.
The program also does not require messages to be manually encoded. The
information is only to be entered ant it is encrypted and embedded into the
image.
The limitations of this program are that it saves the stego image as a lossless JPEG
image. For any other type of mode, the program will not be useful. Also it can
CHAPTER 5 72 CONCLUSION
accept only 200 characters of the secret information to be embedded into the
image.
Since ancient times, man has found a desire in the ability to communicate
covertly. The recent explosion of research in watermarking to protect intellectual
property proves that Steganography is not just limited to military or espionage
applications. Steganography, like cryptography, will play an increasing role in the
future of secure communication in the “digital world”.
We feel that we have set a good platform upon which future work can be built,
hopefully leading to the creation of improved stego techniques.
REFERENCES
1. The art of Security and Information Hiding by Emmanuel Sodipo
2. Modern multivariate statistical techniques by Alan Julian Izenman
3. On the limits of Steganography by R.J Anderson, F.A.P Petitcolas
4. Ali Al-Ataby and Fawzi Al-Naima, “A Modified High Capacity Image
Steganography Technique Based on Wavelet Transform”, The
International Arab Journal of Information Technology, Vol. 7, No. 4,
October 2010, Pages: 358-364
5. Wavelet Transform and Denoising:
http://scholar.lib.vt.edu/theses/available/etd-12062002-152858/unrestric
ted/Chapter4.pdf
6. Chen, T. S., Chang, C. C., and Hwang, K. F., 2002.Digital Image Processing,
Taipei: Flag.
7. Po-Yueh Chen and Hung-Ju Lin. (2006): “A DWT Based Approach for Image
Steganography,” International Journal of Applied Science and Engineering,
pp. 275-290
8. Nameer N. EL-Emam, “Hiding a Large Amount of Data with High Security
Using Steganography Algorithm”, Applied Computer Science Department,
Philadelphia University, Jordan,2007
9. “Mizuho NAKAJIMA, “Extended use of Visual Cryptography for natural
images, Department of Graphics and Computer Sciences”, Graduate
School of Arts and Sciences, The University of Tokyo
10. C. Shoemaker, Hidden Bits: A Survey of Techniques for Digital
Watermarking,
http://www.vu.union.edu/~shoemakc/watermarking/watermarking.html#
watermark-object, Virtual Union, 2002
11. “Information Security”, National Institute of Standards and Technology,
Special Publication, 2004
12. C. Cachin, “An Information-Theoretic Model for Steganography”,
Proceedings of 2nd Workshop on Information Hiding, MIT Laboratory for
Computer Science, May 1998
APPENDICES:
Main program code:
Embedding
clear all
close all
clc
%% Loading image
originalimage=imread('peppers.jpg');
OI=originalimage;
Icbcr=rgb2ycbcr(originalimage); %converting RGB to Ycbcr
Y=Icbcr(:,:,1);
%% User Input
prompt='Write Message';
name=' Enter the secret message';
numlines=1;
defaultanswer={' '};
options.Resize='on';
options.WindowStyle='normal';
options.Interpreter='tex';
mes=inputdlg(prompt,name,numlines,defaultanswer,options);
mes=char(mes);
%% data embedding
temp(Index:Index+(t*8)-1)=EmbeddingString*10;
temp=reshape(temp,128,128);
%% perform two levl inverse dwt where temp is the matrix where
message is
%% embedded
ca2=idwt2(ca1,temp,cv1,cd1,'haar');
Y2=uint8(idwt2(ca2,ch,cv,cd,'haar'));
%% showing stegoimage
imagesc(stagimage);
title('stego Image')
Extraction
ExCoef=ch3(:);
ExCoef(ExCoef<5)=0;
ExCoef(ExCoef>5)=1;
ExBin=reshape(ExCoef,length(ExCoef)/8,8);
ExDec=bi2de(ExBin,8);
ExDecMsd=ExDec(IIndex:IIndex+Llength-1);
ExDecMsd=ExDecMsd(1,:)
ExMsg=char(ExDecMsg)
ExMsg=ExMsg'
%% decrypt message
messageretrieved=crypto(ExMsg)
%% calculating PSNR
p=psnr(originalimage,stagimage)
%% Difference image
DifImage=double(Y3)-double(Y);
figure;imagesc(DifImage);colormap gray;axis image;axis
off;colorbar;
title('Diff. In Image');
Encryption code
function y = crypto(x)
% CRYPTO Cryptography example.
% y = crypto(x) converts an ASCII text string into another
% coded string. The function is its own inverse, so
% crypto(crypto(x)) gives x back.
% See also: ENCRYPT.
% Use a two-character Hill cipher with arithmetic
% modulo 97, a prime.
p = 97;
c1 = char(169);
c2 = char(174);
x(x==c1) = 127;
x(x==c2) = 128;
x = mod(real(x-32),p);
n = 2*floor(length(x)/2);
X = reshape(x(1:n),2,n/2);
% Encode with matrix multiplication modulo p.
A = [71 2; 2 26];
Y = mod(A*X,p);
y = reshape(Y,1,n);
if length(x) > n
y(n+1) = mod((p-1)*x(n+1),p);
end
y = char(y+32);
y(y==127) = c1;
y(y==128) = c2;