0% found this document useful (0 votes)
22 views83 pages

Madf

research

Uploaded by

Saima Zaib
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views83 pages

Madf

research

Uploaded by

Saima Zaib
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 83

DIGATL STEGANOGRAPHY; HIDING DATA WITHIN DAT

USING IMAGE WATERMARKING

BE (EE) PROJECT REPORT

Prepared By:

MADIHA IQBAL EE-79

Project Advisor:

Mrs. Uzma Parveen

Department of Electrical Engineering

N.E.D. University of Engg. & Tech,

Karachi - 75270
2

DIGITAL STEGANOGRAPHY; HIDING DATA WITHIN


DATA USING IMAGE WATERMARKING

BE (EE) PROJECT REPORT

Prepared By:

MAHAM ALI EE-75

MADIHA IQBAL EE-79

SANA WAJID EE-91

SAIMA ZAIB EE-99

Project Advisor:
Mrs. Uzma Parveen

Department of Electrical Engineering

N.E.D. University of Engg. & Tech,

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
iii

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.

Madiha Iqbal EE-079


Sana Wajid EE-091
Saima Zaib EE-099
Maham Ali EE-075

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
iv

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.

Although Steganography is an ancient technique for secret communication, but in the


digital world steganographic techniques have taken a new aspect.

Steganography is the art of hiding information in other information. Many different


digital media can be used, but use of images is most popular because of their
frequency on the internet. The secret information is also encrypted so as to provide
complete security.

The basic goal of Steganography is to avoid drawing suspicion that communication is


taking place, and due to this we try to have minimum difference between stego image
and original image.

The main objective of this project is to develop prototype software based on


Steganography using MATLAB. This will include application of an encryption
procedure. The secret information will then be embedded in the cover image by
passing it into the encoder where one or several protocols, using Wavelet Transform,
will be implemented. The secret information can then be extracted by the desired
party using Inverse Wavelet Transform for decryption.

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
v

Contents
CHAPTER 1........................................................................................................................................ 1

INTRODUCTION................................................................................................................................. 1

1.1 HISTORY............................................................................................................................................1

1.2 DIGITAL WATERMARKING AND STEGANOGRAPHY......................................................................................2

1.2.1 NEED FOR STEGANOGRAPHY AND DIGITAL WATERMARKING......................................................................3

1.3 OBJECTIVE......................................................................................................................................... 5

1.4 SCOPE OF THE PROJECT........................................................................................................................6

1.5 ORGANIZATION OF THE REPORT.............................................................................................................7

CHAPTER 2........................................................................................................................................ 8

BACKGROUND AND LITERATURE REVIEW..........................................................................................8

2.1 STEGANOGRAPHY................................................................................................................................8

2.1.1 STEGANOGRAPHY TECHNIQUES:........................................................................................................10

2.1.2 STEGO IN IMAGES:.........................................................................................................................10

2.1.3 HOW STEGANOGRAPHY WORKS:.......................................................................................................10

2.1.4 STEGANOGRAPHY VERSUS CRYPTOGRAPHY:.........................................................................................12

2.1.5 PRACTICAL STEGO USES...................................................................................................................13

2.1.6 DEFEATING STEGO..........................................................................................................................14

2.2 IMAGE WATERMARKING AND ITS APPLICATIONS......................................................................................14

2.2.1 CHARACTERISTICS OF WATERMARKING...............................................................................................15

2.2.2 APPLICATIONS OF IMAGE WATER MARKING........................................................................................16

2.3 TRANSFORM BASED WATERMARKING AND WAVELET TRANSFORM:..............................................................17

2.3.1 SPATIAL DOMAIN METHODS:.............................................................................................................17

2.3.2 TRANSFORM DOMAIN METHODS:.......................................................................................................17

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
vi

2.3.3 WAVELET TRANSFORM....................................................................................................................18

2.3.1.1 Discrete wavelet transform.........................................................................................19

2.3.1.2 Operation of discrete wavelet transform....................................................................19

2.3.1.3 Dwt2 for an image......................................................................................................20

2.4 ENCRYPTION AND CODING:.................................................................................................................20

2.4.1 ENCRYPTION ALGORITHM:................................................................................................................21

2.4.2 CODING:.......................................................................................................................................25

2.4.3 OBTAINING THE STEGO IMAGE..........................................................................................................28

2.4.4 ANALYSIS OF STEGO IMAGE..............................................................................................................29

2.4.5 PSNR AND MSE:...........................................................................................................................29

CHAPTER 3...................................................................................................................................... 30

IMAGE WATERMARKING BASED STEGANOGRAPHY SOFTWARE.......................................................30

3.1 DESCRIPTION OF THE SYSTEM:.............................................................................................................30

3.1.1 ENCODING:...................................................................................................................................30

3.1.2 DECODING:...................................................................................................................................31

3.2 GRAPHICAL USER INTERFACE:..............................................................................................................33

3.2.1 GETTING STARTED..........................................................................................................................33

3.2.2 HIDING DATA................................................................................................................................35

3.2.3 RETRIEVING DATA FROM THE IMAGE..................................................................................................40

3.2.4 ANALYSIS:.....................................................................................................................................44

CHAPTER 4...................................................................................................................................... 50

EXPERIMENTS AND RESULTS............................................................................................................ 50

4.1 PROGRAM SEQUENCE:........................................................................................................................50

4.2 THE ENCRYPTION PROCESS..................................................................................................................51

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
vii

4.3 THE DECRYPTION PROCESS..................................................................................................................52

4.4 IMAGES WITH EMBEDDED DATA............................................................................................................53

4.4.1 PSNR VERSUS NO OF CHARACTERS..................................................................................................68

CHAPTER 5...................................................................................................................................... 69

CONCLUSION................................................................................................................................... 69

REFERENCES.................................................................................................................................... 71

APPENDICES:................................................................................................................................... 72

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
1

Chapter 1

INTRODUCTION
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.

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.

1.2 Digital Watermarking and Steganography


Steganography is the art and science of invisible communication. This is accomplished
through hiding information within information, thus hiding the existence of the
communicated information. It actually hides a secret message and in the best case
nobody can see that both parties are communicating.

Steganography works by replacing bits of useless or unused data in regular computer


files (such as graphics, sound, text, and HTML ) with bits of different, invisible
information. This hidden information can be plaintext, ciphertext, or even images.
Digital images are the most popular because of their frequency on the Internet.

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 1 3 INTRODUCTION

a. Original image b. Stego Image

Figure1.1

As it is seen in the images above that the information is completely invisible.

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.

1.2.1 Need for Steganography and digital watermarking


There has been a rapid growth of interest in steganography and digital watermarking
for two main reasons.

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.

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 1 4 INTRODUCTION

Governments in many countries have restricted the use of cryptography due to


security issues and this has motivated people to study methods by which private
messages can be embedded in seemingly innocuous cover messages.

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

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 1 5 INTRODUCTION

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 goal of steganography is covert communication. Although highly efficient crypto


graphical methods are available; we still pursue the field of information hiding to
achieve “security through obscurity”. Steganography allows us to hide encrypted
messages in mediums less likely to attract attention. A garble of random characters
being transmitted between two users may tip off a watchful 3rd party that sensitive
information is being transmitted; whereas baby pictures with some additional noise
present may not. The underlying information in the pictures is still encrypted, but
attracts far less attention being distributed in the picture then it would otherwise.

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.

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 1 6 INTRODUCTION

This approach of information hiding technique has recently become important in a


number of application areas.

This project has following objectives:

 Research into the background of Steganography.


 To produce security tool based on Steganography techniques.
 To explore techniques of hiding data using encryption module of this project.
 Design and implementation of the technique to successfully hide information
into the image.
 To extract techniques of getting secret data using decryption module.
 Evaluation of the techniques weighing the advantages and disadvantages of
each.

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.

1.4 Scope of the Project


The scope of the project is to limit unauthorised access and provide better security
during message transmission. To meet the requirements, we use the simple and basic
approach of Steganography and digital watermarking. In this project, the proposed
approach is to find the suitable algorithm for embedding the data in an image using
Steganography which provides the better security pattern for sending messages
through a network. For implementation of the algorithm MATLAB is used because of
its familiarity with us.

Military communications system make increasing use of traffic security technique


which, rather than merely concealing the content of a message using encryption, seek
to conceal its sender, its receiver or its very existence. Similar techniques are used in
some mobile phone systems and schemes proposed for digital elections.

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 1 7 INTRODUCTION

In addition the technique for Steganography may be used by any individual or


organization to secretly communicate without the danger of unwanted intrusion.

1.5 Organization of the Report


The following gives a breakdown of the report contents and how it is broken
down over the chapters.

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

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
8

Chapter 2

BACKGROUND AND LITERATURE REVIEW

2.1 Steganography

Steganography is a science and art of hiding secret information in digital media. It is


not to keep others from knowing the hidden data but it is to keep others from
thinking of information even exists. Besides hiding data for secrecy, this approach of
data hiding can be extended to copyright protection for digital media. It is the art of
hiding information in a way that prevents the detection of hidden messages.
Steganography include an array of secret communication methods that conceal the
message from being seen or found.

The aim of steganography is to avoid drawing suspicion to the very existence of a


hidden message. This approach of information hiding technique has now become
important in a number of application areas. Digital audio, video, and pictures are
furnished with distinguishing but imperceptible water marks, which may contain a
hidden copyright notice or serial number to prevent unauthorized copying directly.

The main goal of steganography is to communicate safely in a completely


undetectable manner and to avoid drawing suspicion to the transmission of hidden
information. If a steganography technique causes someone to suspect the carrier
medium, then the method has failed.

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

under multi-copying. Therefore, the special part of invisible information is embedded


in every image that could not be easily discovered without specialized techniques
saving image quality simultaneously. All this is of huge concern for the music, film,
book and software publishing industries. Information hiding is a growing research
area, which has applications such as copyright protection for digital media,
watermarking, fingerprinting, and steganography. All these fields of information
hiding are quite diverse.

In watermarking applications, the message contains data such as owner identification


and a digital time signature, which usually applied for copyright protection.

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

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 2 10 BACKGROUND AND LITERATURE
REVIEW

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.

2.1.1 Steganography Techniques:

 Genome steganography:

Hiding a secret message in a strand of a human DNA.

 Hiding in text documents:

Information hiding in documents by changing positions of lines and words, hiding the
information in html files.

 Hiding in unused memory:

Hiding secret data in an unused memory or disk space.

2.1.2 Stego In Images:

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.

2.1.3 How Steganography Works:


The following formula provides steps of the pieces of the steganographic process:

cover_medium + hidden_data + stego_key = stego_medium


In this context, the cover medium is the file in which we will hide the secret data,
which may also be encrypted using some algorithm. The resultant file is the stego
medium (the same type of file as the cover medium). The cover mediums (and, thus,
the stego medium) are typically digital image or audio files.

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.

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 2 11 BACKGROUND AND LITERATURE
REVIEW

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

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 2 12 BACKGROUND AND LITERATURE
REVIEW

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:

10010101 00001101 11001001

10010110 00001111 11001010

10011111 00010000 11001011

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):

10010101 00001100 11001001

10010111 00001110 11001011

10011111 00010000 11001011

Note that we have successfully embedded 9 bits but at a cost of only replacing 4, or
roughly 50%, of the LSBs.

This description is only given as an overview. Similar methods can be employed to 8-


bit colour but the changes, as the receiver may imagine, are more drastic. Grey-scale
images are also very useful for steganographic techniques. One problem with any of
these methods is that they can be discovered by an adversary who is looking. In
addition, there are many other techniques besides this with which to insert secret
information.

2.1.4 Steganography versus Cryptography:

Basically, the objective of cryptography and steganography is to provide secret


communication. However, steganography is not the same as cryptography.
Cryptography hides the contents of secret information from a malicious people, while
steganography even hides the very existence of the message. Steganography must

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 2 13 BACKGROUND AND LITERATURE
REVIEW

not be mixed with cryptography, where we alter the message so as to make it


meaning obscure to a malicious people who may try to intercept it. Therefore, the
definition of breaking of the system is different in both techniques. In cryptography,
the system is broken when the attacker is able read the secret message. Breaking a
steganographic system need the attacker to detect that Steganography has been
employed and he is able to extract and reads the hidden message.

In cryptography, the structure of a secret message is scrambled to make it


meaningless and unintelligible to malicious people unless the decryption key is with
them. It does not make attempt to disguise or conceal the encoded message.
Basically, cryptography offers the transmission of information between persons in a
way that prevents a third party to read it. Cryptography can also use to get
authentication for identification of someone or something.

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.

It is possible to combine two techniques by scrambling message using cryptography


and then hiding the encrypted message with steganography methods. The resulting
stego image can be transmitted without knowing that secret information is being
communicated. Furthermore, even if an attacker is to break the steganographic
technique and detect the message from the stego-object, he would still need the
cryptographic decoding key to read the message.

2.1.5 Practical Stego Uses


 Embedding copyright information on digital images.
 Legitimate hiding of information for retrieval.

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 2 14 BACKGROUND AND LITERATURE
REVIEW

 Use in covert data transmissions where encryption techniques are not


advantageous.

2.1.6 Defeating Stego

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.

2.2 Image Watermarking and Its Applications


Along with the volatile enlargement of the Internet not only attractive new
possibilities -similar to openly on hand access to information databases around the
world, distributed project work across different countries, or swift and reliable means
of electronic communication - emerged, but the effortlessness with which digital
media can be duplicated and modified, or the reality that legislation is apparently
unable to hack it with its rapid rate of change makes it also very attractive to people
with dishonourable motives. With these drawbacks of the “digital age” in mind,
creators of multimedia content may wish for a digital analogy to the watermarks that
have been used in bookmaking. This need for methods and trappings to protect ones
intellectual property rights initiated the relatively new examine field of “digital
watermarks”.

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 2 15 BACKGROUND AND LITERATURE
REVIEW

Image watermarking is a method for inserting information (the watermark) into an


image, which can be later extracted or detected for variety of purposes including
identification and authentication purposes. It is also called data
embedding and information hiding.

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.

2.2.1 Characteristics Of Watermarking


An effective watermark may have following characteristic:

 Robustness

 Fragile Watermarks are greatly sensitive to any modifications,


their sole purpose being to verify the authenticity of a
document.
 Robust Watermarks should be entrenched in a way, that they
cannot be removed from the data without introducing
apparent defects.
 Perceptibility

 Visible Watermarks are added as a perceivable additional layer


to the original data

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 2 16 BACKGROUND AND LITERATURE
REVIEW

 Invisible Watermarks should not be perceivable by human


senses.
 Multiple Watermarks

The watermarking algorithm allows for multiple watermarks to be detected


independently of each other.

 Speed

In video distribution systems it may be necessary to use asymmetric


algorithms, which offer very fast embedding methods, whereas watermark
detection can take arbitrarily longer.

2.2.2 Applications Of Image Water Marking


The applications of image watermarking are:

 Authentication and Verification:

Watermarks should be capable to identify even the slight change in the


document .A unique key is coupled with then source the create watermark
and then embed in the document. This key is used to extract the watermark
and the reliability of document verified on the basis of veracity of watermark.
Using watermark to authenticate files and digital media and verification allow
user to download files in an anxious channel.
 Content protection:

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

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 2 17 BACKGROUND AND LITERATURE
REVIEW

 Content labeling:

Bits embedded I the data, comprise an explanation giving some more


information about the data. Digital cameras annotate images with the time
and date, when the photograph was taken the picture. If the content is copied
and rudely used the watermark can be viewed and the source of the copying
can be found.

 Usage control and copy protection:

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.

2.3 Transform based watermarking and wavelet transform:

Watermarking techniques can be broadly classified into two categories, such as:

2.3.1 Spatial domain methods:

Spatial domain methods are less complex as no transform is used, but are not robust
against attacks.

2.3.2 Transform domain methods:

Transform domain watermarking techniques are robust in comparison to spatial


domain methods.

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

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 2 18 BACKGROUND AND LITERATURE
REVIEW

transform (DWT) based watermarking techniques are acquirement more popularity


because DWT has a number of reward over other transform such as progressive and
low bit-rate transmission, quality scalability and region-of-interest (ROI) coding
demand more efficient and versatile image coding that can be exploited for both,
image compression and watermarking applications.

Image watermarking relates to a technology known as steganography, which literally


means "covered writing." It is a technique designed to secure a message by hiding
that message within another object so that it can be kept secret from everyone
except the intended recipient.

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.

2.3.3 Wavelet Transform


A Wavelet is simply, a small wave which has its energy concentrated in time to give
a tool for the analysis of transient, non-stationary or time-varying phenomena.

Wavelets have been efficiently utilized as a powerful tool in many assorted fields,
including approximation theory; signal processing, physics, astronomy, and image
processing.

Wavelet transform provides a time-frequency representation of the signal. It was


developed to overcome the short coming of the Short Time Fourier Transform (STFT),
which can also be used to analyse non-stationary signals.

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:

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 2 19 BACKGROUND AND LITERATURE
REVIEW

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.

We here focus on discrete wavelet transform.

2.3.1.1 Discrete wavelet transform

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.

2.3.1.2 Operation of discrete wavelet transform

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.

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 2 20 BACKGROUND AND LITERATURE
REVIEW

Figure 2.2

2.3.1.3 Dwt2 for an image

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

2.4 Encryption and Coding:


Encryption is the process of transforming information (referred to as plaintext) using
an algorithm to make it unreadable to anyone except those possessing special

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 2 21 BACKGROUND AND LITERATURE
REVIEW

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.

2.4.1 Encryption algorithm:


The user first inputs data and then this data is suitably encrypted. The function used
here for encryption is crypto, which is not a built in function of MATLAB. In this
section it is explained in detail how this function has been constructed.

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)'

This produces a 3-by-32 matrix.

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 2 22 BACKGROUND AND LITERATURE
REVIEW

x =

32 33 34 ... 61 62 63

64 65 66 ... 93 94 95

96 97 98 ... 125 126 127

The char function converts numbers to characters. The statement c = char(x)


produces

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.

The first character in c is blank, indicating that

char(32 )
is the same as

''

The last printable character in c is the tilde, indicating that

char (126)

is the same as

'~'

The characters representing digits are in the first line of c. In fact,

d = char(48:57)

Displays a 10-character string

d =0123456789

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 2 23 BACKGROUND AND LITERATURE
REVIEW

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]';

y = [10 10 -10 -10]';

r = [ x y rem(x,y) mod(x,y)] produces

37 107 7

-37 10 -7 3

37 -10 7 -3

-37 -10 -7 -7

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 2 24 BACKGROUND AND LITERATURE
REVIEW

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;

Where A is the matrix

A= (712 262 )
For our example, the product AX is

Ax = (3800
1508 )

If this is reduced mod p, the result is

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;

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 2 25 BACKGROUND AND LITERATURE
REVIEW

x≡Ay,mod p:

In other words, in arithmetic mod p, A2 is the identity matrix. On MATLAB, the


following commands,
p = 97;

A = [71 2; 2 26]

I = mod(A^2,p)

Gives the result

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.

Thus the algorithm becomes:


1. Use a two-character Hill cipher with arithmetic modulo 97, a prime.
2. Choose two characters above ASCII 128 to expand the size of the character set
from 95 to 97.
3. Convert the character form characters to numerical values prepare for the
matrix-vector product by forming a matrix with two rows and lots of columns.
4. Encode with matrix multiplication modulo p
5. Reshaping into a single row.
6. If length(x) is odd, encode the last character
7. Finally, convert the numbers back to characters.

2.4.2 Coding:
The coding of the project observes the following steps

2.4.1.1 Converting image from RGB to YCBCR

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 2 26 BACKGROUND AND LITERATURE
REVIEW

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.

Y: Luminance; Cb: Chrominance-Blue; and Cr: Chrominance-Red

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 color information can be represented as color difference (chrominance or


chroma) components. YCbCr has an important advantage over RGB, that is the Cr and
Cb components may be represented with a lower resolution than Y because the
human visual system is less sensitive to color than luminance. This reduces the
amount of data required to represent the chrominance components without having
an obvious effect on visual quality.

Before displaying the image, we convert the image back to RGB.

2.4.1.2 Performing two level decomposition using the Haar Function

Generally Fourier Transform is used to represent the spectral content of a signal;


however it does not represent non-stationary signals appropriately. Haar Function is a
time-frequency analysis function and it suitably analyses the local aspects of the
signal. The Haar function is an orthonormal, rectangular pair. The Haar function varies
in both scale and position while the Fourier transform only differs in frequency.

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 2 27 BACKGROUND AND LITERATURE
REVIEW

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.

2.4.1.3 Discrete Wavelet Transform

The wavelet transformation describes a multi-resolution decomposition process.


When we apply DWT on 2D images it corresponds to 2D filter image processing in
each dimension. A signal is split into two parts, usually the high frequency and the low
frequency part. This splitting is called decomposition. The edge components of the
signal are largely confined to the high frequencies part. The signal is passed through a
series of high pass filters to analyse the high frequencies, and it is passed through a
series of low pass filters to analyse the low frequencies. Let us suppose that x[n]is the
original signal, spanning a frequency band of 0 to πrad/s. The original signal x[n] is
first passed through a half band highpass filter g[n] and a lowpass filter h[n]. After the
filtering, half of the samples can be eliminated according to the Nyquist’s rule, since
the signal now has the highest frequency of π/2 radians instead of π. The signal can
therefore be subsampled by 2, simply by discarding every second sample. This
constitutes one level of decomposition. The original image is first decomposed into
several bands using the discrete wavelet transformation with the pyramidal structure.
Decomposition is performed through two decomposition levels using the ‘Haar filter’.
The Haar filter using Haar transform as described above.

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

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 2 28 BACKGROUND AND LITERATURE
REVIEW

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

2.4.1.4 Inserting Watermark/ Encrypted secret data

The 2D DWT returns one average and three details 2D coefficients arrays. The
coefficients arrays are organized in the following form:

(cA, (cH, cV, cD))

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.

2.4.3 Obtaining the Stego image


Now that we have embedded the secret data successfully into the original image, we
need to get a stego image which can be used to transmit this data. This is first

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 2 29 BACKGROUND AND LITERATURE
REVIEW

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.

2.4.4 Analysis of Stego Image


To investigate the robustness of the stego image we analyse it measuring the PSNR.

2.4.5 PSNR and MSE:


Peak Signal to Noise Ratio is the measure of peak error, it is the ratio of the square of
the peak value the signal could have to the noise variance. A higher value of PSNR is
good because of the superiority of the signal to that of the noise. .To conclude that
the procedure used is better compared to others we investigate the peak-signal-to-
noise ratio. If we can show that an algorithm or set of algorithms can enhance a
degraded known image to more closely resemble the original, then we can more
accurately conclude that it is a good procedure which produces a stego image just like
the original one so that no one can make out the difference between them.

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

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 2 30 BACKGROUND AND LITERATURE
REVIEW

Here R is the maximum fluctuation in the input image data type.

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
31

Chapter 3

IMAGE WATERMARKING BASED STEGANOGRAPHY


SOFTWARE

3.1 Description of the System:


The basic output of the project will be a prototype steganography software.The
protoptype steganography software basically consists of two processes:

1.Encoding
2.Decoding

Figure 3.1 shows the basic overview of the system

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.

Figure 3.2 shows the embedding process.

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.

 Converting Stego image from RGB to YCBCR


 Perform IDWT on the Y image.
 Extract the embedded stream of data
 Convert the image back to RGB to get original host image.

Figure 3.3 shows the decoding process.

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 3 33 IMAGE WATERMARKING BASED STEGANOGRAPHY SOFTWARE

Figure 3.3

NED UNIVERSITY OF ENGINEERING AND TECHNOLOGY


CHAPTER 3 34 IMAGE WATERMARKING BASED
STEGANOGRAPHY SOFTWARE

3.2 Graphical User Interface:


A graphical user interface (GUI) is a human-computer interface (i.e., a way for
humans to interact with computers) that uses windows, icons and menus and
which can be manipulated by a mouse (and often to a limited extent by a
keyboard as well).

The graphical user interface shows us a window which enables us to upload an


image, write a message, and then obtain a stego image. The user manual or steps
to use it are shown below with suitable print shots. The GUI is operated using
MATLAB.

Install the MATLAB software in your system. Save the GUI .m files and .fig files in
working directory of the MATLAB.

3.2.1 Getting started


After opening MATLAB the command window appears as shown below:

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 3 35 IMAGE WATERMARKING BASED
STEGANOGRAPHY SOFTWARE

 Write guide on the Command window. It will open the GUI environment in
the MATLAB.

guide

 Select browse and choose steganography.fig file from the working


directory of the MATLAB.

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 3 36 IMAGE WATERMARKING BASED
STEGANOGRAPHY SOFTWARE

 This displays the GUI. Run the figure.

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.

3.2.2 Hiding Data


The sender who desires to produce a stego image from an ordinary image file
while hiding data into it will follow these steps:

1. Click on the “hiding data into the image” tab. A new window will appear. It
contains an action panel and image previews.

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 3 37 IMAGE WATERMARKING BASED
STEGANOGRAPHY SOFTWARE

 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

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 3 38 IMAGE WATERMARKING BASED
STEGANOGRAPHY SOFTWARE

As your image is loaded, its preview will be shown in the preview plane.

 Write data:

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 3 39 IMAGE WATERMARKING BASED
STEGANOGRAPHY SOFTWARE

Click on “write data” button. An input dialogue box will be appeared on the
screen.

Write the secret message to be embedded into the image.

Write The Message

Click “ok” to save the text.

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 3 40 IMAGE WATERMARKING BASED
STEGANOGRAPHY SOFTWARE

 Encrypt Data: Now click on “Encrypt Data” tab to encrypt the message.

Encrypt Data

 Stego image:

Stego image

Click on “stego Image” to get the preview of the Stego image.

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 3 41 IMAGE WATERMARKING BASED
STEGANOGRAPHY SOFTWARE

 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.

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 3 42 IMAGE WATERMARKING BASED
STEGANOGRAPHY SOFTWARE

3.2.3 Retrieving data from the image


At the receiver end the stego image is obtained. The receiver has to open guide in
MATLAB and run this software to retrieve the secret data.

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:

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 3 43 IMAGE WATERMARKING BASED
STEGANOGRAPHY SOFTWARE

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.

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 3 44 IMAGE WATERMARKING BASED
STEGANOGRAPHY SOFTWARE

 Rerieve data:
The “retreive data” tab extracts the data from the stego image, but this data is
decrypted and hence unreadable.

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 3 45 IMAGE WATERMARKING BASED
STEGANOGRAPHY SOFTWARE

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:

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 3 46 IMAGE WATERMARKING BASED
STEGANOGRAPHY SOFTWARE

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

Display original image

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 3 47 IMAGE WATERMARKING BASED
STEGANOGRAPHY SOFTWARE

 Original Image In RGB plane:

Original image in RGB plane

Click on “Original image in RGB plane “button. You will get R, G and B components
of your original image separately.

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 3 48 IMAGE WATERMARKING BASED
STEGANOGRAPHY SOFTWARE

 Original image in YCbCr plane

By clicking on “Original image in YCbCr plane”, YCbCr components of the original


image are shown separately.

Original image in YCbCr plane

 Stego Image:

Stego image

“Display Stego Image “will display the Stego image.

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 3 49 IMAGE WATERMARKING BASED
STEGANOGRAPHY SOFTWARE

 Stego Image In RGB plane

Stego image in RGB plane

RGB components of the stego image are displayed by clicking the “Stego Image in
RGB plane”.

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 3 50 IMAGE WATERMARKING BASED
STEGANOGRAPHY SOFTWARE

 Stego Image In YCbCr plane

For Y, Cb and Cr components of stego image, click “Stego Image in YCbCr plane”

Stego image in YCbCr plane

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 3 51 IMAGE WATERMARKING BASED
STEGANOGRAPHY SOFTWARE

 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

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
52

Chapter 4

EXPERIMENTS AND RESULTS

4.1 Program sequence:

Hiding Revealing

Select an image Select an image (stego object)

Enter a message and a cipher key Enter the cipher key

Encrypting a message Extracting the encrypted data from the


image.

Hiding it in the selected image Decrypting and showing the message

The following figure shows the program sequence graphically.

Start
Application

Encryption Decryption

Image Message File Image file

JPEG Message
Image file File

Figure 4.1
The Program Sequence
CHAPTER 4 53 EXPERIMENTS AND RESULTS

4.2 The Encryption Process

Image File Information File

JPEG Image File

Figure 4.2
The Encryption Process

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 4 54 EXPERIMENTS AND RESULTS

4.3 The Decryption Process

JPEG Image File

Information File
Image File

Figure 4.3
The Decryption Process

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
CHAPTER 4 55 EXPERIMENTS AND RESULTS

4.4 Images with embedded data


In this chapter images are shown with data embedded of different sizes.

Example 1: No characters=64 and image is Mandril

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.

Figure 4.4 Figure 4.5

Host image Data embedded

NED UNIVERSITY OF ENGINEERING AND TECHNOLOGY


CHAPTER 4 56 EXPERIMENTS AND RESULTS

Figure 4.6
The embedding of data

NED UNIVERSITY OF ENGINEERING AND TECHNOLOGY


CHAPTER 4 57 EXPERIMENTS AND RESULTS

Figure 4.7
The encryption of data

NED UNIVERSITY OF ENGINEERING AND TECHNOLOGY


CHAPTER 4 58 EXPERIMENTS AND RESULTS

Figure 4.8
The extraction of data

NED UNIVERSITY OF ENGINEERING AND TECHNOLOGY


CHAPTER 4 59 EXPERIMENTS AND RESULTS

stego Image Diff. In Image

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

Figure 4.9 Figure 4.10


Stego image Difference image

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.

NED UNIVERSITY OF ENGINEERING AND TECHNOLOGY


CHAPTER 4 60 EXPERIMENTS AND RESULTS

Example 2: No of characters=130

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.11 Figure 4.12

Host image Data embedded

NED UNIVERSITY OF ENGINEERING AND TECHNOLOGY


CHAPTER 4 61 EXPERIMENTS AND RESULTS

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

Figure 4.13 Figure 4.14


Stego image Difference image

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.

NED UNIVERSITY OF ENGINEERING AND TECHNOLOGY


CHAPTER 4 62 EXPERIMENTS AND RESULTS

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

NED UNIVERSITY OF ENGINEERING AND TECHNOLOGY


CHAPTER 4 63 EXPERIMENTS AND RESULTS

stego Image Diff. In Image

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.

NED UNIVERSITY OF ENGINEERING AND TECHNOLOGY


CHAPTER 4 64 EXPERIMENTS AND RESULTS

Example 4: No of characters = 60 and image is Peppers

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.

Figure 4.19 Figure 4.20


Host image Data Embedded

NED UNIVERSITY OF ENGINEERING AND TECHNOLOGY


CHAPTER 4 65 EXPERIMENTS AND RESULTS

stego Image Diff. In Image

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

Figure 4.21 Figure 4.22


Stego image Difference image

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.

NED UNIVERSITY OF ENGINEERING AND TECHNOLOGY


CHAPTER 4 66 EXPERIMENTS AND RESULTS

Example 5: No of characters = 130

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.24
Figure 4.23
Data Embedded
Host image

NED UNIVERSITY OF ENGINEERING AND TECHNOLOGY


CHAPTER 4 67 EXPERIMENTS AND RESULTS

stego Image Diff. In 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.

NED UNIVERSITY OF ENGINEERING AND TECHNOLOGY


CHAPTER 4 68 EXPERIMENTS AND RESULTS

Example 6: 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.27 Figure 4.28


Host image Data Embedded

NED UNIVERSITY OF ENGINEERING AND TECHNOLOGY


CHAPTER 4 69 EXPERIMENTS AND RESULTS

stego Image Diff. In Image

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

Figure 4.29 Figure 4.30


Stego image Difference image

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.

NED UNIVERSITY OF ENGINEERING AND TECHNOLOGY


CHAPTER 4 70 EXPERIMENTS AND RESULTS

4.4.1 PSNR Versus No Of Characters

PSNR Versus No of Charcters


42.5

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:

PSNR is basically one of metrics to determine the degradation in the embedded


image with respect to the host image. We see that the Peak to signal noise ratio
decreases as the no of characters increases. The values are above 30 db and we
know that the values over 36 dB in PSNR are acceptable in terms of degradation,
which means no significant degradation is observed by human eye.

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
71

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.

Steganography is generally used for hidden communications. We have explored


the limits of Steganography theory and practice which gave us a clear idea of the
theory behind this subject and the various techniques involved in its
implementation.

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.

There are several different approaches to the creation of the steganographic


system. We chose MATLAB for creation of the system since we were more
familiar to the software.

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.

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
73 REFERENCES

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

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
74 APPENDICES

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);

%% perform TWO level decomposition using Haar function


[ca,ch,cv,cd]=dwt2(double(Y),'haar');
[ca1,ch1,cv1,cd1]=dwt2(double(ca),'haar');

%% 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);

%% Encryption of the message


encrypt=crypto(mes)
DecimalMsg=double(encrypt);
BinaryMsg=de2bi(DecimalMsg,8)
EmbeddingString=BinaryMsg(:);
t=length(DecimalMsg);
ExBinMsg=reshape(BinaryMsg,t,8);
ExDecMsg=bi2de(ExBinMsg);
ExMsg=char(ExDecMsg)

%% calculating minimum energy


temp=ch1(:);
count=1;
for i=1:1:length(temp)-(t+1)*8
Energy(count)=sum(temp(i:i+t*8).^2)/(t*8);
count=count+1;
end
[Mini Index]=min(Energy)

%% saving location where energy is minimum and data embedding


starts
cv(1,1)=Index;

%% saving length of the message


cv(1,2)=t;
75 APPENDICES

%% 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'));

%% combining back to rgb


Ipro=uint8(Icbcr);
Ipro(:,:,1)=Y2;
stagimage=ycbcr2rgb(Ipro);

%% showing stegoimage
imagesc(stagimage);
title('stego Image')

%% saving stego image as embed.jpg


imwrite(stagimage,'embed.jpg','mode','lossless');

 Extraction

%% reading the saved stego image named as embed.jpg


RGB2=imread('embed.jpg');

%% converting RGB to YCbCr


Icbcr2=rgb2ycbcr(RGB2);
Y3=Icbcr2(:,:,1);

%% taking wavelet twice


[ca3,ch2,cv2,cd2]=dwt2(double(Y3),'haar');
[ca4,ch3,cv3,cd3]=dwt2(double(ca3),'haar');

%% retrieveing location where message is saved


IIndex=floor(cv2(1,1))
Llength=ceil(cv2(1,2))

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)

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY
76 APPENDICES

%% 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;

 Code for Peak Signal to Noise Ratio


function psnr= PSNR(X,Y)
%Calculates the Peak-to-peak Signal to Noise Ratio of two images X
and Y
[M,N]=size(X);
m=double(0);
X=cast(X,'double');
Y=cast(Y,'double');
for i=1:M
for j=1:N
m=m+((X(i,j)-Y(i,j))^2);
end
end
m=m/(M*N);
psnr=10*log10(255*255/m);

NED UNIVERSITY OF ENGINEERING AND


TECHNOLOGY

You might also like