You are on page 1of 49

A

Project Report

On

Image Hiding using Steganography in Matlab

CONTENTS

1. Abstract…………………………………………………….3
2. Introduction…………………………………………………….7

3. Representation of Image………………………………………..8
2.1 Definition of Images……………………………………..9
2.2 Types of Images in the Field of Computer Science……..10
2.2.1 Images as Functions…………………………...…12
2.2.2 Basic Types of Images………………………...…12
2.3 Types of Images…………………………………………13
2.3.1 Black And White Images………………...………13
2.3.2 Grey Scale Images………………………...……..14
2.3.3 Color Images…………………………………......15
2.4 Different Types of Formats………………………………16
2.5 Image Processing…………………………………………16
2.6 Different Color Models……………………………………17
2.7 Digital Image Processing …………………………………18
2.8 Advantages of Digital Image Processing…………………19
2.9 Steps in Digital Image Processing………………………..19
2.10 Important Stages of Image Processing ………………….20

1
2.10.1 Image Acquisition………………………………20
2.10.2 Processing ………………………………………20
2.10.3 Segmentation……………………………………21
2.10.4 Representation and Description………………21
2.10.5 Recognition and Interpretation………………..21
2.10.6 Knowledge Base………………………………...22
2.11 Current Trends in DIP ………………………………….22
2.12 Applications…………………………………………….22

3. Concept of Staganography……………………………………23

4. Introduction to MATLAB……………………………………33
4.1 The MATLAB System…………………………………34
4.2 Graphical Versus Command-Line Users……………….37
4.3 MATLAB Help …………………………………………37
4.4 Basic Commands and Syntaxes ………………………..38
4.5 Saving Work…………………………………………….40
4.6 Transforms………………………………………………40
4.7 What is transform? ……………………………………. 41
4.8 The wavelet Transform…………………………………42
4.9 Discrete Wavelet Transform……………………………45

CONCLUSION…………………………………………………..48

BIBLOGRAPHY…………………………………………………49
.

ABSTRACT

2
Steganography is the practice of hiding private or sensitive information within

something that appears to be nothing out of the usual. Steganography is often confused

with cryptology because the two are similar in the way that they both are used to protect

important information.

The difference between the two is that Steganography involves hiding

information so it appears that no information is hidden at all. If a person or persons

views the object that the information is hidden inside of he or she will have no idea that

there is any hidden information, therefore the person will not attempt to decrypt the

information. Steganography comes from the Greek words Steganós (Covered) and

Graptos (Writing).Steganography in the modern day sense of the word usually refers to

information or a file that has been concealed inside a digital Picture, Video or Audio file.

What Steganography essentially does is exploit human perception, human

senses are not trained to look for files that have information hidden inside of them,

although there are programs available that can do what is called Steganalysis. The

most common use of Steganography is to hide a file inside file.When information or a

file is hidden inside a carrier file, the data is usually encrypted with a password. In this

project we develop a code in MATLAB to implement the steganography of an image

with a hidden text which can be tracked out at the other end.

CHAPTER -2

3
INTRODUCTION:
Communication is inevitable and it brought the people under
one shadow .There are several modes and styles of communication
are evolved over the years for meeting the requirements of the
population. In order to maintain secrecy, communication through
ciphered texts is playing a vital role in the present running world of
communication.

People are working for maintaining secured communication;


the present objective of this dissertation is also in direction of
communication to end user by providing certain degree of security.
The mode of communication adopted here is through images, the
motivation evolved in this project is the philosophy of watermarking
and stenography. The main objective is to send a message by
embedding in an image, such that other than the end user no one will
be able to extract or even will be able to notice that a message is
embedded in image.

For the convenience of the reader a brief introduction to the


image characteristics are given in the 2nd chapter titled image
representation, followed by the watermarking and stenography. Then
encryption and decryption techniques are discussed in the chapter
that follows.

The essential components needed to carry out the project in


MATLAB environment are discussed in the chapter ‘Introduction to
MATLAB’, where the functions used and several attributes that have
been used for running the project code can be known.

The modules developed in the implementation are integrated


to provide an auxiliary encryption scheme. This will be ready for the
transmission through the channel. At the receiver end the decryption
scheme and modules for the extraction for end user are provided. The

4
testing and the evaluation of the performance are discussed in the
chapter 5, followed by the instruction manual.

The report concludes with conclusion and further works.

CHAPTER -3

5
REPRESENTATION OF IMAGES

INTRODUCTION:

In this chapter we discuss in detail about the image, types


of images, image representation and image processing.

3.1 DEFINITIONS OF IMAGE:

It has different definitions depend upon the field they are used.

• Physics:
An optically formed duplicate, counterpart, or other
representative reproduction of an object, especially an optical
reproduction formed by a lens or mirror.

• Mathematics:
A set of values of a function corresponding to a particular
subset of a domain.

• Computer Science:
An exact replica of the contents of a storage device, such
as a hard disk, stored on a second storage device, such as a
network server.

• Image, in optics, likeness or counterpart of an object produced


when rays of light coming from that object are reflected from a
mirror or are refracted by a lens.
• Visual counterpart or likeness of an object, a person, or a scene
produced by an optical device such as a mirror or a camera.
• Images may be two dimensional, such as a photograph, or three
dimensional such as in a statue. They are typically produced by
optical devices—such as cameras, lenses, mirrors, telescopes,
microscopes, etc. and natural objects and phenomena, such as
the human eye or water surfaces.

6
3.2 Types of Images in the Field of Computer Graphics:
There are two basic types of image file formats. They are
1. Vector Format
2. Raster Format or
Bitmap based

1. Vector Format:

The image is defined by mathematically lines, curves,


circles etc, which are stored as mathematical formulas. It is mainly
used in drawing programs like CorelDraw, Adobe Illustrator, and
Macromedia Freehand.

7
2.Raster Format or Bitmap Format:

A bitmap image is made up of pixels or bits (binary


digits) of information arranged on a grid. Each bit can be visualized as
a dot. The number of pixels per unit of measurement, example, ppi
(pixels per inch) or dpi (dots per inch) determines the resolution of the
image.

8
3.2.1 Images as Functions:

3.2.2 Basic Types of Images:

• Analog Images:
While the painter may use and mix the paint rather freely
to recreate ”reality”, the photographer is normally less free. What put
color on his canvas, which traditionally has been photographic film, is
light sent from objects/scenes which he wants to present. The
film/photo paper is exposed to the light which reaches it, and
thereafter stores the amount of light analogically, by exposing each
grain on the film/photo paper proportionately to the light intensity
reaching each grain on the film.

9
• Digital Images:

According to the compendium a digital image is a


collection of small image elements with a given position and a value
describing the grey level or color of the image element. The smallest
image element that the image consists of is called a pixel.

The number of pixels the image is divided into, defines


the resolution of the digital image. Modern digital cameras can
generate digital images with more than 3 million pixels, and are
almost as good as analog cameras for most purposes. It is usually
stated that the resolution of an analog camera/film (image size = 36
mm * 24 mm) corresponds to approximately 5 million pixels

3.3Types of Images:

1. Black & White Images


2. Grayscale Images
3. Color Images

3.3.1 Black & White Images:

10
This type of image contains only two levels either white or
black.
So, it is represented by using only one bit per pixel.

2.3.2 Grey Scale Images:

11
A series of shades from white to black. The more shades, or
levels, the more realistic an image can be recorded and displayed,
especially a scanned photo. Scanners differentiate typically from 16 to
256 gray levels.

2.3.3 Color Images:

12
The term color image simply means that the image is
build up of different colors to define the photographed subject. This in
opposite to grayscale or monochrome images. The color images may
use 8 bits or 24 bits to represent each pixel. The images which will
use 8 bit s are called palette based images and which will use 24 bits
is called true color images.

3.4 Different Types Of Formats:

13
1. Gif : graphics interchange format
2. Png : Portable network graphics
3. Tiff : Tagged image file format
4. Jpeg : Joint photographer’s experts group
.

2.5 Image Processing:

Manipulating data in the form of an image through several


possible techniques. An image is usually interpreted as a two-
dimensional array of brightness values, and is most familiarly
represented by such patterns as those of a photographic print, slide,
television screen, or movie screen. An image can be processed
optically, or digitally with a computer.

The analysis of a picture using techniques that can identify


shades, colors and relationships that cannot be perceived by the
human eye. Image processing is used to solve identification problems,
such as in forensic medicine or in creating weather maps from satellite
pictures. It deals with images in bitmapped graphics format that have
been scanned in or captured with digital cameras. Any image
improvement, such as refining a picture in a paint program that has
been scanned or entered from a video source.

14
2.6 Different color models:

15
The RGB color model is an additive model in which red,
green, and blue (often used in additive light models) are combined in
various ways to reproduce other colors. The name of the model and
the abbreviation ‘RGB’come from the three primary
colors,red,green,and blue. These three colors should not be confused
with the primary pigments of red,blue,and yellow known in the art
world as ‘primary colors’.

2.7 Digital Image Processing:

Digital image processing is the use of computer


algorithms to perform image processing on digital images. Digital
image processing has the same advantages over analog image
processing as digital signalprocessing has over analog signal
processing — it allows a much wider range of algorithms to be applied
to the input data, and can avoid problems such as the build-up of
noise and signal distortion during processing. The most common kind
of digital image processing is digital image editing.

16
2.8 Advantages of Digital Image Processing:

Digital image processing techniques are generally more


versatile, reliable, and accurate; they have the additional benefit of
being easier to implement than their analog counterparts. Specialized
hardware is still used for digital image processing: computer
architectures based on pipelining have been the most commercially
successful. Today, hardware solutions are commonly used in video
processing systems. However, commercial image processing tasks
are more commonly done by software running on conventional
personal computers.

2.9 Steps in Digital Image Processing:

17
2.10 Important Stages in Image Processing:

1. Image Acquisition
2.Preprocessing
3.Segmentation
4. Representation and Description
5. Recognition and Interpretation
6. Knowledge base

2.10.1 Image Acquisition:


Imaging sensor & capability to digitize the signal
collected by the sensor.
1.Video camera

18
2.Digital camera
3.Conventional camera & analog-to-digital converter

2.10.2 Preprocessing:
To improve the image to ensure the success of further
processes.

e.g: Enhancing contrast


Removing noise
Identifying information-rich areas

2.10.3 Segmentation:

To partition the image into its constituent parts (objects).

Autonomous segmentation (very difficult).


Can facilitate or disturb subsequent
processes.
2. Output (representation):
Raw pixel data, depicting either boundaries
or whole regions (corners vs. texture for
example).
Need conversion to a form suitable for
computer processing.

3. (Description)

2.10.4 Representation & Description:

1. Feature selection (description) deals with


extracting.

2. Features that result in quantitative information of


interest or

3. Features these are important for differentiating one


class of objects from another.

19
2.10.5 Recognition & Interpretation:

1. To assign a label to an object based on


information provided by the descriptors.
2. To assign meaning to a group of recognized
objects

2.10.6 Knowledge Base:

1. Knowledge database
2. Guides the operation of each processing module
and controls the interaction between modules.

2.11 Current trends in DIP:

1. Cryptography
2. Steganography
3. Steganalysis
4. Watermarking
5. Denoising
6. Hashing
7. Segmentation

2.12 Applications:

1.The simplest way to catogarize the applications in


image processing is to divide according to the image sources
2. The principal energy source for images is now “The
electromagnetic spectrum”and the other sources are acoustic,
ultrasonic and electronic energies.

20
CHPTER-4
II. What is Steganography and why is it important?

Steganography or Stego as it is often referred to in the IT community,


literally means, "Covered writing" which is derived from the Greek
language.

Steganography is defined by Markus Kahn [5] as follows,


"Steganography is the art and science of communicating in a way which
hides the existence of the communication. In contrast to Cryptography,
where the enemy is allowed to detect, intercept and modify messages
without being able to violate certain security premises guaranteed by a
cryptosystem, the goal of Steganography is to hide messages inside other
harmless messages in a way that does not allow any enemy to even detect
that there is a second message present".

In a digital world, Steganography and Cryptography are both intended


to protect information from unwanted parties. Both Steganography and
Cryptography are excellent means by which to accomplish this but neither
technology alone is perfect and both can be broken. It is for this reason that
most experts would suggest using both to add multiple layers of security.

Steganography can be used in a large amount of data formats in the


digital world of today. The most popular data formats used are .bmp,
.doc, .gif, .jpeg, .mp3, .txt and .wav.

Mainly because of their popularity on the Internet and the ease of use
of the steganographic tools that use these data formats. These formats are
also popular because of the relative ease by which redundant or noisy data
can be removed from them and replaced with a hidden message.

21
Steganographic technologies are a very important part of the future of
Internet security and privacy on open systems such as the Internet.
Steganographic research is primarily driven by the lack of strength in the
cryptographic systems on their own and the desire to have complete
secrecy in an open-systems environment.

Many governments have created laws that either limit the strength of
cryptosystems or prohibit them completely. This has been done primarily
for fear by law enforcement not to be able to gain intelligence by wiretaps,
etc. This unfortunately leaves the majority of the Internet community either
with relatively weak and a lot of the times breakable encryption algorithms
or none at all. Civil liberties advocates fight this with the argument that
“these limitations are an assault on privacy”. This is where Steganography
comes in. Steganography can be used to hide important data inside
another file so that only the parties intended to get the message even
knows a secret message exists. To add multiple layers of security and to
help subside the "crypto versus law" problems previously mentioned, it is a
good practice to use Cryptography and Steganography together.

As mentioned earlier, neither Cryptography nor Steganography are


considered "turnkey solutions" to open systems privacy, but using both
technologies together can provide a very acceptable amount of privacy for
anyone connecting to and communicating over these systems.
E4 A169 4E46
Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169
4E46
III. A Brief History of Steganography

The earliest recordings of Steganography were by the Greek historian


Herodotus in his chronicles known as "Histories" and date back to around
440 BC. Herodotus recorded two stories of Steganographic techniques
during this time in Greece. The first stated that King Darius of Susa shaved
the head of one of his prisoners and wrote a secret message on his scalp.
When the prisoner’s hair grew back, he was sent to the Kings son in law
Aristogoras in Miletus undetected. The second story also came from
Herodotus, which claims that a soldier named Demeratus needed to send a
message to Sparta that Xerxes intended to invade Greece. Back then, the
writing medium was text written on wax-covered tablets. Demeratus
removed the wax from the tablet, wrote the secret message on the

22
underlying wood, recovered the tablet with wax to make it appear as a
blank tablet and finally sent the document without being detected.

Romans used invisible inks, which were based on natural substances


such as fruit juices and milk. This was accomplished by heating the hidden
text, thus revealing its contents.
Invisible inks have become much more advanced and are still in
limited use today.
During the 15th and 16th centuries, many writers including Johannes
Trithemius (author of Steganographia) and Gaspari Schotti (author or
Steganographica) wrote on Steganagraphic techniques such as coding
techniques for text, invisible inks, and incorporating hidden messages in
music.

Between 1883 and 1907, further development can be attributed to the


publications of Auguste Kerckhoff (author of Cryptographic Militaire) and
Charles Briquet (author of Les Filigranes). These books were mostly about
Cryptography, but both can be attributed to the foundation of some
steganographic systems and more significantly to watermarking
techniques.

During the times of WWI and WWII, significant advances in


Steganography took place. Concepts such as null ciphers (taking the 3rd
letter from each word in a harmless message to create a hidden message,
etc), image substitution and microdot (taking data such as pictures and
reducing it to the size of a large period on a piece of paper) were
introduced and embraced as great steganographic techniques.

In the recent digital world of today, namely 1992 to present,


Steganography is being used all over the world on computer systems.
Many tools and technologies have been created that take advantage of old
steganographic techniques such as null ciphers, coding in images, audio,
video and microdot. With the research this topic is now getting we will see a
lot of great applications for Steganography in the near future.

IV. A Detailed Look at Steganography

23
In this section we will discuss Steganography at length. We will start
by looking at the different types of Steganography generally used in
practice today along with some of the other principles that are used in
Steganography. We will then look at some of the Steganographic
techniques in use today. This is where we will look at the nuts and bolts of
Steganography and all the different ways we can use this technology. We
will then close by going over Steganalysis. Steganalysis concentrates on
the art and science of finding and or destroying secret messages that have
been produced using any of the various steganographic techniques we will
cover in this paper.

To start, lets look at what a theoretically perfect secret


communication (Steganography) would consist of. To illustrate this
concept, we will use three fictitious characters named Amy, Bret and
Crystal. Amy wants to send a secret message (M) to Bret using a random
(R) harmless message to create a cover (C) which can be sent to Bret
without raising suspicion. Amy then changes the cover message (C) to a
stego-object (S) by embedding the secret message (M) into the cover
message (C) by using a stego-key (K). Amy should then be able to send
the stegoobject (S) to Bret without being detected by Crystal. Bret will then
be able to read the secret message (M) because he knows the stego-key
(K) used to embed it into the cover message (C). As Fabien A.P. Petitcolas
[2] points out, "in a 'perfect' system, a normal cover should not be
distinguishable from a stego-object, neither by a human nor by a computer
looking for statistical patterns." In practice, however, this is not always the
case. In order to embed secret data into a cover message, the cover must
contain a sufficient amount of redundant data or noise. This is because the
embedding process Steganography uses, actually replaces this redundant
data with the secret message. This limits the types of data that we can use
with Steganography.

In practice, there are basically three types of steganographic protocols


used. They are Pure Steganography, Secret Key Steganography and
Public Key Steganography.
Pure Steganography is defined as a steganographic system that does not
require the exchange of a cipher such as a stego-key. This method of
Steganography is the least secure means by which to communicate
secretly because the sender and receiver can rely only upon the

24
presumption that no other parties are aware of this secret message. Using
open systems such as the Internet, we know this is not the case at all.

Secret Key Steganography is defined as a steganographic system that


requires the exchange of a secret key (stego-key) prior to communication.
Secret Key Steganography takes a cover message and embeds the secret
message inside of it by using a secret key (stego-key). Only the parties
who know the secret key can reverse the process and read the secret
message. Unlike Pure Steganography where a perceived invisible
communication channel is present, Secret Key Steganography exchanges
a stego-key, which makes it more susceptible to interception. The benefit to
Secret Key Steganography is even if it is intercepted, only parties who
know the secret key can extract the secret message.

Public Key Steganography takes the concepts from Public Key


Cryptography as
explained below. Public Key Steganography is defined as a steganographic
system that uses a public key and a private key to secure the
communication between the parties wanting to communicate secretly. The
sender will use the public key during the encoding process and only the
private key, which has a direct mathematical relationship with the public
key, can decipher the secret message. Public Key Steganography provides
a more robust way of implementing a steganographic system because it
can utilize a much more robust and researched technology in Public Key
Cryptography. It also has multiple levels of security in that unwanted parties
must first suspect the use of steganography and then they would have to
find a way to crack the algorithm used by the public key system before they
could intercept the secret message.

A. Encoding Secret Messages in Text


Encoding secret messages in text can be a very challenging task. This is
because
text files have a very small amount of redundant data to replace with a
secret message. Another drawback is the ease of which text based
Steganography can be altered by an unwanted parties by just changing the
text itself or reformatting the text to some other form (from .TXT to .PDF,
etc.). There are numerous methods by which to accomplish text based
Steganography. I will introduce a few of the more popular encoding
methods below.

25
= AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46
Line-shift encoding involves actually shifting each line of text vertically up or
down by as little as 3 centimeters. Depending on whether the line was up
or down from the stationary line would equate to a value that would or
could be encoded into a secret message.

Word-shift encoding works in much the same way that line-shift encoding
works,
only we use the horizontal spaces between words to equate a value for the
hidden message. This method of encoding is less visible than line-shift
encoding but requires that the text format support variable spacing.

Feature specific encoding involves encoding secret messages into


formatted text
by changing certain text attributes such as vertical/horizontal length of
letters such as b, d, T, etc. This is by far the hardest text encoding method
to intercept as each type of formatted text has a large amount of features
that can be used for encoding the secret message.

All three of these text based encoding methods require either the original
file or
the knowledge of the original files formatting to be able to decode the
secret message.

B. Encoding Secret Messages in Images


Coding secret messages in digital images is by far the most widely used of
all
methods in the digital world of today. This is because it can take advantage
of the limited power of the human visual system (HVS). Almost any plain
text, cipher text, image and any other media that can be encoded into a bit
stream can be hidden in a digital image. With the continued growth of
strong graphics power in computers and the research being put into image
based Steganography, this field will continue to grow at a very rapid pace.
Before diving into coding techniques for digital images, a brief explanation
of digital image architecture and digital image compression techniques
should be explained.
As Duncan Sellars [7] explains "To a computer, an image is an array of
numbers

26
that represent light intensities at various points, or pixels. These pixels
make up the images raster data." When dealing with digital images for use
with Steganography, 8-bit and 24-bit per pixel image files are typical. Both
have advantages and disadvantages, as we will explain below.

8-bit images are a great format to use because of their relatively small size.
The drawback is that only 256 possible colors can be used which can be a
potential problem during encoding. Usually a gray scale color palette is
used when dealing with 8-bit images such as (.GIF) because its gradual
change in color will be harder to detect after the image has been encoded
with the secret message. 24-bit images offer much more flexibility when
used for Steganography. The large numbers of colors (over 16 million) that
can be used go well beyond the human visual system (HVS), which makes
it very hard to detect once a secret message, has been encoded. The other
benefit is that a much larger amount of hidden data can be encoded into a
24-bit digital image as opposed to an 8-bit digital image. The one major
drawback to 24-bit digital images is their large size (usually in MB) makes
them more suspect than the much smaller 8-bit digital images (usually in
KB) when sent over an open system such as the Internet.

Digital image compression is a good solution to large digital images such


as the
24-bit images mentioned earlier. There are two types of compression used
in digital images, lossy and lossless. Lossy compression such as (.JPEG)
greatly reduces the size of a digital image by removing excess image data
and calculating a close approximation of the original image. Lossy
compression is usually used with 24-bit digital images to reduce its size,
but it does carry one major drawback. Lossy compression techniques
increase the possibility that the uncompressed secret message will lose
parts of its contents because of the fact that lossy compression removes
what it sees as excess image data. Lossless compression techniques, as
the name suggests, keeps the original digital image in tact without the
chance of loss. It is for this reason that it is the compression technique of
choice for steganographic uses. Examples of lossless compression
techniques are (.GIF and .BMP). The only drawback to lossless image
compression is that it doesn't do a very good job at compressing the size of
the image data.
We will now discuss a couple of the more popular digital image encoding
techniques used today. They are least significant bit (LSB) encoding and
masking and filtering techniques.

27
Least significant bit (LSB) encoding is by far the most popular of the coding
techniques used for digital images. By using the LSB of each byte (8 bits)
in an image for a secret message, you can store 3 bits of data in each pixel
for 24-bit images and 1 bit in each pixel for 8-bit images. As you can see,
much more information can be stored in a 24-bit image file. Depending on
the color palette used for the cover image (i.e., all gray), it is possible to
take 2 LSB's from one byte without the human visual system (HVS) being
able to tell the difference. The only problem with this technique is that it is
very vulnerable to attacks such as image changes and formatting (i.e.,
changing from .GIF to .JPEG).

Masking and filtering techniques for digital image encoding such as Digital
Watermarking (i.e.- integrating a companies logo on there web content) are
more popular with lossy compression techniques such as (.JPEG). This
technique actually extends an images data by masking the secret data over
the original data as opposed to hiding information inside of the data. Some
experts argue that this is definitely a form of Information Hiding, but not
technically Steganography. The beauty of Masking and Filtering techniques
are that they are immune to image manipulation which makes there
possible uses very robust.

There are techniques that use complex algorithms, image transformation


techniques and image encryption techniques which are still, relatively new,
but show promise to be more secure and robust ways to use digital images
in Steganography.

C. Encoding Secret Messages in Audio


Encoding secret messages in audio is the most challenging technique to
use when dealing with Steganography. This is because the human auditory
system (HAS) has such a dynamic range that it can listen over. To put this
in perspective, the (HAS) perceives over a range of power greater than one
million to one and a range of frequencies greater than one thousand to one
making it extremely hard to add or remove data from the original data
structure. The only weakness in the (HAS) comes at trying to differentiate
sounds (loud sounds drown out quiet sounds) and this is what must be
exploited to encode secret messages in audio without being detected.
There are two concepts to consider before choosing an encoding technique
for audio. They are the digital format of the audio and the transmission
medium of the audio.

28
There are three main digital audio formats typically in use.
They are Sample Quantization, Temporal Sampling Rate and Perceptual
Sampling.
Sample Quantization which is a 16-bit linear sampling architecture used by
popular audio formats such as (.WAV and. AIFF). Temporal Sampling Rate
uses selectable frequencies (in the KHz) to sample the audio. Generally,
the higher the sampling rate is, the higher the usable data space gets. The
last audio format is Perceptual Sampling. This format changes the statistics
of the audio drastically by encoding only the parts the listener perceives,
thus maintaining the sound but changing the signal. This format is used by
the most popular digital audio on the Internet today in ISO MPEG (MP3).
Transmission medium (path the audio takes from sender to receiver) must
also be
considered when encoding secret messages in audio. W. Bender [8]
introduces four possible transmission mediums:

1) Digital end to end - from machine to machine without modification.

2) Increased/decreased resampling - the sample rate is modified but


remains digital.

3) Analog and resampled - signal is changed to analog and resampled at a


different rate.

4) Over the air - signal is transmitted into radio frequencies and resampled
from a microphone.

We will now look at three of the more popular encoding methods for hiding
data
inside of audio. They are low-bit encoding, phase-coding and spread
spectrum.

Low-bit encoding embeds secret data into the least significant bit (LSB) of
the
audio file. The channel capacity is 1KB per second per kilohertz (44 kbps
for a 44 KHz sampled sequence). This method is easy to incorporate but is
very susceptible to data loss due to channel noise and resampling.

Phase coding substitutes the phase of an initial audio segment with a


reference

29
phase that represents the hidden data. This can be thought of, as sort of an
encryption for the audio signal by using what is known as Discrete Fourier
Transform (DFT), which is nothing more than a transformation algorithm for
the audio signal.

Spread spectrum encodes the audio over almost the entire frequency
spectrum. It
then transmits the audio over different frequencies which will vary
depending on what spread spectrum method is used. Direct Sequence
Spread Spectrum (DSSS) is one such method that spreads the signal by
multiplying the source signal by some pseudo random sequence known as
a (CHIP). The sampling rate is then used as the chip rate for the audio
signal communication.

Spread spectrum encoding techniques are the most secure means by


which to send hidden
messages in audio, but it can introduce random noise to the audio thus
creating the chance of data loss. There are many applications for
Steganography, some good and some bad, which brings us to the closing
section of our in-depth look at Steganography in which we will look at
Steganalysis. Steganalysis is the art and science of stopping or detecting
the use of all steganographic techniques mentioned earlier. In
Steganalysis, the goal is to be able to compare the cover-object (cover
message), the stego-object (the cover message with the hidden data
embedded in it) and any possible portions of the stego-key (encryption
method) in an effort to intercept, analyze and/or destroy the secret
communication. As Fabien A.P. Petitcolas [2] points out in his book, there
are six general protocols used to attack the use of Steganography.

1) Stego only attack - only the stego object is available for analysis.

2) Known cover attack - the original cover object and the stego object are
available for analysis.

3) Known message attack - the hidden message is available to compare


with the stego-object.

4) Chosen stego attack - the stego tool (algorithm) and stego-object are
available for analysis.

30
5) Chosen message attack - takes a chosen message and generates a
stego object for future analysis.

6) Known stego attack - the stego tool (algorithm), the cover message and
the stego-objects are available for analysis.

This discussion of Steganalysis by showing the reader one example of how


someone could detect the use of steganographic tools that change the
least significant bit (LSB) of an image in order to embed secret data inside
of it.

Generally, bitmap images (.BMP) have known and predictable


characteristics. One such characteristic is the probability of near duplicate
colors. Bitmap images get their color from a central color table, which by its
nature have little, or no near duplicate colors. When hidden data is
embedded into the (LSB) of a bitmap image, it increases the number of
near duplicate colors dramatically. Generally speaking, any bitmap image
with more than fifty near duplicate colors should raise the suspicion of
embedded data being present.

V. Applications for Steganography in an Open Systems Environment

In this section we will look at some of the possible applications for


steganography and
then close by pointing out some of the more popular steganographic tools
available today.
The three most popular and researched uses for steganography in an open
systems environment are covert channels, embedded data and digital
watermarking.

Covert channels in TCP/IP involve masking identification information in the


TCP/IP
headers to hide the true identity of one or more systems. This can be very
useful for any secure communications needs over open systems such as
the Internet when absolute secrecy is needed for an entire communication
process and not just one document as mentioned next. Using containers
(cover messages) to embed secret messages into is by far the most
popular use of Steganography today. This method of Steganography is

31
very useful when a party must send a top secret, private or highly sensitive
document over an open systems environment such as the Internet. By
embedding the hidden data into the cover message and sending it, you can
gain a sense of security by the fact that no one knows you have sent more
than a harmless message other than the intended recipients.
Although not a pure steganographic technique, digital watermarking is very
common in
today's world and does use Steganographic techniques to embed
information into documents.

Digital watermarking is usually used for copy write reasons by companies


or entities that wish to protect their property by either embedding their
trademark into their property or by concealing serial numbers/license
information in software, etc. Digital watermarking is very important in the
detection and prosecution of software pirates/digital thieves.

The objective of this project is the security of image and security


has the following objectives:
- The transmitted information confidentiality-
- The transmitted information integrity,
- The transmitted information authenticity,
- The transmitted information non-repudiation,

32
CHPTER-5

INTRODUCTION TO MATLAB

INTRODUCTION:

MATLAB is a software package for computation in


engineering, science, and applied mathematics. It offers a powerful
programming language, excellent graphics, and a wide range of
expert knowledge. MATLAB is published by and a trademark of The
Math Works, Inc.
The focus in MATLAB is on computation, not mathematics:
Symbolic expressions and manipulations are not possible (except
through the optional Symbolic Toolbox, a clever interface to Maple).
All results are not only numerical but inexact, thanks to the rounding
errors inherent in computer arithmetic. The limitation to numerical
computation can be seen as a drawback, but it is a source of strength

33
too: MATLAB is much preferred to Maple, Mathematical, and the like
when it comes to numerics.
On the other hand, compared to other numerically
oriented languages like C++ and FORTRAN, MATLAB is much easier
to use and comes with a huge standard library. The unfavorable
comparison here is a gap in execution speed. This gap is not always
as dramatic as popular lore has it, and it can often be narrowed or
closed with good MATLAB programming. Moreover, one can link other
codes into MATLAB, or vice versa, and MATLAB now optionally
supports parallel computing. Still, MATLAB is usually not the tool of
choice for maximum-performance Computing.
The MATLAB niche is numerical computation on
workstations for non-experts in computation. This is a huge niche—
one way to tell is to look at the number of MATLAB-related books on
mathworks.com. Even for supercomputer users, MATLAB can be a
valuable environment in which to explore and fine-tune algorithms
before more laborious coding in another language. Most successful
computing languages and environments acquire a distinctive
character or culture. In MATLAB, that culture contains several
elements: an experimental and graphical bias, resulting from the
interactive environment and compression of the write-compile-link-
execute analyze cycle; an emphasis on syntax that is compact and
friendly to the interactive mode, rather than tightly constrained and
verbose; a kitchen-sink mentality for providing functionality; and a high
degree of openness and transparency (though not to the extent of
being open source software).

4.1 The MATLAB System:

When you start MATLAB, you get a multilayered desktop.


The layout and behavior of the desktop and its components are highly
customizable (and may in fact already be customized for your site).
The component that is the heart of MATLAB is called the Command
Window, located on the right by default. Here you can give MATLAB
commands typed at the prompt, >>. Unlike FORTRAN and other
compiled computer languages, MATLAB is an interpreted environment

34
—you give a command, and MATLAB tries to execute it right away
before asking for another.

At the top left you can see the Current Directory. In


general MATLAB is aware only of files in the current directory (folder)
and on its path, which can be customized. Commands for working with
the directory and path include cd, what, add path, and edit path (or
you can choose “File/Set path. . . ” from the menus). You can add files
to a directory on the path and thereby add Commands to MATLAB.
Next to the Current Directory tab is the Workspace tab.
The workspace shows you what variable names are currently defined
and some information about their contents. (At start-up it is, naturally,
empty.) This represents another break from compiled environments:
variables created in the workspace persist for you to examine and
modify, even after code execution stops. Below the Command
Window/Workspace window is the Command History window. As you
enter commands, they are recorded here. This record persists across
different MATLAB sessions, and commands or blocks of commands
can be copied from here or saved to files.
As you explore MATLAB, you will soon encounter some
toolboxes. These are individually packaged sets of capabilities that
provide in-depth expertise on particular subject areas. There is no
need to load them explicitly—once installed, they are always available
transparently. You may
also encounter some link, which is a semi-independent graphical
control- engineering package not covered in this document.

35
COMMAND WINDOW

Change the current working directory

36
4.2 Graphical Versus Command-Line Usage:

MATLAB was originally entirely a command-line


environment, and it retains that orientation. But it is now possible to
access a great deal of the functionality from graphical interfaces—
menus, buttons, and so on. These interfaces are especially useful to
beginners, because they lay out the available choices clearly. As a
rule, graphical interfaces can be more natural for certain types of
interactive work, such as annotating a graph or debugging a program,
whereas typed commands remain better for complex, precise,
repeated, or reproducible tasks.
One does not always need to make a choice, though; for
instance, it is possible to save a figure’s styles as a template that can
be used with different data by pointing and clicking. Moreover, you can
package code you want to distribute with your own graphical interface,
one that itself may be designed with a combination of graphical and
command-oriented tools. In the end, an advanced MATLAB user
should be able to exploit both modes of work to be productive. That
said, the focus of this document is on typed commands. In many
(most?) cases these have Graphical interface equivalents, even if I
don’t explicitly point them out.

4.3 MATLAB Help:

MATLAB is huge. Nobody can tell you everything that you


personally will need to know, nor could you remember it all anyway. It
is essential that you become familiar with the online help.

There are two levels of help:

• If you need quick help on the syntax of a command, use help. For
example, help plot shows right in the Command Window all the ways
in which you can use the plot command. Typing help by itself gives
you a list of categories that themselves yield lists of commands.
• Typing doc followed by a command name brings up more extensive
help in a separate window. For example, doc plot is better formatted

37
and more informative than help plot. In the left panel one sees a
hierarchical, brows able display of all the online documentation.
Typing doc alone or selecting Help from the menu brings
up the window at a “root” page. The Getting Started with MATLAB
manual is a very good place to get a more gentle and thorough
introduction than the one to follow here. Depending on your
installation, the documentation may be available in PDF form for
printing and offline reading.

4.4 Basic Commands and Syntax:

If you type in a valid expression and press Enter, MATLAB


will immediately execute it and return the result, just like a calculator.

>> 2+2
Ans =
4
>> 4ˆ2
Ans =
16
>> Sin (pi/2)
Ans =
1
>> 1/0
Warning: Divide by zero.
Ans =
Inf
>> exp (i*pi)
Ans =
-1.0000 + 0.0000i
Notice some of the special expressions here: pi for _, Inf for 1, and i
for p−1.another special value is NaN, which stands for not a number.
Nan is used to express an undefined value.
For example,
>> Inf/Inf
Ans =
NaN

38
NaNs can be tricky. For example, two NaN values are unequal by
definition.
You can assign values to variables with alphanumeric names.
>> x = sqrt (3)
x=
1.7321
>> days_since_birth = floor (now) - datenum (1969, 05, 06)
days_since_birth =
12810
>> 3*z
??? Undefined function or variable ’z’.Observe that variables must have
values before they can be used. When an expression returns a single
result that is not assigned to a variable, this result is assigned to ans,
which can then be used like any other variable.
>> Tan(x)
Ans =
1.0472
>> Pi/ans
Ans =
3.
In floating-point arithmetic, you should not expect “equal” values
to have a difference of exactly zero. The built-in number eps tells you
the maximum error in arithmetic on your particular machine. For
simple operations, the relative error should be close to this number.
For instance,
>> exp
Ans =
2.2204e-16
>> exp (log (10)) - 10
Ans =
1.7764e-15
>> Ans/10
Ans =
1.7764e-16
Here are a few other demonstration statements.
>> % anything after a % sign is a comment.
>> x = rand (100,100); %; means "don’t print out result"
>> s = ’Hello world’; % single quotes enclose a string
>> t = 1 + 2 + 3 +...

39
4 + 5 + 6 % ... continues a line
t=
21
Once variables have been defined, they exist in the workspace. You
can see what’s in the
Workspace from its desktop window, or by typing
>> Who
Your variables are:
Ans s t x

4.5 Saving Work:

If you enter save my file, all the variables in the workspace will
be saved to a file called myfile.mat in the current directory. You can
also select the variables to be saved by typing them after the filename
argument. If you later enter load my file, the saved variables are
returned to the workspace (overwriting any values with the same
names).

If you highlight commands in the Command History


window, right-click, and select “Create M-File”, you can save the typed
commands to a text file. This can be very helpful for recreating what
you have done.

4.6 Transforms:

INTRODUCTION:

Image authentication in traditional manner requires the


storage and transmission of signature strings in the image header [1].
This methods imposes limitations on the image /file format –
sometimes preventing implementation in legacy systems. It is also
susceptible to loss during format conversions—even if the underlying
image data remains intact. It is therefore desirable to include the
digital signatures within the image data [2-5]. This goal can be
achieved using image watermarking [6-7] which allows the user to

40
hide an invisible message inside a multimedia content for security
purposes. There is a trade off between three parameters in digital
watermarking: data payload, fidelity criteria and robustness.

Data payload is the number of useful bits that can be


hidden in an image which depends on the size of the hoist image. A
fidelity criterion is the perceptual similarity between the original and
watermarked image. Fidelity can be checked subjectively (depends on
human visual system) and objectively (using PSNR (peak signal to
noise ratio) or MSE (mean square error).Finally robustness means the
retriever should be able to retrieve the message even after applying
various digital image processing techniques like compression etc.

The functionality offered by digital watermarks, however,


often comes at the expense of image fidelity. Most watermarking
techniques modify and hence distort the host signal in order to insert
authentication information. In many applications like satellite images
loss of fidelity is not prohibitive as long as original and modified
images are perceptually equivalent. On the other hand, sometimes
where the need for authentication is often paramount there are
stringent constraints on data fidelity that prohibit any permanent signal
distortion in the watermarking process. The loss of signal fidelity can
be remedied by the use of lossless authentication watermarks [8-10].
In this paper we propose a new technique of robust watermarking,
which separates the host image into an approximation part and a
detail part. The control of the details of an image permits to insert the
hidden message into a location such that the message survives the
image processing technique.

4.7 WHAT IS A TRANSFORM?

WHY DO WE NEED TRANSFORMS?

A Transform is a mathematical operation that takes a


function or sequence and maps it into another one. Transforms are
used because

41
1 a) The transform of a function may give additional /hidden
information about the original function, which may not be available
/obvious otherwise
2 b) The transform of an equation may be easier to solve than
the original equation (recall Laplace transforms for “Diff- Equations”).
3 c) The transform of a function/sequence may require less
storage; hence provide data compression / reduction.
d) An operation may be easier to apply on the transformed
function, rather than the original function (recall convolution).
Mathematical transformations are applied to signals to obtain
further information from that signal that is not readily available in the
raw signal. Most of the signals in practice, are Time domain signals in
their raw format, i.e. whatever that signal is measuring, is a function of
time. In other words, when we plot the signal, one of the axes is time
(independent variable), and the other (dependent variable) is usually
the amplitude. When we plot time-domain signal we obtain a Time –
Amplitude representation of the signal. This representation is not
always the best representation of the signal for most IMAGE
PROCESSING related applications.
In many cases, the most distinguished information is hidden
in the frequency content of the signal. The frequency spectrum of a
signal is basically the frequency components (spectral components) of
that signal. The frequency spectrum of a signal shows what
frequencies exist in the signal.
Intuitively, we all know that the frequency is something to do
with the change in rate of something. If something (a mathematical or
physical variable would be the technically correct term) changes
rapidly, we say that it is of high frequency, where as if this variable
does not change rapidly, i.e., it changes smoothly, we say that it is of
low frequency. If this variable does not change at all, then we say it
has zero frequency, For example the publication frequency of a daily
newspaper is higher than that of a monthly magazine. Frequency is
measured in cycles/second, or with a more common name, in "Hertz".

4.8 THE WAVELET TRANSFORM:

42
The Wavelet transform is a transform of this type i.e. it
provides the time-frequency representation. There are other
transforms which give this information too, such as short time Fourier
transforms, Wigner distributions.
Wavelet transform is capable of providing the time and frequency
information simultaneously, hence giving a time-frequency
representation of the signal. The WT was developed as an alternative
to the STFT (Short Time Fourier Transform). The advantages of
Wavelet Transform is
a. Overcomes the present resolution problem of the STFT by using a
variable length window
b. Analysis windows of different lengths are used for different
frequencies:
c. For analysis of high frequencies, Use narrower windows for better
time resolution
d. For analysis of low frequencies, Use wider windows for better
frequency resolution
e. This works well, if the signal to be analyzed mainly consists of
slowly varying characteristics with occasional short high frequency
bursts.
f. Heisenberg principle still holds good
g. The function used to window the signal is called the wavelet.
Wavelet Transforms basically work on two properties a) Scaling
property and b) Translation property

1Translation Property: It is the time shift property


2f(t) f(a.t) a>0
3If 0<a<1 then contraction takes place i.e. low scale (high
frequency)
4If a>1 then dilation takes place i.e. expansion, large scale (lower
frequency)
5if f(t) f(a/t) a>0
6If 0<a<1 then dilation takes place i.e. large scale (lower
frequency)
7If a>1 then contraction takes place, low scale (high frequency).

1Scaling Property : It has a similar meaning as that of scale in maps

43
2 A. Large scale: Overall view, long term behavior
3 B. Small scale: Detail view, local behavior

Continuous Wavelet Transform:

The continuous wavelet transform is obtained using the equation:

Computation of CWT:

44
Fig 2.2.1 COMPUTATION OF CWT

4.9 DISCRETE WAVELET TRANSFORM (DWT):

In DWT we pass the time domain signal through various low pass
and high pass filters, which filters out either the high frequency or low
frequency portions of the signal. This procedure is repeated and every
time some portion of the signal corresponding to some frequencies is
separated from the signal and hence various Coefficients of DWT are
formed.

45
The equation of DWT is

46
IMPLEMENTATION OF DWT

The LL band contains the detail part(low frequency)of the


image whereas other bands have higher frequencies of the image.

47
The watermark is inserted into the LL band of the wave transformed
image, so that the image survives the compression and other image
processing techniques which always preserves the lower frequencies
and eliminates the high frequencies.

CONCLUSION

Staganogeaphy has been used as a tool for transferring the data or


message securely and also provides assistance to management of
information. In our project we have considered a message which is
embedded invisibly into an image which is to be detected by the end user
only. We have implemented this project using MATLAB.

48
BIBLIOGRAPHY
1) http://www.watermarkingworld.org/

2) http://en.wikipedia.org/wiki/digital_watermarking

3) Wavelet Transforms: Introduction to Theory and Applications by


Bopardikar, Addison Wesley, 1998.

4) Wavelets and Filter Banks, Gilbert Strang and Truong Nguyen,


Wellesley-Cambridge press, 1997.

5) Introduction to Wavelets and Wavelet Transforms: A Primer, Burrens,


Gopinath and Guo.

6) Digital Image Processing by Milan soni.

7) Digital I Digital image processing by A.K. Jain.

8) MATLAB Reference manual.

49