Sie sind auf Seite 1von 80

CHAPTER 1

INTRODUCTION

An image is a rectangular grid of pixels. It has a definite height


and a definite width counted in pixels. Each pixel is square and has a
fixed size on a given display. However different computer monitors
may use different sized pixels.

Each pixel has a color. The color is a 32-bit integer. The first
eight bits determine the redness of the pixel, the next eight bits the
greenness, the next eight bits the blueness, and the remaining eight bits
the transparency of the pixel.

A digital image is a representation of a two-dimensional image


using ones and zeros (binary). Depending on whether or not the image
resolution is fixed, it may be of vector or raster type. Without
qualifications, the term "digital image" usually refers to raster images
also called bitmap images.

In electrical engineering and computer science, image processing


is any form of signal processing for which the input is an image, such
as a photograph or video frame; the output of image processing may be
either an image or, a set of characteristics or parameters related to the
image. Most image-processing techniques involve treating the image as

1
a two-dimensional signal and applying standard signal-processing
techniques to it.

Image processing usually refers to digital image processing, but


optical and analog image processing also are possible. This article is
about general techniques that apply to all of them. The acquisition of
images (producing the input image in the first place) is referred to as
imaging.

Digital image processing is the use of computer algorithms to


perform image processing on digital images. As a subcategory or field
of digital signal processing, digital image processing has many
advantages over analog image 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. Since images are defined over two
dimensions (perhaps more) digital image processing may be modeled
in the form of Multidimensional Systems.

Digital image processing allows the use of much more complex


algorithms for image processing, and hence, can offer both more
sophisticated performance at simple tasks, and the implementation of
methods which would be impossible by analog means.

2
In particular, digital image processing is the only practical
technology for:

 Classification
 Feature extraction

 Pattern recognition

 Projection

 Multi-scale signal analysis

1.1 TYPICAL OPERATIONS INCLUDE

 Euclidean geometry transformations such as enlargement, reduction,


and rotation
 Color corrections such as brightness and contrast adjustments, color
mapping, color balancing, quantization, or color translation to a
different color space

 Digital compositing or optical compositing (combination of two or


more images), which is used in film-making to make a "matte"

 Interpolation, demosaicing, and recovery of a full image from a raw


image format using a Bayer filter pattern

 Image registration, the alignment of two or more images

 Image differencing and morphing

3
 Image recognition, for example, may extract the text from the image
using optical character recognition or checkbox and bubble values
using optical mark recognition

 Image segmentation

 High dynamic range imaging by combining multiple images

 Geometric hashing for 2-D object recognition with affine invariance

1.2 APPLICATIONS
Computer vision, Optical sorting, Augmented Reality, Face
detection, Feature detection, Lane departure warning system, Non-
photorealistic rendering, Medical image processing, Microscope image
processing, Morphological image processing, Remote sensing.

1.3 STEGANOGRAPHY

Steganography is the art of passing information in a manner that


the very existence of the message is unknown. The goal of
steganography is to avoid drawing suspicion to the transmission of a
hidden message. If suspicion is raised, then this goal is defeated.
Steganography is the art and science of writing hidden messages in
such a way that no one, apart from the sender and intended recipient,
suspects the existence of the message, a form of security through
obscurity. The word steganography is of Greek origin and means
"concealed writing" from the Greek words steganos (στεγανός)
meaning "covered or protected", and graphein (γράφειν) meaning "to
write".
4
The first recorded use of the term was in 1499 by Johannes
Trithemius in his Steganographia, a treatise on cryptography and
steganography disguised as a book on magic. Generally, messages will
appear to be something else: images, articles, shopping lists, or some
other covertext and, classically, the hidden message may be in invisible
ink between the visible lines of a private letter.

The advantage of steganography over cryptography alone, is


that messages do not attract attention to themselves. Plainly visible
encrypted messages no matter how unbreakable will arouse suspicion,
and may in themselves be incriminating in countries where encryption
is illegal. Therefore, whereas cryptography protects the contents of a
message, steganography can be said to protect both messages and
communicating parties.

Steganography includes the concealment of information within


computer files. In digital steganography, electronic communications
may include steganographic coding inside of a transport layer, such as a
document file, image file, program or protocol. Media files are ideal for
steganographic transmission because of their large size. As a simple
example, a sender might start with an innocuous image file and adjust
the color of every 100th pixel to correspond to a letter in the alphabet, a
change so subtle that someone not specifically looking for it is unlikely
to notice it.

5
1.4 PHYSICAL STEGANOGRAPHY

Figure 1.1 Steganart example

Within this picture, the letter positions of a hidden message are


represented by increasing numbers (1 to 20), and a letter value is given
by its intersection position in the grid. For instance, the first letter of
the hidden message is at the intersection of 1 and 4. So, after a few
tries, the first letter of the message seems to be the 14th letter of the
alphabet; the last one (number 20) is the 5th letter of the alphabet.

6
Steganography has been widely used, including in
recent historical times and the present day. Possible permutations are
endless and known examples include:

 Hidden messages within wax tablets in ancient Greece, people


wrote messages on the wood, then covered it with wax upon which
an innocent covering message was written.

 Hidden messages on messenger's body also used in ancient Greece.


Herodotus tells the story of a message tattooed on a slave's shaved
head, hidden by the growth of his hair, and exposed by shaving his
head again. The message allegedly carried a warning to Greece
about Persian invasion plans. This method has obvious drawbacks,
such as delayed transmission while waiting for the slave's hair to
grow, and the restrictions on the number and size of messages that
can be encoded on one person's scalp.

 During World War II, the French Resistance sent some messages
written on the backs of couriers using invisible ink.

 Hidden messages on paper written in secret inks, under other


messages or on the blank parts of other messages.

 Messages written in Morse code on knitting yarn and then knitted


into a piece of clothing worn by a courier.

 Messages written on envelopes in the area covered by postage


stamps.

7
 During and after World War II, espionage agents used
photographically produced microdots to send information back and
forth. Microdots were typically minute, approximately less than the
size of the period produced by a typewriter. World War II microdots
needed to be embedded in the paper and covered with an adhesive,
such as collodion. This was reflective and thus detectable by
viewing against glancing light. Alternative techniques included
inserting microdots into slits cut into the edge of post cards.

 During World War II, a spy for Japan in New York City, Velvalee
Dickinson, sent information to accommodation addresses in neutral
South America. She was a dealer in dolls, and her letters discussed
how many of this or that doll to ship. The stegotext was the doll
orders, while the concealed "plaintext" was itself encoded and gave
information about ship movements, etc. Her case became somewhat
famous and she became known as the Doll Woman.

 Cold War counter-propaganda. In 1968, crew members of the USS


Pueblo intelligence ship held as prisoners by North Korea,
communicated in sign language during staged photo opportunities,
informing the United States they were not defectors, but rather were
being held captive by the North Koreans. In other photos presented
to the U.S., crew members gave "the finger" to the unsuspecting
North Koreans, in an attempt to discredit photos that showed them
smiling and comfortable.

8
1.5 DIGITAL STEGANOGRAPHY

Modern steganography entered the world in 1985 with the advent


of the personal computer being applied to classical steganography
problems.Development following that was slow, but has since taken
off, going by the number of "stego" programs available: Over 800
digital steganography applications have been identified by the
Steganography Analysis and Research Center Digital steganography
techniques include:

 Concealing messages within the lowest bits of noisy images or


sound files.
 Concealing data within encrypted data or within random data. The
data to be concealed is first encrypted before being used to
overwrite part of a much larger block of encrypted data or a block
of random data (an unbreakable cipher like the one-time pad
generates ciphertexts that look perfectly random if you don't have
the private key)

 Chaffing and winnowing.

 Mimic functions convert one file to have the statistical profile of


another. This can thwart statistical methods that help brute-force
attacks identify the right solution in a ciphertext-only attack.

 Concealed messages in tampered executable files, exploiting


redundancy in the targeted instruction set.

9
 Pictures embedded in video material (optionally played at slower or
faster speed).

 Injecting imperceptible delays to packets sent over the network from


the keyboard. Delays in keypresses in some applications (telnet or
remote desktop software) can mean a delay in packets, and the
delays in the packets can be used to encode data.

 Changing the order of elements in a set.

 Content-Aware Steganography hides information in the semantics a


human user assigns to a datagram. These systems offer security
against a non-human adversary/warden.

 Blog-Steganography. Messages are fractionalized and the


(encrypted) pieces are added as comments of orphaned web-logs
(or pin boards on social network platforms). In this case the
selection of blogs is the symmetric key that sender and recipient are
using; the carrier of the hidden message is the whole blogosphere.

 Modifying the echo of a sound file (Echo Steganography)

1.6 TEXT STEGANOGRAPHY

Steganography can be applied to different types of media


including text, audio, image and video etc. However, text
steganography is considered to be the most difficult kind of
steganography due to lack of redundancy in text as compared to image

10
or audio but still has smaller memory occupation and simpler
communication. The method that could be used for text steganography
is data compression. Data compression encodes information in one
representation into another representation.

The new representation of data is smaller in size. One of the


possible schemes to achieve data compression is Huffman coding.
Huffman coding assigns smaller length codewords to more frequently
occurring source symbols and longer length codewords to less
frequently occurring source symbols.

1.7 STEGANALYSIS

Steganalysis is the art of discovering and rendering useless


covert messages where it is the art and science of detecting messages
hidden using steganography; this is analogous to cryptanalysis applied
to cryptography. The goal of steganalysis is to identify suspected
packages, determine whether or not they have a payload encoded into
them, and, if possible, recover that payload.

Unlike cryptanalysis, where it is obvious that intercepted data


contains a message (though that message is encrypted), steganalysis
generally starts with a pile of suspect data files, but little information
about which of the files, if any, contain a payload. The steganalyst is
usually something of a forensic statistician, and must start by reducing
this set of data files (which is often quite large; in many cases, it may
11
be the entire set of files on a computer) to the subset most likely to
have been altered. The problem is generally handled with statistical
analysis. A set of unmodified files of the same type, and ideally from
the same source (for example, the same model of digital camera, or if
possible, the same digital camera; digital audio from a CD MP3 files
have been "ripped" from; etc.) as the set being inspected, are analyzed
for various statistics. Some of these are as simple as spectrum analysis,
but since most image and audio files these days are compressed with
lossy compression algorithms, such as JPEG and MP3, they also
attempt to look for inconsistencies in the way this data has been
compressed. For example, a common artifact in JPEG compression is
"edge ringing", where high-frequency components (such as the high-
contrast edges of black text on a white background) distort neighboring
pixels. This distortion is predictable, and simple steganographic
encoding algorithms will produce artifacts that are detectably unlikely.

One case where detection of suspect files is straightforward is


when the original, unmodified carrier is available for comparison.
Comparing the package against the original file will yield the
differences caused by encoding the payload—and, thus, the payload
can be extracted.

Obtaining a warrant or taking other action based solely on


steganalytic evidence is a very dicey proposition unless a payload has
been completely recovered and decrypted, because otherwise all the
analyst has is a statistic indicating that a file may have been modified,
12
and that modification may have been the result of steganographic
encoding. Because this is likely to frequently be the case, steganalytic
suspicions will often have to be backed up with other investigative
techniques.

The challenge of steganalysis is that:

 The suspect information stream, such as a signal or a file, may or


may not have hidden data encoded into them.
 The hidden data, if any, may have been encrypted before inserted
into the signal or file.

 Some of the suspect signal or file may have noise or irrelevant data
encoded into them (which can make analysis very time consuming).

 Unless it is possible to fully recover, decrypt and inspect the hidden


data, often one has only a suspect information stream and cannot be
sure that it is being used for transporting secret information.

In recent years, steganography and steganalysis has emerged as an


increasingly active research area. Information can be hidden into
images, videos, and audios imperceptibly to human beings. It provides
vast opportunities for covert communications. Consequently, methods
to detect covert communications are called for. This task is especially
urgent for law enforcement to deter the distribution of children
13
pornography images/videos hidden inside normal images/videos, and
for intelligence agencies to intercept communications of enemies.
Steganalysis is the art and science to detect whether a given medium
has hidden message in it. On the other hand, steganalysis can serve as
an effective way to judge the security performance of steganographic
techniques.

In other words, a good steganographic method should be


imperceptible not only to human vision systems, but also to computer
analysis. Unlike cryptanalysis, where it is evident that intercepted
encrypted data contains a message, steganalysis generally starts with
several suspect information streams but uncertainty whether any of
these contain hidden message. The steganalyst starts by reducing the set
of suspect information streams to a subset of most likely altered
information streams. This is usually done with statistical analysis using
advanced statistics techniques.

Some techniques which are used in digital image processing include:

 Pixelization
 Linear filtering

 Principal components analysis

 Independent component analysis

 Hidden Markov models

14
 Anisotropic diffusion

 Partial differential equations

 Self-organizing maps

 Neural networks

 Wavelets

CHAPTER 2
TOOLS

2.1 JSTEG
JSteg Shell is a Win95/98/NT interface to run JSteg DOS, a
program by Derek Upham which hides data in the ever popular JPG
image format. Version 1.0 has a number of new improvements,
including 40 bit RC4 encryption, determination of the amount of data a
JPG can hide beforehand, and user-selectable JPG options (ie. degree
of compression). JSteg Shell has a slick, easy to use interface that
makes using JSteg DOS a snap. Don't worry about downloading the
DOS executables as Jsteg Shell comes with them, and the installer
takes care of all of the setup details. The distribution comes with the

15
necessary VB v4 runtimes, so the file is quite large (3.9 MB). There are
many steps for the encoding.

2.1.1 CONVERSION FROM RGB TO YCBCR

JPEG files use a different color space than bitmaps. The three
color coefficients (Red, Green, Blue or RGB) for each pixel are
transformed into a new coding scheme: one luminance coefficient (the
intensity - defined a black and white image), and two chrominance
coefficients (the actual color in a 2D grid defined by a Blue/Yellow and
a Red/Green axis). At this point you have the YCbCr values.

2.1.2 SUB SAMPLING OF THE CHROMINANCE VALUES

Because the human eye is much more sensitive to luminosity


than it is to colors, we can already remove a lot of color information
without really changing the perception we have of the image. Most of
the time, 4 adjacent pixels are averaged to one value. So already at this
step, we removed ((1/3*3/4)*2) of the image information, which is half.
Not bad. At this point you have the sub sampled YCbCr values.

2.1.3 DISCRETE COSINE TRANSFORM

The remaining values are transformed, 8x8 blocks at a time, by a


forward Discrete Cosine Transform, which is going to transform your
values into frequencies. It sounds complex but it's not. It's just a matter
16
of describing your numbers no more by their values, but by coefficients
of a mathematical expression. Think about how easier it is to describe a
line by the two coefficients a and b in the mathematical formula "y=ax+
b" than by keeping the coordinates of hundreds of points that belong to
that line. The formula here is more complex than a simple linear one,
and, as its name implies, it involves a decomposition of your signal into
several cosines functions of different frequencies. A little bit like
Fourier transform

2.1.4 QUANTIZATION

The main lossy step: the remaining coefficients are "quantized",


which means that they are divided one by one with a table of fixed
values, and rounded. The higher the values on this table, the more
details you will eliminate. For actual elimination of the high frequency
coefficients: think about removing the small wavelets on top of a big
wave. The irregular spikes on a noisy experimental curve. Think about
"smoothing". These tables are stored in the image header, and are
actually what you define when you ask your image program to save a
"X% quality JPG". At this point you have the quantized DCT
coefficients. Most of them are equal to zero. It's where JSteg hides the
data (and all other JPG steganography programs I've checked), by
overwriting their LSB. After JPG quantization, you will be left only
with the low frequency component ie. to keep the most significant
information (low frequency), and eliminate the less important details
(high frequency).

17
2.1.5 ZIG-ZAG ORDERING

Now you will be left, in each 8x8 block, with a few coefficients
still alive, and a whole bunch of zeroes. The first step here is to re-order
all the coefficients in what is called the "zig-zag" order. It's basically
done to put a maximum of zeroes close to each others, because it will
compress better on the next step. It's called "zig-zag" because it goes
this way through a 8x8 block.

Figure 2.1.1 Zig-Zag order

2.1.6 LOSSLESS COMPRESSION

The last compression steps are lossless. We have lost enough


information already. I'm not going to enter into details, but two
different algorithms are used. A simple RLE (Run-Length Encoding,
because there is a bunch of zeroes here) is used to compress the high
frequency coefficients, and a DPCM (Differential Pulse Code
Modulation, because it's generally close to the precedent one) is used to
compress the first low frequency coefficient. Then a classic Huffman
algorithm is used to compress everything. The Huffman trees are stored

18
in the JPG header. And now you have the final JPG raw binary data, or
what you see in a JPG file.

2.1.7 EXTRACTION

To extract the data from the quantized DCT coefficients,


although JSteg deals with the complex JPG format, it embeds the
hidden information in a very simple way. The hidden information is not
even encrypted, and that's why we chose this steganography program as
an introduction to JPG steganography. Basically, the DCT coefficients
which are equal to zero or one are not modified. The other ones are
used to embed sequentially one bit of the hidden information, by
overwriting their Least Significant Bit (LSB). The hidden information
has this format (copy-pasted from the readme, a bit simplified)

2.2 STOOLS-4.0
Designed by Andrew Brown, S-Tools, short for Steganography
Tools, is a program that allows users to hide information within
different types of files including, Windows sound files, otherwise
known as .WAV files [28]. With a user-friendly interface, messages can
be hidden and retrieved from .WAV files with a click of a mouse. By
using least significant bit insertion, S-Tools is able to hide information
within audio samples without changing the size of the sound file. This
technique is also chosen because the information hidden inside the

19
.WAV files will not sound any different to the human ear than the
original.

One feature that S-Tools contain is the use of a random number


generator that is based on the output of the MD5 message digest
algorithm . S-Tools use this number generator to pick the order of the
bytes used in the embedding process. This is done to defeat attackers
who might be applying statistical randomness tests on the lower bits of
the sample to determine whether there is information hidden there.
With this feature, S-Tools ensure a little bit more security to its product.

S-Tools are a steganography tool that hides files in BMP, GIF,


and WAV files. You open up a copy of S-Tools and drag pictures and
sounds across to it. To hide files you just drag them over open
sound/picture windows. You can hide multiple files in one
sound/picture and your data is compressed before being encrypted then
hidden. Multi-threaded operation means that you can have many
hide/reveal operations going simultaneously without fear of them
interferring with you or holding up your work. You can even close the
original picture/sound with no ill effects to ongoing threads. Encryption
services come courtesy of "cryptlib" by Peter Gutmann (and others).

The Graphics Interchange Format (GIF) is a bitmap image


format that was introduced by CompuServe in 1987 and has since come
into widespread usage on the World Wide Web due to its wide support
and portability. The format supports up to 8 bits per pixel thus allowing
20
a single image to reference a palette of up to 256 distinct colors. The
colors are chosen from the 24-bit RGB color space. It also supports
animations and allows a separate palette of 256 colors for each frame.
The color limitation makes the GIF format unsuitable for reproducing
color photographs and other images with continuous color, but it is
well-suited for simpler images such as graphics or logos with solid
areas of color.

GIF images are compressed using the Lempel-Ziv-Welch (LZW)


lossless data compression technique to reduce the file size without
degrading the visual quality. This compression technique was patented
in 1985. Controversy over the licensing agreement between the patent
holder, Unisys, and CompuServe in 1994 spurred the development of
the Portable Network Graphics (PNG) standard.

The art of science of hiding information by embedding messages


within other, seemingly harmless messages. steganography works by
replacing bits of useless or unused data in regular computer files(such
as graphics, sounds, text, HTML, or even floppy disks ) with bits of
different , invisible information. This hidden information can be plain
text, cipher text, or even images. Despite the fact steganography tools
alter only the least-significant image component; they leave detectable
traces in the stego image, allowing for the possible detection of hidden
information. Steganalysis breakdown into two major types of
techniques; visual analysis and statistical analysis. Visual analysis tries
to reveal the presence of secret communication through inspection.
This is accomplished by the naked eye or assistance of a computer of
21
the suspect file. The comparison of original files with the suspect file if
possible would give some merit to suspicions.

2.3 MP3 STEGO


MPEG-1 or MPEG-2 Audio Layer 3 (or III), more commonly
referred to as MP3, is a patented digital audio encoding format using a
form of lossy data compression. It is a common audio format for
consumer audio storage, as well as a de facto standard of digital audio
compression for the transfer and playback of music on digital audio
players.

MP3 is an audio-specific format that was designed by the


Moving Picture Experts Group as part of its MPEG-1 standard and later
extended in MPEG-2 standard. The first MPEG subgroup - Audio
group was formed by several teams of engineers at Fraunhofer IIS,
University of Hannover, AT&T-Bell Labs, Thomson-Brandt, CCETT,
and others. MPEG-1 Audio (MPEG-1 Part 3), which included MPEG-1
Audio Layer I, II and III was approved as a committee draft of ISO/IEC
standard in 1991, finalized in 1992 and published in 1993 (ISO/IEC
11172-3:1993). Backwards compatible MPEG-2 Audio (MPEG-2 Part
3) with additional bit rates and sample rates was published in 1995
(ISO/IEC 13818-3:1995).

The use in MP3 of a lossy compression algorithm is designed to


greatly reduce the amount of data required to represent the audio
22
recording and still sound like a faithful reproduction of the original
uncompressed audio for most listeners. An MP3 file that is created
using the setting of 128 Kbit/s will result in a file that is about 11 times
smaller than the CD file created from the original audio source. An
MP3 file can also be constructed at higher or lower bit rates, with
higher or lower resulting quality. The compression works by reducing
accuracy of certain parts of sound that are considered to be beyond the
auditory resolution ability of most people. This method is commonly
referred to as perceptual coding. It uses psychoacoustic models to
discard or reduce precision of components less audible to human
hearing, and then records the remaining information in an efficient
manner.

The immediate predecessors of MP3 were "Optimum Coding in


the Frequency Domain" (OCF), and Perceptual Transform Coding
(PXFM). These two codecs, along with block-switching contributions
from Thomson-Brandt, were merged into a codec called ASPEC, which
was submitted to MPEG, and which won the quality competition, but
that was mistakenly rejected as too complex to implement. The first
practical implementation of an audio perceptual coder (OCF) in
hardware (Krasner's hardware was too cumbersome and slow for
practical use), was an implementation of a psychoacoustic transform
coder based on Motorola 56000 DSP chips.

MP3 is directly descended from OCF and PXFM. MP3


represents the outcome of the collaboration of Karlheinz Brandenburg,
23
working as a postdoc at AT&T-Bell Labs with James D. (JJ) Johnston
of AT&T-Bell Labs, collaborating with the Fraunhofer Society for
Integrated Circuits, Erlangen, with relatively minor contributions from
the MP2 branch of psychoacoustic sub-band coders.

2.3.1 ENCODING AUDIO

The MPEG-1 standard does not include a precise specification


for an MP3 encoder, but does provide example psychoacoustic models,
rate loop, and the like in the non-normative part of the original
standard. At present, these suggested implementations are quite dated.
Implementers of the standard were supposed to devise their own
algorithms suitable for removing parts of the information from the
audio input. As a result, there are many different MP3 encoders
available, each producing files of differing quality. Comparisons are
widely available, so it is easy for a prospective user of an encoder to
research the best choice. It must be kept in mind that an encoder that is
proficient at encoding at higher bit rates (such as LAME) is not
necessarily as good at lower bit rates.

During encoding, 576 time-domain samples are taken and are


transformed to 576 frequency-domain samples. If there is a transient,
192 samples are taken instead of 576. This is done to limit the temporal
spread of quantization noise accompanying the transient.

2.3.2 DECODING AUDIO

24
Decoding, on the other hand, is carefully defined in the standard.
Most decoders are "bit stream compliant", which means that the
decompressed output will be the same, within a specified degree of
rounding tolerance, as the output specified mathematically in the
ISO/IEC high standard document (ISO/IEC 11172-3). Therefore,
comparison of decoders is usually based on how computationally
efficient they are (i.e., how much memory or CPU time they use in the
decoding process).

2.3.3 AUDIO QUALITY

When performing lossy audio encoding, such as creating an


MP3 file, there is a trade-off between the amount of space used and the
sound quality of the result. Typically, the creator is allowed to set a bit
rate, which specifies how many kilobits the file may use per second of
audio. The higher the bit rate, the larger the compressed file will be,
and, generally, the closer it will sound to the original file.

With too low a bit rate, compression artifacts (i.e. sounds that
were not present in the original recording) may be audible in the
reproduction. Some audio is hard to compress because of its
randomness and sharp attacks. When this type of audio is compressed,
artifacts such as ringing or pre-echo are usually heard. A sample of
applause compressed with a relatively low bit rate provides a good
example of compression artifacts.

25
Besides the bit rate of an encoded piece of audio, the quality of
MP3 files also depends on the quality of the encoder itself, and the
difficulty of the signal being encoded. As the MP3 standard allows
quite a bit of freedom with encoding algorithms, different encoders
may feature quite different quality, even with identical bit rates.

2.4 OUTGUESS
OutGuess is a universal steganographic tool that allows the
insertion of hidden information into the redundant bits of data sources.
The nature of the data source is irrelevant to the core of OutGuess. The
program relies on data specific handlers that will extract redundant bits
and write them back after modification. In this version the PNM and
JPEG image formats are supported. In the next paragraphs, images will
be used as concrete example of data objects, though OutGuess can use
any kind of data, as long as a handler is provided. You can download
OutGuess as UNIX source tar ball. OutGuess is available under a BSD
software license.

For JPEG images, OutGuess preserves statistics based on


frequency counts. As a result, statistical tests based on frequency counts
are unable to detect the presence of steganographic content. Before
embedding data into an image, OutGuess can determine the maximum
message size that can be hidden while still being able to maintain
statistics based on frequency counts. OutGuess uses a generic iterator
object to select which bits in the data should be modified. A seed can be
26
used to modify the behavior of the iterator. It is embedded in the data
along with the rest of the message. By altering the seed, OutGuess tries
to find a sequence of bits that minimizes the number of changes in the
data that have to be made.

This process will allow us to store information of any kind


within an image. This can be useful if you intend to send confidential
information (such as a text document or a spreadsheet) to a person and
do not want such information to be intercepted by someone else (such
as the mail provider, a spy, police, etc. ...) we will use the technique of
steganography to hide information within the image.

2.4.1 OUTGUESS INSTALLATION

Ubuntu user can install OutGuess using Synaptic package


manager or can install using command: sudo apt - get install outguess.

2.4.2 DATA EMBEDDING USING OUTGUESS


Now here is how you do it: you need a text file (in this example
we call it "hidden.txt" ) and a picture ( we call it "input.jpg" ) after that
you issue the following command to hide your data ("hidden.txt") into
the image file.

Multimedia » General Graphics » Image classes

27
This class supports reading the PNM image format into
System.Drawing.Image and writing it back to PNM format. It makes it
possible to inter convert different image file formats including PNM.
PNM is a portable bitmap format used in legacy software. The use of
PNM file format is more common in LINUX / UNIX Platform. PNM
file format consists of three different file formats namely PBM, PGM
and PPM.

PBM [Portable Bit Map - Binary]

PGM [Portable Grey Map - GreyScale]

PPM [Portable Pixel Map - Color]

Each of these files formats, except PBM can be written in ASCII


or Binary Encoding. The encoding is determined at reading time
against the Identifier each PNM file contains called "Magic Number".
This is always the first token of the PNM file.

"P1" [PBM - ASCII Encoding]

"P2" [PGM - ASCII Encoding]

"P3" [PPM - ASCII Encoding]

"P4" [PBM - Binary Encoding] (not yet implemented)

"P5" [PGM - Binary Encoding]

"P6" [PPM - Binary Encoding]


28
The next two tokens in the PNM header define width and height
of the image. The fourth token is the maximum value of the pixel
which is present only in the case of PGM and PPM. PBM does not
contain this token. Moreover, the header can contain comments
beginning with '#' character.

The original definitions of PGM and PNM do not describe 16-bit


pixel formats. It has, however been used in many practical situations
where accuracy/depth of color information matters. This library does
not currently support the 16-bit extensions, perhaps an avenue for you
to contribute.

Using the Code the parameter less constructor of System


Drawing. Image is marked internal and System Drawing. Bitmap is
marked as a sealed class; therefore I could not inherit them into my
class and hence could not follow true object oriented design. The code
is primarily a class library; a class named PNM contains two
overloaded functions to provide its functionality. Since the functions
are static, you do not have to create an object of the said class.

29
CHAPTER 3
PROPOSED METHOD

3.1 DISCRETE COSINE TRANSFORM

A discrete cosine transform (DCT) expresses a sequence of


finitely many data points in terms of a sum of cosine functions
oscillating at different frequencies. DCTs are important to numerous
applications in science and engineering, from lossy compression of
audio and images (where small high-frequency components can be
discarded), to spectral methods for the numerical solution of partial
differential equations. The use of cosine rather than sine functions is
critical in these applications: for compression, it turns out that cosine
functions are much more efficient, whereas for differential equations
the cosines express a particular choice of boundary conditions.

In particular, a DCT is a Fourier-related transform similar to the


discrete Fourier transform (DFT), but using only real numbers. DCTs
are equivalent to DFTs of roughly twice the length, operating on real
data with even symmetry (since the Fourier transform of a real and
even function is real and even), where in some variants the input and/or

30
output data are shifted by half a sample. There are eight standard DCT
variants, of which four are common.

The most common variant of discrete cosine transform is the


type-II DCT, which is often called simply "the DCT"; its inverse, the
type-III DCT, is correspondingly often called simply "the inverse DCT"
or "the IDCT". Two related transforms are the discrete sine transform
(DST), which is equivalent to a DFT of real and odd functions, and the
modified discrete cosine transform (MDCT), which is based on a DCT
of overlapping data.

Formally, the discrete cosine transform is a linear, invertible


function F : RN -> RN (where R denotes the set of real numbers), or
equivalently an invertible N × N square matrix. There are several
variants of the DCT with slightly modified definitions. The N real
numbers x0, ..., xN-1 are transformed into the N real numbers X0, ..., XN-1
according to one of the formulas:

DCT-I

Eq 3.1

Some authors further multiply the x0 and xN-1 terms by √2, and
correspondingly multiply the X0 and XN-1 terms by 1/√2. This makes the
DCT-I matrix orthogonal, if one further multiplies by an overall scale
31
factor of , but breaks the direct correspondence with a
real-even DFT.

The DCT-I is exactly equivalent (up to an overall scale factor of


2), to a DFT of 2N − 2 real numbers with even symmetry. However,
that the DCT-I is not defined for N less than 2. (All other DCT types
are defined for any positive N.) Thus, the DCT-I corresponds to the
boundary conditions: xn is even around n=0 and even around n=N-1;
similarly for Xk.

DCT-II

Eq
3.2

The DCT-II is probably the most commonly used form, and is


often simply referred to as "the DCT". This transform is exactly
equivalent (up to an overall scale factor of 2) to a DFT of 4N real
inputs of even symmetry where the even-indexed elements are zero.
That is, it is half of the DFT of the 4N inputs yn, where y2n = 0, y2n + 1 =
xn for , and y4N − n = yn for 0 < n < 2N.

Some authors further multiply the X0 term by 1/√2 and multiply

the resulting matrix by an overall scale factor of . This makes


the DCT-II matrix orthogonal, but breaks the direct correspondence
32
with a real-even DFT of half-shifted input.The DCT-II implies the
boundary conditions: xn is even around n=-1/2 and even around n=N-
1/2; Xk is even around k=0 and odd around k=N.

DCT-III

Eq
3.3

Because it is the inverse of DCT-II this form is sometimes simply


referred to as "the inverse DCT" ("IDCT").Some authors further
multiply the x0 term by √2 and multiply the resulting matrix by an

overall scale factor of , so that the DCT-II and DCT-III are


transposes of one another. This makes the DCT-III matrix orthogonal,
but breaks the direct correspondence with a real-even DFT of half-
shifted output. The DCT-III implies the boundary conditions: xn is even
around n=0 and odd around n=N; Xk is even around k=-1/2 and even
around k=N-1/2.

DCT-IV

Eq
3.4

The DCT-IV matrix becomes orthogonal (and thus, being clearly


symmetric, its own inverse) if one further multiplies by an overall scale
33
factor of .A variant of the DCT-IV, where data from different
transforms are overlapped, is called the modified discrete cosine
transform (MDCT). The DCT-IV implies the boundary conditions: xn is
even around n=-1/2 and odd around n=N-1/2; similarly for Xk.

3.1.1 INVERSE TRANSFORMS

Using the normalization conventions above, the inverse of DCT-I


is DCT-I multiplied by 2/(N-1). The inverse of DCT-IV is DCT-IV
multiplied by 2/N. The inverse of DCT-II is DCT-III multiplied by 2/N
and vice versa.

Like for the DFT, the normalization factor in front of these


transform definitions is merely a convention and differs between
treatments. For example, some authors multiply the transforms by

so that the inverse does not require any additional multiplicative


factor. Combined with appropriate factors of √2 , this can be used to
make the transform matrix orthogonal.

3.1.2 APPLICATIONS

The DCT, and in particular the DCT-II, is often used in signal


and image processing, especially for lossy data compression, because it
has a strong "energy compaction" property: most of the signal
information tends to be concentrated in a few low-frequency
components of the DCT, approaching the Karhunen-Loève transform
34
(which is optimal in the decorrelation sense) for signals based on
certain limits of Markov processes.

A related transform, the modified discrete cosine transform, or


MDCT (based on the DCT-IV), is used in AAC, Vorbis, WMA, and
MP3 audio compression. DCTs are also widely employed in solving
partial differential equations by spectral methods, where the different
variants of the DCT correspond to slightly different even/odd boundary
conditions at the two ends of the array.

3.2 DISCRETE WAVELET TRANSFORM

In numerical analysis and functional analysis, a discrete wavelet


transform (DWT) is any wavelet transform for which the wavelets are
discretely sampled. As with other wavelet transforms, a key advantage
it has over Fourier transforms is temporal resolution: it captures both
frequency and location information (location in time).

3.2.1 HAAR WAVELETS

The first DWT was invented by the Hungarian mathematician


Alfréd Haar. For an input represented by a list of 2n numbers, the Haar
wavelet transform may be considered to simply pair up input values,
storing the difference and passing the sum. This process is repeated
recursively, pairing up the sums to provide the next scale: finally
resulting in 2n − 1 differences and one final sum.
35
3.2.2 DAUBECHIES WAVELETS

The most commonly used set of discrete wavelet transforms was


formulated by the Belgian mathematician Ingrid Daubechies in 1988.
This formulation is based on the use of recurrence relations to generate
progressively finer discrete samplings of an implicit mother wavelet
function; each resolution is twice that of the previous scale. In her
seminal paper, Daubechies derives a family of wavelets, the first of
which is the Haar wavelet. Interest in this field has exploded since then,
and many variations of Daubechies' original wavelets were developed.

3.2.3 OTHERS

Other forms of discrete wavelet transform include the non- or


undecimated wavelet transform (where down sampling is omitted), the
Newland transform (where an orthonormal basis of wavelets is formed
from appropriately constructed top-hat filters in frequency space).
Wavelet packet transforms are also related to the discrete wavelet
transform. Complex wavelet transform is another form.

3.2.4 PROPERTIES

The Haar DWT illustrates the desirable properties of wavelets in


general. First, it can be performed in O(n) operations; second, it
captures not only a notion of the frequency content of the input, by
36
examining it at different scales, but also temporal content, i.e. the times
at which these frequencies occur. Combined, these two properties make
the Fast wavelet transform (FWT) an alternative to the conventional
Fast Fourier Transform (FFT).

3.2.5 APPLICATIONS

The discrete wavelet transform has a huge number of


applications in science, engineering, mathematics and computer
science. Most notably, it is used for signal coding, to represent a
discrete signal in a more redundant form, often as a preconditioning for
data compression.

3.3 COMBINED 3-LEVEL DCT-DWT ALGORITHM


The development of effective digital image copyright protection
methods have recently become an urgent and necessary requirement in
the multimedia industry due to the ever-increasing unauthorized
manipulation and reproduction of original digital objects. The new
technology of steganography has been advocated by many specialists
as the best method to such multimedia copyright protection problem.
Its expected that steganography will have a wide-span of practical
applications such as digital cameras, medical imaging, image
databases, and video-on-demand systems, among many others. In order
for a steganography method to be effective it should be imperceptible,
and robust to common image manipulations like compression, filtering,

37
rotation, scaling cropping, collusion attacks among many other digital
signal processing operations.

Current steganography techniques can be grouped into two major


classes: spatial-domain and frequency-domain steganographic
techniques. Compared to spatial domain techniques, frequency-domain
techniques proved to be more effective with respect to achieving the
imperceptibility and robustness requirements of steganography
algorithms.

Commonly used frequency-domain transforms include the


Discrete Wavelet Transform (DWT), the Discrete Cosine Transform
(DCT) and Discrete Fourier Transform (DFT). However, DWT has
been used in steganography more frequently due to its excellent spatial
localization and multi-resolution characteristics, which are similar to
the theoretical models of the human visual system. Further performance
improvements in DWT-based steganography algorithms could be
obtained by combining DWT with DCT. The idea of applying two
transform is based on the fact that combined transforms could
compensate for the drawbacks of each other, resulting in effective
steganography.

38
39
3.3.1 EMBEDDING ALGORITHM
40
The main strength offered by transform domain techniques is that
they can take advantage of special properties of alternate domains to
address the limitations of spatial domain or to support additional
features. Steganography process is started by applying 3-leveles DWT
on the host image. The agreement adopted by many DWT-based
steganography methods is to embed the steganography in the middle
frequency sub-bands HLx and LHx is better in perspective of
imperceptibility and robustness.

Consequently, HLx coefficient sets in level three is chosen to


make to increase the robustness of our steganography against common
steganography attack, specially adding noise and blurring attacks, at
little to no additional impact on image quality. Then, the block base
DCT is performed on these selected DWT coefficient sets and embed
pseudorandom sequences in middle frequencies. The steganography
embedding procedure is described in the following steps.

Step 1: Perform DWT on the host image to decompose it into four non-
overlapping multi-resolution coefficient sets: LL1, HL1, LH1
and HH1.

Step 2: Perform DWT again on two HL1 and LH1coefficient sets to get
eight smaller coefficient sets and choose four coefficient sets:
HL12, LH12, HL22 andLH22.

Step 3: Perform DWT again on four coefficient sets: HL12, LH12,


HL22 and LH22 to get sixteen smaller Coefficient sets and
choose four coefficient sets: HL13, LH13, HL23 and LH23.

41
Step 4: Divide four coefficient sets: HL13, LH13, HL23 and LH23 into
4 x 4 blocks.

Step 5: Perform DCT to each block in the chosen coefficient sets


(HL13, LH13, HL23 and LH23). These coefficients sets are
chosen to inquire both of imperceptibility and robustness of
algorithms equally.

Step 6: scramble the steganographic signal with Arnold algorithm for


key times and gain the scrambled steganography Ss (i , j), key
times can be see as secret key.

Step 7: Re-formulate the scramble steganographic image into a vector


of zeros and ones.

Step 8: Generate two uncorrelated pseudorandom sequences by a key.


One sequence is used to embed the steganography bit 0 (PN_0)
and the other sequence is used to embed the steganography bit 1
(PN_1). Number of elements in each of the two pseudorandom
sequences must be equal to the number of mid-band elements of
the DCT-transformed, DWT coefficient sets.

Step 9: Embed the two pseudorandom sequences, PN_0 and P N_1,


with a gain factor α in the DCT transformed 4x4 blocks of the
selected, DWT coefficient sets of the host image. Instead of
embedding in all coefficients of the DCT block, it applied only to
the mid-band DCT coefficients. If we donate X as the matrix of
the mid-band coefficients of the DCT transformed block, then
embedding is done .

42
Step 10: Perform inverse DCT (IDCT) on each block after its mid-band
coefficients have been modified to embed the steganographic bits
as described in the previous step.

Step 11: Perform the inverse DWT (IDWT) on the DWT transformed
image, including the modified coefficient sets, to produce the
steganographic host image.

43
44
3.3.2 EXTRACTING ALGORITHM

The joint DWT-DCT algorithm is a blind steganography


algorithm, and thus the original host image is not required to extract the
message. Execration algorithm is the same as embedding one, and pre-
filtering is used before applying DWT transform to better separate
steganographic information from host image. The steganography
extraction procedure is described in details in the following steps.

Step 1: perform combination of two filters as prefiltering operation.


First filter is 3×3 spatial sharpening filter. This filter enhances
contrast of steganographic image. And, second filter is Laplacian
of Gaussian filter (LoG).

Applying these two filters on steganographic image (that maybe


attacked) could caused details of image become more manifest,
its means that steganographic information which is different
from image background become recognizable straightforwardly.
Combination of these two filters is helped to concentrate on
finding information of steganography by degrading effect of
none stegnoid part of steganographic image and increasing
steganographic part of it.

Step 2: Perform DWT on the pre-filtered steganographic image to


decompose it into four non overlapping multi-resolution
coefficient sets: LL1, HL1 LH1 and HH1.

45
Step 3: Perform DWT again on two coefficient sets HL1 and LH1 to
get eight smaller coefficient sets and choose four coefficient sets:
HL12, LH12, HL22 and LH22.

Step 4: Perform DWT again on four coefficient sets: HL12, LH12,


HL22 and LH22 to get sixteen smaller coefficient sets and
choose four coefficient sets: HL13,LH13, HL23 and LH23.

Step 5: Divide four coefficient sets: HL13, LH13, HL23 and LH23 into
4 x 4 blocks.

Step 6: Perform DCT on each block in the chosen coefficient sets


(HL13, LH13, HL23 and LH23).

Step 7: Regenerate the two pseudorandom sequences (PN_0 and PN_1)


using the same key which used in the embedding procedure.

Step 8: For each block in the coefficient sets: HL13, LH13, HL23 and
LH23 calculate the correlation between the mid-band coefficients
and the two generated pseudorandom sequences (PN_0 and
PN_1). If the correlation with the PN_0 was higher than the
correlation with PN_1, then the extracted steganography bit is
considered 0, otherwise the extracted steganography bit is
considered 1.

Step 9: The scrambled steganography is reconstructed using the


extracted steganography bits.

Step 10: scramble the extracted steganography with Arnold algorithm


with the same key times and gain the scrambled steganography

46
Ss (i, j), and compute the similarity between the original and
extracted image.

Experimental results demonstrate that the performance of


combined form of 3-level DCT and DWT is better as compared to that
achieved using DWT alone.

47
CHAPTER 4
MATLAB

MATLAB stands for Matrix Laboratory. According to The


Mathworks, it is a "technical computing environment". It is a high
level language and interactive environment that enables to perform
computationally intensive tasks faster than with traditional
programming languages. MATLAB allows matrix manipulations,
plotting of functions and data, implementation of algorithms, creation
of user interfaces, and interfacing with programs written in other
languages, including C, C++ and Fortran. It provides a number of
features for documenting and sharing your work. You can integrate
your MATLAB code with other languages and applications, and
distribute your MATLAB algorithms and applications.

4.1 KEY FEATURES


 High-level language for technical computing
 Development environment for managing code, files, and data
 Interactive tools for iterative exploration, design and problem
solving.
 Mathematical functions for linear algebra, statistics, Fourier
analysis, filtering, optimization, and numerical integration.
 2-D and 3-D graphics functions for visualizing data.
 Tools for building custom graphical user interfaces.

48
 Functions for integrating MATLAB based algorithms with external
applications and languages.

The MATLAB application is built around the MATLAB language.


The simplest way to execute MATLAB code is to type it in the
Command Window, which is one of the elements of the MATLAB
Desktop.

When code is entered in the Command Window, MATLAB can be


used as an interactive mathematical shell. Sequences of commands can
be saved in a text file, typically using the MATLAB Editor, as
a script or encapsulated into a function, extending the commands
available. MATLAB is one of a few languages in which each variable is
a matrix (broadly construed). Moreover, the fundamental operators (e.g.
addition, multiplication) are programmed to deal with matrices when
required. Since so many of the procedures required for Macro-
Investment Analysis involve matrices, MATLAB proves to be an
extremely efficient language for both communication and
implementation.

Matlab is a script that runs the main MATLAB executable on


Microsoft Windows platforms. (In this document, the term matlab
refers to the script, and MATLAB refers to the main executable).

49
Before actually initiating the execution of MATLAB, it configures the
run-time environment by

 Determining the MATLAB root directory


 Determining the host machine architecture

 Selectively processing command line options with the rest passed to


MATLAB.

 Setting certain MATLAB environment variables

There are two ways in which you can control the way matlab works:

 By specifying command line options


 By setting environment variables before calling the program

4.2 SPECIFYING OPTIONS AT THE COMMAND LINE

Matlab help option displays information that matches the


specified help option argument without starting matlab. Help option
can be any one of the keywords shown in the table below. Enter only
one help option keyword in a matlab statement. Matlab automation
starts matlab as an automation server. The server window is minimized,
and the matlab splash screen does not display on startup.

Matlab - c license file starts matlab using the specified license


file. The license file argument can have the form port@host. This
option causes matlab to ignore the lm_license_file and

50
mlm_license_file environment variables. Matlab –logfile filename
starts matlab and makes a copy of any output to the command window
in filename. This includes all crash reports. Matlab –nosplash starts
matlab, but does not display the splash screen during startup. Matlab
-nofigure windows starts matlab, but disables the display of any figure
windows in matlab. Matlab -r "statement" starts matlab and executes
the specified matlab statement. Any required file must be on the matlab
search path or in the startup directory. Matlab –reg server registers
matlab as a component object model (com) server. Matlab -sd "startdir"
specifies the startup directory for matlab (the current directory in
matlab after startup). The -sd option has been deprecated. For
information about alternatives, see startup folder on windows
platforms.

Matlab shield option provides the specified level of protection of


the address space used by matlab during startup on windows 32–bit
platforms. It attempts to help ensure the largest contiguous block of
memory available after startup, which is useful for processing large
data sets. The shieldoption does this by ensuring resources such as dlls,
are loaded into locations that will not fragment the address space. With
shieldoption set to a value other than none, address space is protected
up to or after the processing of matlabrc. Use higher levels of
protection to secure larger initial blocks of contiguous memory,
however a higher level might not always provide a larger size block
and might cause startup problems. Therefore, start with a lower level of
protection, and if successful, try the next higher level.

51
MATLAB variable names are normally case-sensitive. A variable
name can have up to 19 characters, including letters, numbers and
underscores. The command variables begins a variables declaration
block, which is terminated by an end keyword. In a component file, this
block contains declarations for all the variables associated with the
component. In a domain file, this block contains declarations for all the
Across variables associated with the domain . Additionally, domain files
must have a separate variables declaration block, with the Balancing
attribute set to true, which contains declarations for all the Through
variables associated with the domain.

4.2.1 KEY USED:

addpath : Add folders to search path

strcmp : compare string

imread : Read image from graphics file

pathname : Get pathname of block or line

strcat : Concatenate strings horizontally

wavread : Read WAVE (.wav) sound file

uigetfile : Open standard dialog box for retrieving files

msgbox : Create and open message box

cell : Construct cell array

cell2mat : Convert cell array of matrices to single matrix

design : Apply design method to specification object

52
verify : Validate and verify SimBiology model

CHAPTER 5

RESULTS AND DISCUSSION

fig 5.1 Training the data base

53
Fig 5.2 Selection of the required file

54
Fig 5.3 Data embedded using JSteg tool

55
Fig 5.4 Data embedded using Stool

56
Fig 5.5 Data embedded using Outguess tool

57
Fig 5.5 Data embedded using MP3 Stego tool

58
5.1 COMBINED 3-LEVEL DCT & DWT EMBEDDING
AND EXTRACTING

The steganography process has its own respective tools for the
secret data embedding and extraction processes but each of the tool has
its own images of particular format such as JPEG, GIF etc., The
Combined 3-Level DCT-DWT proposed method improves the
investigation process on the image package. It also reduces the
processing time for any type of image formats.

The text is embedded in combined 3-level DCT-DWT directly


using embedding algorithm Fig 5.1.1. Key value which is produced
acts as the security code. Key is given in the extracting algorithm to
extract the embedded text Fig 5.1.2 and Fig 5.1.3.

The combined DWT-DCT algorithm's imperceptibility


performance was better than the performance of the DWT-Only
approach. As we exploit the combined 3-level DWT-DCT algorithm,
high decomposition level is obtained which is a added lead.

59
Fig 5.1.1 Text embedded using combined 3-level DCT & DWT

60
Fig 5.1.2 Text extracted using combined 3-level DCT & DWT

61
Fig 5.1.3 Image after extraction

62
CHAPTER 6

CONCLUSION AND FUTURE SCOPE

Our project An Enhanced Proposal on Investigation of the


Encoded Image Package using Combined 3-Level DCT-DWT
Method, improves the investigation process on the image package. It
also reduces the processing time for any type of image formats such as
JPEG, GIF etc., While comparing with other techniques high data
accuracy rate and high image characteristics is achieved. This action
will be helpful in military or warfare applications because it has greater
advantage towards protection.

The following enhancement can be done in our project.

 To improve the size of data embedded, the decomposition level


can be further increased inorder to make the proposed method to
accept the images for processing of different sizes for different
ranges.

63
REFERENCES

[1] Natarajan Meghanathan1 and Lopamudra Nayak2, “Steganalysis


algorithms for detecting the Hidden information in image, audio and
Video cover media” International Journal of Network Security & Its
Application (IJNSA), Vol.2, No.1, January 2010.
[2] J. Fridrich and M. Goljan,“Practical steganalysis of digital images:
State of the art,” Proc. SPIE, Security andWatermarking of Multimedia
Contents IV, vol. 4675, pp. 1–13, 2002.
[3] J.Fridrich, “Steganalysis,”in Multimedia Security Technologies for
Digital Rights Management. Amsterdam, The Netherlands: Elsevier,
2006, ch. 14, p. 352.
[4] Ali Al-Haj Department of Computer Engineering, School of
Electrical Engineering, Princess Sumaya University for Technology,
PO Box 1928, Al-Jubeiha, 11941 Amman, Jordan , “Combined DWT-
DCT Digital Image Watermarking” Journal of Computer Science 3 (9):
740-746, 2007. ISSN 1549-3636 ,© 2007 Science Publications.
[5] R. Sridevi, A. Damodaram and S.V.L. Narasimham, “Efficient
Method of Audio Steganography by Modified LSB Algorithm and
Strong Encryption Key with Enhanced Security,” Journal of
Theoretical and Applied Information Technology, vol. 5, no. 6, pp. 768
– 771, June 2009.
[6] http://www.tiac .net/users/korejwa/jsteg.html
[7] http://www.rn.inf.turesden.de/ westfeld/f5.html
[8] http://www.cl.cam.ac.uk /~fapp2 /steganography /mp3stego

CODING

64
JSTEG
%Steganography
close all;
clear all;
clc;
warning off all;
while 1
choise = menu('Automatic Identification',...
'Train Database',...
'Recognize',...
'Exit');
if choise==3
close all;
clc;
break;
elseif choise==1
% Train database
TrainFiles = dir('stego');
Train_Number = 0;
for i = 1:size(TrainFiles,1)
if not(strcmp(TrainFiles(i).name,'.')|strcmp(TrainFiles(i).name,'
..')| strcmp(TrainFiles(i).name,'Thumbs.db'))
Train_Number = Train_Number + 1; % Number of all images
in the training database
end
end
bi=[];
for i = 1:Train_Number
stego_img = imread(strcat('stego\',int2str(i),'.jpg '));
bi{i}=gray2bi(stego_img);
avg{i}=mean(mean(bi{i}));
end
msgbox('Database Trained')
e=cell2mat(avg);
elseif choise==2
% Check the image

65
[namefile,pathname]=uigetfile('input\*.*','All Files');
i1=imread(strcat(pathname,namefile));
bi1=gray2bi(i1);
avg1=mean(mean(bi1));
x=find(avg1==e);
if (isempty(x))
msgbox('The Object is not a stego Object')
else
msgbox('The Object is a stego Object by Jsteg 4.0')
end
end
end

SUB PROGRAM

function b = gray2bi( g )
b(:,1) = g(:,1);
for i = 2:size(g,2),
b(:,i) = xor( b(:,i-1), g(:,i) );
end
return;

66
STOOL

%Steganography
close all;
clear all;
clc;
warning off all;
while 1
choise = menu('Automatic Identification',...
'Train Database',...
'Recognize',...
'Exit');
if choise==3
close all;
clc;
break;
elseif choise==1
% Train database
TrainFiles = dir('stego');
Train_Number = 0;
for i = 1:size(TrainFiles,1)
if not(strcmp(TrainFiles(i).name,'.')|strcmp(TrainFiles(i).name,
'..')|strcmp(TrainFiles(i).name,'Thumbs.db'))
Train_Number = Train_Number + 1; % Number of all images
in the training database
end
end
bi=[];
for i = 1:Train_Number
stego_img = imread(strcat('stego\',int2str(i),'.gif '));
bi{i}=gray2bi(stego_img);
avg{i}=mean(mean(bi{i}));
end
67
msgbox('Database Trained')
e=cell2mat(avg);
elseif choise==2
% Check the image

[namefile,pathname]=uigetfile('input\*.*','All Files');
i1=imread(strcat(pathname,namefile));
bi1=gray2bi(i1);
avg1=mean(mean(bi1));
x=find(avg1==e);
if (isempty(x))
msgbox('The Object is not a stego Object')
else
msgbox('The Object is a stego Object by Stool 4.2')
end
end
end

SUB PROGRAM

function b = gray2bi( g )
b(:,1) = g(:,1);
for i = 2:size(g,2),
b(:,i) = xor( b(:,i-1), g(:,i) );
end
return;

68
OUTGUESS
%Steganography
close all;
clear all;
clc;
warning off all;
while 1
choise = menu('Automatic Identification',...
'Train Database',...
'Recognize',...
'Exit');
if choise==3
close all;
clc;
break;
elseif choise==1
% Train database
TrainFiles = dir('stego');
Train_Number = 0;
for i = 1:size(TrainFiles,1)

69
if not(strcmp(TrainFiles(i).name,'.')|strcmp(TrainFiles(i).name,
'..')|strcmp(TrainFiles(i).name,'Thumbs.db'))
Train_Number = Train_Number + 1; % Number of all images
in the training database
end
end
bi=[];
for i = 1:Train_Number stego_img =
imread(strcat('stego \',int2str(i),'.jpg '));
bi{i}=gray2bi(stego_img);
avg{i}=mean(mean(bi{i}));
end
msgbox('Database Trained')
e=cell2mat(avg);
elseif choise==2
% Check the image

[namefile,pathname]=uigetfile('input\*.*','All Files');
i1=imread(strcat(pathname,namefile));
bi1=gray2bi(i1);
avg1=mean(mean(bi1));
x=find(avg1==e);
if (isempty(x))
msgbox('The Object is not a stego Object')
else
msgbox('The Object is a stego Object by Outguess 2.0')
end
end
end

SUB PROGRAM

function b = gray2bi( g )
b(:,1) = g(:,1);
for i = 2:size(g,2),
b(:,i) = xor( b(:,i-1), g(:,i) );
70
end
return;

MP3 STEGO
%Steganography
close all;
clear all;
clc;
warning off all;
addpath('mp3readwrite\')
while 1
choise = menu('Automatic Identification',...
'Train Database',...
'Recognize',...
'Exit');
if choise==3
close all;
clc;
break;
elseif choise==1
% Train database

71
TrainFiles = dir('stego');
Train_Number = 0;
for i = 1:size(TrainFiles,1)
if not(strcmp(TrainFiles(i).name,'.')|
strcmp(TrainFiles(i).name ,'..')|strcmp(TrainFiles(i).name,'Thumbs.db'))
Train_Number = Train_Number + 1; % Number of all images
in the training database
end
end
bi=[];
for i = 1:Train_Number
ss=strcat('stego\',int2str(i),'.mp3');
[Y,FS,NBITS,OPTS] = mp3read(ss);
bi{i}=mean(mean(Y));

avg{i}=mean(mean(bi{i}));
end
msgbox('Database Trained')
e=cell2mat(avg);
elseif choise==2
% Check the image

[namefile,pathname]=uigetfile('input\*.*','All Files');
a=find(namefile=='.')
if(namefile(a+1)=='w')
w=1;
elseif(namefile(a+1)=='m')
w=2;
end
if(w==2)
[Y1,FS,NBITS,OPTS] = mp3read(strcat(pathname,namefile));
bi1=Y1;
end
if(w==1)
[Y1,FS,NBITS,OPTS] = wavread(strcat(pathname,namefile));
bi1=Y1;
end
avg1=mean(mean(bi1));
x=find(avg1==e);
72
if (isempty(x))
msgbox('The Object is not a stego Object')
else
msgbox('The Object is a stego Object by MP3 Stego')
end
end
end

SUB PROGRAM

function b = gray2bi( g )
b(:,1) = g(:,1);
for i = 2:size(g,2),
b(:,i) = xor( b(:,i-1), g(:,i) );
end
return;

73
COMBINED CODING

%Steganography
%jsteg tool
close all;
clear all;
clc;
warning off all;
addpath('mp3readwrite\')
while 1
choise = menu('Automatic Identification',...
'Train Database',...
'Recognize',...
'Exit');
if choise==3
close all;
clc;
break;
elseif choise==1
% Train database

TrainFiles = dir('stego');
Train_Number = 0;
for i = 1:size(TrainFiles,1)
if not(strcmp(TrainFiles(i).name,'.')|
strcmp(TrainFiles(i).name ,'..')|strcmp(TrainFiles(i).name,'Thumbs.db'))
Train_Number = Train_Number + 1; % Number of all images
in the training database
end
end
bi=[];
for i = 1:Train_Number
if(i<8 || (i>13 && i<21) )
stego_img = imread(strcat('stego\',int2str(i),'.jpg '));
74
end
if(i>7 && i<14)
stego_img = imread(strcat('stego\',int2str(i),'.gif '));
end
bi{i}=gray2bi(stego_img);
if(i>20)
ss=strcat('stego\',int2str(i),'.mp3');
[Y,FS,NBITS,OPTS] = mp3read(ss);
bi{i}=mean(mean(Y));
end
avg{i}=mean(mean(bi{i}));
end
msgbox('Database Trained')
e=cell2mat(avg);
elseif choise==2
% Check the image
[namefile,pathname]=uigetfile('input\*.*','All Files');
a=find(namefile=='.')
if(namefile(a+1)=='w')
w=1;
elseif(namefile(a+1)=='m')
w=2;
else
w=0;
end
if(w==0)
i1=imread(strcat(pathname,namefile));
bi1=gray2bi(i1);
end
if(w==2)
[Y1,FS,NBITS,OPTS] = mp3read(strcat(pathname,namefile));
bi1=Y1;
end
if(w==1)
[Y1,FS,NBITS,OPTS] = wavread(strcat(pathname,namefile));
bi1=Y1;
end
avg1=mean(mean(bi1));
x=find(avg1==e)
if(isempty(x))
75
x=0;
end
if (x<8 && x>0)
msgbox('The Object is a stego Object by Jsteg 4.0')
elseif (x > 7 && x <14)
msgbox('The Object is a stego Object by Stool 4.2 ')
elseif (x > 13 && x <21)
msgbox('The Object is a stego Object by Outguess 2.0')
elseif (x > 20)
msgbox('The Object is a stego Object by MP3 Stego')
else
msgbox('The Object is not a stego Object')
end
end
end

SUB PROGRAM

function b = gray2bi( g )
b(:,1) = g(:,1);
for i = 2:size(g,2),
b(:,i) = xor( b(:,i-1), g(:,i) );
end
return;

76
DWT & DCT EMBEDDING
clear all;
clc;
k=(imread('lena.jpg'));
figure;imshow(k)
for t=1:3
[c,s] = wavedec2(k(:,:,t),3,'db1');
o1=reshape(c(1:1024),[32 32]);
o2=reshape(c(1025:2048),[32 32]);
o3=reshape(c(2049:3072),[32 32]);
o4=reshape(c(3073:4096),[32 32]);
o5=reshape(c(4097:8192),[64 64]);
o6=reshape(c(8193:12288),[64 64]);
o7=reshape(c(12289:16384),[64 64]);
o8=reshape(c(16385:32768),[128 128]);
o9=reshape(c(32769:49152),[128 128]);
o10=reshape(c(49153:65536),[128 128]);
t1=[o1 o2;o3 o4];
t2=[t1 o5;o6 o7];
t3(:,:,t)=[t2 o8;o9 o10];
77
end
figure
imshow(t3)
msg=input('Enter the text \n','s');
u=double(msg);
msg1=dec2bin(msg,8);
i1=1;
for i=1:size(msg1,1)
for j=1:size(msg1,2)
mm(1,i1)=msg1(i,j);
i1=i1+1;
end
end
M=size(msg1,1)*size(msg1,2);
for t=1:3
% tt=reshape(t3(:,:,t),[1 (256*256)]);
[c,s] = wavedec2(k(:,:,t),3,'db1');
y=dct(c(1:1024));
c1(:,:,t)=y;
i1=1;
v=find(y>0);
save v v
for i=1
for j=1:M
o=dec2bin(y(i,v(j)),8);
o(8)=mm(i,j) ;
y(i,v(j))=bin2dec(o);
end
end
save y y
y1=idct(y);
c(1:1024)=y1;
re(:,:,t) = waverec2(c,s,'db1');
end
key=M
imwrite(uint8(re),'emb.tif')
figure
imshow(uint8(re))

78
DWT & DCT EXTRACTING
clc;
close all;
clear all;
k=imread('emb.tif');
figure('name','Input image for extraction','numbertitle','off')
imshow(k)
M=input('Enter the key \n');
for t=1
[c,s] = wavedec2(k(:,:,t),3,'db1');
y=dct(c(1:1024));
load v
load y
i1=1;j1=1;
for i=1
for j=1:M
o=dec2bin(y(i,v(j)),8);
mm(i1,j1)=o(8) ;
if(j1==8)
i1=i1+1;
j1=0;
79
end
j1=j1+1;
end
end
end
% Extracted
Ex=bin2dec(mm)
Extracted=char(Ex)'

80

Das könnte Ihnen auch gefallen