0% found this document useful (0 votes)
309 views73 pages

Chapter - 1: 1.1 Introduction To Security Systems

Steganography is an art of sending hidden data or secret messages over a public channel.steganography seeks to hide the very existence of the secret messages. It is implemented in electronic communication including stenographic coding inside a transport layer such as UDP or mp3 file.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
309 views73 pages

Chapter - 1: 1.1 Introduction To Security Systems

Steganography is an art of sending hidden data or secret messages over a public channel.steganography seeks to hide the very existence of the secret messages. It is implemented in electronic communication including stenographic coding inside a transport layer such as UDP or mp3 file.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 73

CHAPTER 1 INTRODUCTION

1.1 INTRODUCTION TO SECURITY SYSTEMS


Steganography is an art of sending hidden data or secret messages over a public channel so that a third party cannot detect the presence of the secret messages.The goal of the steganography is different from classical encryption,which seeks to conceal the content of secret messages:Steganography is about hiding the very existence of the secret messages.Modern steganography is generally understood to deal with electronic media rather than physical objects. There have been numerous proposals for protocols to hide in channels containing pictures,video,audio and even typeset text.This makes sense for a number of reasons.First of all,because the size of the information generally quite small compared to the size size of the data in which it must be hidden(the cover text),electronic media is much easier to manipulate in order to hide data and extract messages.Secondly,extraction itself can be automated when the data is electronic,since computers can efficiently manipulate the data and execute the algorithm necessary to retrieve the messages.Electronic data also often includes redundant,unnecessary and unnoticed data spaces which can be manipulated in order to hide messages.

Fig 1: Classification of steganography

The key word namely steganalysis is new emerging branch of processing data where it seeks the identification of steganographic covers for possible extraction of messages steganalysis is sin ominous to cryptanalysis in cryptography where they differ in making the message unreadable called as cryptography and second steganography makes the messages to unseen (invisible).It is nevertheless using this both techniques as to add more security to our messages or data. This technique steganography is implemented in electronic communication including stenographic coding inside a transport layer such as UDP or MP3 file.

1.2 STEGANOGRAPHY
Steganography is derived from the Greek word called as steganos meaning covered writing which it has a unique property basically steganography is nothing but an art and science of writing hidden data or communicating in such a way that the presence of a message is not detectable only the sender and intended recipient realizes. As the technique of steganography is ancient emerging monster which as gained immovable notice in penetrating a new world of digital communication security.

The key word namely steganalysis is new emerging branch of processing data where it seeks the identification of steganographic covers for possible extraction of messages steganalysis is sin ominous to cryptanalysis in cryptography where they differ in making the message unreadable called as cryptography and second steganography
2

makes the messages to unseen (invisible).It is nevertheless using this both techniques as to add more security to our messages or data. This technique steganography is implemented in electronic communication including stenographic coding inside a transport layer such as UDP or MP3 file.

1.3 ROBUSTNESS OF STEGANOGRAPHY


The information embedded into a file cannot be easily destroyed. A system can be considered robust if the amount of changes required to remove the mark render the file useless. Unlike fingerprints, watermarks identify the copyright owner of the file, not the customer but whereas fingerprints are used to identify people who violate the licence agreement watermarks help with prosecuting those who have an illegal copy. Ideally fingerprinting should be used but for mass production of CDS,DVDS it is not feasible to give each disk a separate fingerprints So watermarks are typically hidden to prevent their detection and removal which they are said to be imperceptible watermarks. Robustness need to survive from lossy compression, digital to- digital conversion,analog recording ( such as VHS or audio tape, printing and scanning, audio playback and re-recording ,noise reduction, format conversion and some expense such as computational cost, data payload,fidelity.Redundant embedding is commonly used in image watermarking to handle cropping, filtering and addition of band limited noise but use inversions at the detector to handle geometric distortions.

1.4 DIFFERENT METHODS FOR STEGANOGRAPHY


There are numerous method used to hide information inside picture, audio and video files but the most common methods are: Injection: It involves directly injecting the secret information into the carrier file where it hides data in sections of a file that are ignored by the processing applications therefore avoid modifying those file bits that are relevant to the end user leaving the cover file perfectly usable. Substitution: Replacements of the LSB information that determine meaningful content of the original file new data in a way that causes least amount of distortion.

Generation: Unlike injection and substitution, this doesnt require an existing cover file for the sole purpose of hiding the images. Masking and filtering technique usually restricted to 24 bits and grey scale image, hide information by marking an image in manner similar to paper watermarks. The technique performs analysis of the image thus embed the information in significant areas so that the hidden message is more integral to the cover image than just hiding it in the noise level. Transform techniques embed the message by modulating co-efficient in a transform domain such as discrete cosine transform used in jpeg compression, discrete Fourier transform or wavelet transform these methods hide messages in significant areas of the cover image which make them more robust to attack. Transformations can be applied over the entire image to block throughout the image or other variants.

1.5 USES OF STEGANOGRAPHY


It is used for a variety of reasons, some good, some not where legitimate purposes can include things like watermarking images for reasons such as copyright protection. Digital watermarks (copyright material) are similar to steganography in that they are overlaid in files which appear to be part of the original file and are not easily detectable by the average person. Steganography can also be used as a way to make substitute for a one way hash value (where you take a variable length input and create a static length output string to verify that no changes have been made to the original variable length input). Steganography can be used to tag notes to online images (like post it notes attached to paper files Steganography can be used to maintain the confidentiality of valuable information to protect the data from possible theft or unauthorised viewing.

1.6 COMPARISION OF STEGANOGRAPHY, WATERMARKING AND ENCRYPTION


4

Criterion/method Carrier

Steganography Any digital media

Watermarking Mostly image/audio files

Encryption Usually based, text with

some extensions to image files Secret data Key Input files Detection Payload Optional At least two unless in self-embedding Blind Usually informative original cover or watermark is needed for recovery) Authentication Objective Result Concern Type of attacks Visibility Fails when Full retrieval of data Secrete communication Stego-file Delectability/ capacity Steganalysis Never It is detected Usually achieved by cross Full retrieval of data Data protection Cipher-text Robustness Cryptanalysis Always De-ciphered correlation Copyright preserving Watermarked-file Robustness Image processing Sometimes It is removed/replaced Watermark Plain text Necessary One (i.e., Blind

Relation to cover Not necessarily related to Usually becomes an attribute of N/A the cover. The message is the cover image. The cover is more important than the more cover Flexibility History cover Very ancient except its Modern era Modern era digital version Table1: Uses of Steganography compared to water marking and Encryption message N/A important than the

Free to choose any suitable Cover choice is restricted

1.7 STEGANOGRAPHIC TECHNIQUES


There are different steganography techniques.They are Physical steganography Network steganography Printed steganography
5

Digital steganography

1.7.1 Physical steganography Steganography has been widely used,including in recent historical times and the present day.possible permutatuions are endless and known examplessuch as Hidden messages with in wax tablets,hidden messages on messengers body,invisible ink,hidden messages on paper written in secrets inks,messages written in morse code on limiting yarn and then knitted into a piece of clothing worn by a courier, messages written on envelopes in the area covered by postages stamps etc.

Fig2:Physical Steganography 1.7.2 Network steganography All information hidin techniques that may be used to exchange steganography in telecommunication networks can be classified under the general term of network steganography.this nomenclature was originally introduced by Krzysztof Szczypiorski in 2003.network steganography utilizes communications protocols control elements and their basic intrinsic functionality . As a result , such methods are harder to detect and eliminate . Typical network steganography methods involve modifications of the properties of a simple network protocol. Such modification can be applied to the PDU(protocol Data Unit),to the time relation between the exchanged PDUs,or both (hybrid methods).

Moreover ,it is feasible to utilize the relation between two or more different network protocols to enable secret communication.these applications fall under the term interprotocol steganography.

Fig3:Network steganography

1.7.3 Printed steganography


Digital steganography output may be in the form of printed documents. A message, the plaintext, may be first encrypted by traditional means, producing a ciphertext. Then, an innocuous covertext is modified in some way so as to contain the ciphertext, resulting in the stegotext. For example, the letter size, spacing, typeface, or other characteristics of a covertext can be manipulated to carry the hidden message. Only a recipient who knows the technique used can recover the message and then decrypt it. Francis Bacon developed Bacon's cipher as such a technique.

Fig4:Printed steganography The ciphertext produced by most digital steganography methods, however, is not printable. Traditional digital methods rely on perturbing noise in the channel file to hide the message, as such, the channel file must be transmitted to the recipient with no additional noise from the transmission. Printing introduces much noise in the ciphertext, generally rendering the message unrecoverable. There are techniques that address this limitation, one notable example is ASCII Art Steganography. 1.7.4 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 are classified into four types Steganography In Text/Documents Steganography In Images Steganography In Audio Steganography in videoa

Steganography in Text/Documents Text steganography uses text as the medium in which to hide information. Text

steganography can involve anything from changing the formatting of an existing text,to changing words with in a text , to generating random character sequences or using context-free grammars to generate readable texts. Well examine three basic categories of text steganography here they are format-based methods,random and statistical generation ,and linguistic methods. Note that within each category , the text can either be generated from scratch or embedded within known plaintext. Format-based methods:
8

Format-based methods use the physical formatting of text as a space in which to text as a space in which to hide information .Format-based methods generally modify existing text in order to hide the steganographic text . Insertion of spaces or non-display a characters,deliberate misspellings distributed throughout the text ,and resizing of fonts are some of the many format-based methods used in text steganography . Some of these methods , suchas deliberate misspellings and space insertion , might fool human readers who ignore occasional misspellings , but can often be easily detected by a computer. Random and Statistical generation: In order to avoid comparision with a known plaintext , steganographers often resort to generating their own cover texts .While this often resolves the problem of a known cover attack , the properties of the generated text may still give rise to suspicions that the text is not legitimate .Such generation generally tries to simulate some property of normal text , usually by approximating some arbitrary statiscal distribution found in real text .These include creating character sequences ,creating word sequences ,creating word sequences text mimicking etc. Linguistic methods: While there are statistical issues with various kinds of text mimicking (depending upon where the adversarial threshold is set) ,there are also linguistic issues present .In some sense ,one approach to linguistic steganalysis is to develop an analysis which is able to detect more complex linguistic structures than those which were used to produce the initial text .Note that one level of linguistic correctness is often implied by another , a syntactically correct text will necessarily contain valid lexical items .While a semantically coherent text is generally also syntactically correct , and rhetorically valid text has coherent semantics and correct grammar Image steganography

Fig5:Image Steganography Image steganography often involves hiding information in the naturally occurring noise within the image , and provides a good illustration for such techniques.Most kinds of information contain some kind of noise . Noise can be described as unwanted distortion of information within the signal.Within an audio signal ,the concept of noise is obvious .For images,however , noise generally refers to the imperfections inherent in the process of rendering an analog picture in digital image .For example ,the values of colors in the palette for a digital image will not only not be the exact colors in the real image , and the distribution of these colors will also be imperfect .As wayner mentions,the instantaneous measurement of photons made by digital camera also captures the randomness inherent in their behaviour ,leading to a set of imperfect measurements which balance out to become a digital image. There have been many techniques for hiding information or message in images in such a manner that the alterations made to the image are perceptually indiscemible .Common approaches include i. ii. iii. Least significant bit insertion(LSB) Masking and filtering Transform techniques

10

Least significant bit insertion(LSB): LSB is a simple approach to embed information in image file .The simplest steganography techniques embed the bits of the message directly into least significant bit plane of the cover image in a deterministic sequence .Modulating the least significant bit does not result in human perceptible difference because the amplitude of the change is small.

Fig6:LSB method of Image Steganography Masking and filtering: Masking and filtering techniqoes ,usually restricted to 24 bits and gray scale images ,hide information by marking an image ,in a manner similar to paper watermarks.The techniques perform analysis of the image,thus embed the information in significant areas so that the hidden message is more integral to the cover-image than just hiding it in the noise level.

11

Fig7:frequency masking and filtering method Transform techniques Transform techniques embed the message by modulating coefficients in a transform domain,such as the discrete cosine transform (DCT) used in PEG compression, discrete fourier transform ,or wavelet transform . these methods bide messages in significant areas of the cover-image , which make them more robust to attack . transform can be applied over the entire image, to block through out the image , or other variants.

Fig8:discrete cosine transform technique

12

Video steganography When information is hidden inside viedo the program or person hiding the information will usually use the DCT (discrete cosine transform)method.DCT works by slightly changing the each of the images in the video ,onloy so much though so its isnt noticeable by the human eye. To be more precise about how DCT works, DCT alters values of certain parts of the images, it usually rounds them up.for example if part of an image has a value of 6.667 it will round it up to 7. Steganography in videos is similar to that of steganography in images, apart from information is hidden in each frame of video.when only a small amount of information is hidden inside of video it generally isnt noticesble at all, however the more information that is hidden more noticeable it will become. As said previously , the video is a collection of images move,so most of the methods used in image steganography can be used on a video stegangraphy. It could be argued that video steganography is deived from the image steganography. In video steganography ,which is commonly used is a good transformation method using discrete cosine transform and wavelet compression .This LSB modification due to be generating very large stego while masking and filtering method will change the visual appearance videos directly .To hide the message on the cover of the video , the principle is the same as in image steganography. First of all performed transformations on each video frame the cover image to obtain the coefficients who will be selected based on certain threshold value .Coefficient will be replaced by the bits of data messages to be hidden .Once the entire message to embed ,coefficients were transformed back to produce a stego video .To extract the message from the stego video ,the principle is same as the image steganography .First performed in each transformation stego video image frame to obtain the coefficients to be selected based on the certain threshold value .Coefficient will be the data bits messages that have been hidden and will be written to the output file that contains the message to hide them .The advantage of steganography is the number of video data that can be hidden in it ,and the fact that the video is streams of image-image causes distortion in one frame image is not seen easily by the human

13

eye .However ,more and more data messages to be hidden ,not impossible if the change in video becomes more easily visible. Audio steganography Audio steganography,the hiding of messages in audio noise(and in frequencies which humans can not hear),is another area of information hiding that relies on using an existing source as a space in which to hide information.

Fig9:Audio file Audio steganography is a useful means for transmitting covert battlefield information via an innocuous cover audio signal .The two primary criteria for successful embedding of a covert message are that the stego signal resulting from embedding is perceptually indistinguishable from the host audio signal,and the embedding data recovery without the original cover signal etc,may depend upon the type of applications . Additionally ,for covert communications of key information the embedding information must withstand channel noise and intentional attacks or jamming on the signal .Also important is the resilence of the hidden information to stay hidden to pirates during their attempts at the detection .If the embedded message is another audio signal ,one may perceive the intented message even if some errors are encountered during the recovery .This is particularly important in covert communication as the stego signal may be received with intentional and unintentional changes due to noise in the channel or attacks .The primary goal here is to convey the concealed message albeit wuth reduced speech quality .Additionally ,some degradation in the perceptually quality of the stego signal from that of the original host signal may be acceptable .If the host used for carrying the covert message is not a common or familiar audio signal ,the degraded quality of the stego signal may not be noticeable by attackers ,hence the presence of information hidden in the stego may stay imperceptible and consequently impervious. The different techniques in audio steganography are Frequency masking
14

Basically this method calculates the frequency masking threshold using psycho acoustic model, data signal is spread by a M-sequence code, and the spread signal is embedded in audio below the frequency masking threshold. M-sequence codes have good autocorrelation properties where the autocorrelation function has peaks equal to 1 at 0, N, 2N (approximately 1/N elsewhere). Because of these periodic peaks, the Msequence code is self-clocking, so the receiver can easily synchronize the data frame and retrieve the embedded data by de-spreading with the same M-sequence code. Fig.2. shows an example of the original audio spectrum and the frequency masking threshold. The frequency masking threshold is calculated at each critical band based on the psycho acoustic model

Fig 10: Frequency Masking Threshold Next, data signal is spread by an M-sequence code. The spectrum of the spread signal is shown as Fig.3. The spectrum is almost flat in the wide frequency range. Compared to the masking threshold, some bands have higher spectrum of the spread data signal than the masking threshold, other bands have much lower spectrum than the threshold. The higher spread signal is audible to human ears, and the lower spread signal can be still increased up to the threshold. The spread signal of the flat spectrum is filtered with the masking filter that has the same amplitude response as the masking threshold. The spectrum of the output signal has the same spectrum as the masking threshold. Then the output signal is power-adjusted below the masking threshold and added to the original audio.

15

Fig 11 : Spread Data Signal. Fig.12 shows the spectrum of the output signal. In this way, the power of the spread signal can be maximized below the frequency masking threshold.

Fig 12 : Colored Spread Signal. Temporal masking Temporal masking or "non-simultaneous masking" occurs when a sudden stimulus sound makes inaudible other sounds which are present immediately preceding or following the stimulus. Masking which obscures a sound immediately preceding the masker is called backward masking or pre-masking and masking which obscures a sound immediately following the masker is called forward masking or postmasking.Temporal masking's effectiveness attenuates exponentially from the onset and
16

offset of the masker, with the onset attenuation lasting approximately 20 ms and the offset attenuation lasting approximately 100 ms. Similar to simultaneous masking, temporal masking reveals the frequency analysis performed by the auditory system; forward masking thresholds for complex harmonic tones (e.g., a sawtooth probe with a fundamental frequency of 500 Hz) exhibit threshold peaks (i.e., high masking levels) for frequency bands centered on the first several harmonics. In fact, auditory bandwidths measured from forward masking thresholds are narrower and more accurate than those measured using simultaneous masking. Temporal masking should not be confused with the ear's acoustic reflex, an involuntary response in the middle ear that is activated to protect the ear's delicate structures from loudsounds. Bit modification Data embedding by bit modification of host samples is a common technique in audio embedding . typically , the least significant bit of every sample in the host audio is altered in accordance with the data bits and a key .With the low sensitivity of the human auditory system to audio modification of the least significant bit has been shown to meet both the criteria of being perceptually indistinguishable and being able to correctly retrieve the embedded data .In addition ,the payload capacity of the method is large with one hit for every host sample.

Fig13:Bit modification method In general ,direct extension of the bit modification technique to host audio signals is precluded by the higher sensitivity and dynamic range of the human auditory system(HAS) compared with the visual system .With a larger power and dynamic range
17

,the human ear can detect a change in an audio file as low as one part in 10 million .In addition,the HAS can perceive a frequency range of one thousand to one .Thus any change due to embedding in an audio file must be extremely small to prevent the detection of the existence of the hidden information ,alternatively the change must be occurring at points that are masked out by their strong neighbours in the original host audio Wavelet Transform When putting down a wave let transform as simple wavelet in fifth resolution level ,the output will be a string with 6 sub-bands .Each of these belongs to a particular resolution level of wavelet transform. Least significant bit (LSB) insertion is an approach for embedding information in a cover image . It is also useful for audio and video steganography . For instance, a simple scheme proposed, is to place the embedding data at the least significant bit (LSB) of amplitude of cover audio with the bits of target data. The altered audio is called stego-audio. The human auditory system (HAS) perceives sounds over a range of power greater than 109:1 and a range of frequencies greater than 103:1.

Fig14:a)The schematic diagram of wavelet image decomposition with three levels, (b) The wavelet image multiresolution representation for Lena image with three levels.

The sensitivity of the HAS to the Additive White Gaussian Noise (AWGN) is high as well; this noise in a sound file can be detected as low as 70 dB below ambient level . Two properties of the HAS dominantly used in steganographic techniques are frequency masking and temporal masking . If we choose higher LSB layer for
18

embedding the probability of detection of hidden message by HAS increases. That provides a limit for choosing LSB layer. But if we choose the higher LSB bit and after embedding perform some modification to improve perceptual transparency then this should be a good approach. Applications of steganography:

Fig15:Appllications of steganography

1.8 AIM OF THE PROJECT


The main aim of the project is to implement i. LSB based Audio steganography ii. LSB based image steganography

19

1.9 TECHNICAL APPROACH


This project is done with the help of the MATLAB .This helps in transferring a secret message without even knowing that it is embedded in a cover file.

1.10 ORGANIZATION OF THE PROJECT


The project is organized in such a way that Chapter 2 includes implementation of audio steganography Chapter 3 includes implementation of image steganography Chapter 4 includes software development Chapter 5 includes results of the project. Chapter 6 includes conclusions and future enhancement.

20

CHAPTER 2 IMPLEMENTATION OF AUDIO STEGANOGRAPHY


2.1 BLOCK DIAGRAMS OF AUDIO STEGANOGRAPHY

Fig 16: For embedding process

21

Fig 17 : For extracting process

2.2 ALGORITHM FOR AUDIO STEGANOGRAPHY


For Embedding of Data Leave the header section of the file. Edit the least significant bit with the data that have to be embedded.
Take every alternative sample and change the LSB to embed the whole message.

For Extracting of Data Leave first 50 bytes. Start from the 51 byte and store the LSB in a queue. Check every alternate sample and store the LSB in previous queue with the left shift of previous bit.

2.3 FLOWCHART FOR AUDIOSTEGANOGRAPHY

Fig 18 : Flowchart of Audio steganography


22

2.4 WORKING OF THE PROJECT


In the current endeavour , an audio file with .WAV extension has been selected as host file.It is assumed that the least significant bits of that file should be modified without degrading the sound quality . To do that , first one needs to know the file structure of the audio file .Like most files , WAV files have two basic parts , the header and the data. In normal WAV files , the header is situated in the first 44 bytes of the file. Except the first 44 bytes , the rest of the bytes of the file are all about the data. The data is just one chunk of samples that represents the whole audio. While embedding data , one cannot deal with the header section . This is because a minimal change in the header section leads to a corrupted audio file. A program has been developed which can read the audio file bit by bit and stores them in a different file. The first 44 bytes should be left without any change in them because these are the data of the header section. Then start with the remaining data field to modify them to embed textual information. For example , if the word Audio has to be embedded into an audio file one has to embed the binary values of the word Audio in the audio data field. Consider the following table: Letter A U D i O ASCII value 065 117 100 105 111 Corresponding Binary value 01000001 01110101 01100100 01101001 01101111

Table2: ASCII values for the text to be embedded From the table , one can come to a point that to embedded the word Audio into the host audio file actually the corresponding eight bit binary values have to be embedded into the data field of that audio file.
23

The data embedding with LSB modification has been started after the geader section. If the data embedding process is started from 51 sample then the LSB value of the 51 sample should be modified. If the binary value of the corresponding sample is 01110100 then 1 should be modified . From Table 1 it can be observed that to embed the letter A , the sender has to embed the binary value 01000001 . That is why according to the embedding Sample No Binary values of corresponding data Binary values to be Binary values after embedded modification

51 53 55 57 59 61 63 65

01110100 01011110 10001011 01111011 10100010 00110010 11101110 01011100

0 1 0 0 0 0 0 1

01110100 01011111 10001010 01111010 10100010 00110010 11101110 01011101

Table3: Embedding secret text into an audio file According to the same way the remaining consecutive letters of the word Audio is embedded in the file audio.wav. Editing of the existing binary values with the intended binary values causes a minimal change in the audio file audio.wav that remains almost imperceptible to anyone other than the sender. When it comes to the point of data retrieving at the receivers end , the retrieving algorithm has to be allowed. First, change the audio message into the binary format that has come from the source as stego-object. Leave first 50 bytes with no change in them. Start from 51 bit , check the least significant bit and store it in a queue. Check every alternate sample to collect the whole messages. Like 53,55 and 57 and so on. Store the least significant bits of the alternate samples in the queue with left shift of previous bit. Convert the binary values

24

to decimated to get back the ASCII from which the text can be retrieved. The whole retrieval process can be depicted with the following table more thoroughly: Sample No Binary values with embedded secret data 51 53 55 57 59 61 63 65 01110100 01011111 10001010 10001010 10100010 00110010 11101110 01011101 Table 4:Extracting secret text from an audio file Bits that are stored in queue 0 01 010 0100 01000 010000 0100000 01000001

2.5 APPLICATIONS
The area differs in what feature of the steganography is utilized in each system. 1. Confidential communication and secret data storing The "secrecy" of the embedded data is essential in this area. Historically, steganography have been approached in this area. Steganography provides us with: (A) Potential capability to hide the existence of confidential data (B) Hardness of detecting the hidden (i.e., embedded) data (C) Strengthening of the secrecy of the encrypted data In practice, when you use some steganography, you must first select a vessel data according to the size of the embedding data. The vessel should be innocuous. Then, you
25

embed the confidential data by using an embedding program (which is one component of the steganography software) together with some key. When extracting, you (or your party) use an extracting program (another component) to recover the embedded data by the same key ( "common key" in terms of cryptography). In this case you need a "key negotiation" before you start communication. Attaching a stego file to an e-mail message is the simplest example in this application area. But you and your party must do a "sending-and-receiving" action that could be noticed by a third party. So, e-mailing is not a completely secret communication method. There is an easy method that has no key-negotiation. We have a model of "Anonymous Covert Mailing System." There is some other communication method that uses the Internet Webpage. In this method you don't need to send anything to your party, and no one can detect your communication. Each secrecy based application needs an embedding process which leaves the smallest embedding evidence. You may follow the following. (A) Choose a large vessel, larger the better, compared with the embedding data. (B) Discard the original vessel after embedding. For example, in the case of Qtech Hide & View, it leaves some latent embedding evidence even if the vessel has a very large embedding capacity. You are recommended to embed only 25% or less (for PNG / BMP output) of the maximum capacity, or only 3% of the vessel size (for JPEG output).. 2. Protection of data alteration We take advantage of the fragility of the embedded data in this application area.We asserted that "the embedded data can rather be fragile than be very robust." Actually, embedded data are fragile in most steganography programs. Especially, Qtech Hide & View program embeds data in an extremely fragile manner. However, this fragility opens a new direction toward an information-alteration protective system such as a "Digital Certificate Document System." The most novel point among others is that "no authentication bureau is needed." If it is implemented, people can send their "digital
26

certificate data" to any place in the world through Internet. No one can forge, alter, nor tamper such certificate data. If forged, altered, or tampered, it is easily detected by the extraction program. 3. Access control system for digital content distribution In this area embedded data is "hidden", but is "explained" to publicize the content. Today, digital contents are getting more and more commonly distributed by Internet than ever before. For example, music companies release new albums on their Webpage in a free or charged manner. However, in this case, all the contents are equally distributed to the people who accessed the page. So, an ordinary Web distribution scheme is not suited for a "case-by-case" and "selective" distribution. Of course it is always possible to attach digital content to e-mail messages and send to the customers. But it will takes a lot of cost in time and labor.If you have some valuable content, which you think it is okay to provide others if they really need it, and if it is possible to upload such content on the Web in some covert manner. And if you can issue a special "access key" to extract the content selectively, you will be very happy about it. A steganographic scheme can help realize a this type of system. We have developed a prototype of an "Access Control System" for digital content distribution through Internet. The following steps explain the scheme. (1) A content owner classify his/her digital contents in a folder-by-folder manner, and embed the whole folders in some large vessel according to a steganographic method using folder access keys, and upload the embedded vessel (stego data) on his/her own Webpage. (2) On that Webpage the owner explains the contents in depth and publicize worldwide. The contact information to the owner (post mail address, e-mail address, phone number, etc.) will be posted there. (3) The owner may receive an access-request from a customer who watched that Webpage. In that case, the owner may (or may not) creates an access key and provide it to the customer (free or charged)..In this mechanism the most important point is, a "selective extraction" is possible or not.

27

4. Media Database systems In this application area of steganography secrecy is not important, but unifying Media data (photo picture, movie, music, etc.) have some association with other two types of data into one is the most important. information. A photo picture, for instance, may have the following. (1) The title of the picture and some physical object information (2) The date and the time when the picture was taken (3) The camera and the photographer's information Formerly, these are annotated beside the each picture in the album. Recently, almost all cameras are digitalized. They are cheap in price, easy to use, quick to shoot. They eventually made people feel reluctant to work on annotating each picture. Now, most home PC's are stuck with the huge amount of photo files. In this situation it is very hard to find a specific shot in the piles of pictures. A "photo album software" may help a little. You can sort the pictures and put a couple of annotation words to each photo. When you want to find a specific picture, you can make a search by keywords for the target picture. However, the annotation data in such software are not unified with the target pictures. Each annotation only has a link to the picture. Therefore, when you transfer the pictures to a different album software, all the annotation data are lost. This problem is technically referred to as "Metadata (e.g., annotation data) in a media database system (a photo album software) are separated from the media data (photo data) in the database managing system (DBMS)." This is a big problem. Steganography can solve this problem because a steganography program unifies two types of data into one by way of embedding operation. So, metadata can easily be transferred from one system to another without hitch. Specifically, you can embed all your good/bad memory (of your sight-seeing trip) in each snap shot of the digital photo. You can either send the embedded picture to your friend to extract your memory on his/her PC, or you may keep it silent in your own PC to enjoy extracting the memory ten years after.

2.6 ADVANTAGES AND LIMITATIONS


2.6.1 ADVANTAGES High potential to conceal more data. Security
28

No audible degradation. Flexibility 2.6.2 LIMITATIONS Tedious task. Only certain sized data is hidden. Compressing an audio file with lossy compression.

CHAPTER-3 IMPLEMENTATION OF IMAGE STEGANOGRAPHY


3.1 BLOCK DIAGRAM OF IMAGE STEGANOGRAPHY

29

Fig 19: Block diagram of image steganography

3.2 ALGORITHM FOR IMAGE STEGANOGRAPHY


Encoding A cover image is chosen. A secret text is considered. LSB positions of the cover image are replaced. Decoding LSB positions are decoded by using a extraction technique
Secret text is extracted

3.3 FLOWCHART FOR IMAGE STEGANOGRAPHY

30

Fig 20 : Flowchart of image steganography

3.4 WORKING OF THE PROJECT


One of the most common techniques used in steganography today is called least significant bit (LSB) insertion. This method is exactly what it sounds like; the least significant bits of the cover-image are altered so that they form the embedded information. The following example shows how the letter A can be hidden in the first eight bytes of three pixels in a 24-bit image. Pixels: (00100111 11101001 11001000) (00100111 11001000 11101001) (11001000 00100111 11101001) A: 01000001 Result: (00100110 11101001 11001000) (00100110 11001000 11101000) (11001000 00100111 11101001) The three underlined bits are the only three bits that were actually altered. LSB insertion requires on average that only half the bits in an image be changed. Since the 8-

31

bit letter A only requires eight bytes to hide it in, the ninth byte of the three pixels can be used to begin hiding the next character of the hidden message. A slight variation of this technique allows for embedding the message in two or more of the least significant bits per byte. This increases the hidden information capacity of the cover-object, but the cover-object is degraded more, and therefore it is more detectable. Other variations on this technique include ensuring that statistical changes in the image do not occur. While LSB insertion is easy to implement, it is also easily attacked. Slight modifications in the color palette and simple image manipulations will destroy the entire hidden message. A practical steganographic implementation for 8-bit images enabled smaller file sizes to be utilized in steganographic communications. While also limiting the size of the hidden file, this implementation addressed issues that have been passed by in other applications, and provided a more compact vehicle for those secret communications that do not require a large cover-file. The colormap in an 8-bit color image has a maximum of 256, 24-bit colors. However, in order to minimize the noise added when the least significant bits are changed, a starting colormap of only 240 colors is created. Sixteen additional colors will be added to the colormap by the time the final picture is written. In order to select the 240 original colors, the image is divided into a grid of fifteen quadrants by sixteen quadrants, as seen in Fig. 1. One color is chosen from each of these quadrants by randomly selecting a set of X and Y coordinates within each quadrant. Calculations are then made to determine the index of the pixel in the array of RGBQUADS that represent the image data. (An RGBQUAD is a structure containing four bytes, one each for the red, green, and blue intensity and a reserved byte.). Each pixel in an 8-bit color image is an 8-bit pointer to a 24-bit color in the colormap. Looking ahead to the LSB insertion, a pixel pointing to a red color could suddenly point to a yellow color by a simple flip of the least significant bit. In order to reduce dramatic noise such as that, the colormap was sorted so that similar colors are next to each other before the pixels are assigned to colormap colors. The sorting algorithm works as follows. Beginning with the first color in the colormap array, the pixel that is the closest in color to the starting pixel is found using the mean absolute error measure. If the best match to a color results in an error level greater than 100 meaning that there really was not a very good match to the color), a new color is created in the first open slot (using the sixteen extra spaces in the colormap) and this
32

new color is used as the pair. The best-matched color is then switched with the color immediately following the starting color. The same procedure is repeated with the next color that has not been matched. Once the original 240 colors have been matched, additional colors are created to fill any of the extra sixteen positions left in the original colormap. After sorting the colormap, the 8-bit image is almost ready to be created. An 8-bit bitmap contains a colormap of 256 colors and contains an assignment of each pixel to a color in the colormap. To assign the pixels to a colormap color, the original 24-bit image pixels are used. A pixel is chosen from the original 24-bit image and its RGB values are compared to the RGB values of every color in the colormap. For each comparison an error level is calculated using the mean absolute error of the red, green, and blue color components. The colormap color that produces the smallest amount of error is the colormap color that gets assigned to this pixel. The image is now ready to have data embedded into it. The encode function takes three parameters and two steps in order to complete. The data string of text, picture data, and binary data string are the three parameters for the first step in encoding the text into the image. The first step in the encoding function is to convert the ASCII text into its binary equivalent. In order to do this, each character of the text message is converted to its ordinal number (example: a = 97). The ordinal number is then converted to binary using the following method called the division-remainder routine. An ordinal number is divided by two using the mod() function. This function returns either a one or a zero, which is then placed in a remainder array. This is continued until the dividend is zero. The ones and zeros in the emainder array is the binary equivalent of the ASCII ordinal number. Then, once all characters have been converted in this fashion, the binary data is embedded in the image by sequentially altering the least significant bit of the image data as necessary.

3.5 APPLICATIONS
The area differs in what feature of the steganography is utilized in each system. 1. Confidential communication and secret data storing The "secrecy" of the embedded data is essential in this area. Historically, steganography have been approached in this area. Steganography provides us with: (A) Potential capability to hide the existence of confidential data
33

(B) Hardness of detecting the hidden (i.e., embedded) data (C) Strengthening of the secrecy of the encrypted data In practice, when you use some steganography, you must first select a vessel data according to the size of the embedding data. The vessel should be innocuous. Then, you embed the confidential data by using an embedding program (which is one component of the steganography software) together with some key. When extracting, you (or your party) use an extracting program (another component) to recover the embedded data by the same key ( "common key" in terms of cryptography). In this case you need a "key negotiation" before you start communication. Attaching a stego file to an e-mail message is the simplest example in this application area. But you and your party must do a "sending-and-receiving" action that could be noticed by a third party. So, e-mailing is not a completely secret communication method. There is an easy method that has no key-negotiation. We have a model of "Anonymous Covert Mailing System." There is some other communication method that uses the Internet Webpage. In this method you don't need to send anything to your party, and no one can detect your communication. Each secrecy based application needs an embedding process which leaves the smallest embedding evidence. You may follow the following. (A) Choose a large vessel, larger the better, compared with the embedding data. (B) Discard the original vessel after embedding. For example, in the case of Qtech Hide & View, it leaves some latent embedding evidence even if the vessel has a very large embedding capacity. You are recommended to embed only 25% or less (for PNG / BMP output) of the maximum capacity, or only 3% of the vessel size (for JPEG output).. 2. Protection of data alteration

34

We take advantage of the fragility of the embedded data in this application area.We asserted that "the embedded data can rather be fragile than be very robust." Actually, embedded data are fragile in most steganography programs. Especially, Qtech Hide & View program embeds data in an extremely fragile manner. However, this fragility opens a new direction toward an information-alteration protective system such as a "Digital Certificate Document System." The most novel point among others is that "no authentication bureau is needed." If it is implemented, people can send their "digital certificate data" to any place in the world through Internet. No one can forge, alter, nor tamper such certificate data. If forged, altered, or tampered, it is easily detected by the extraction program. 3. Access control system for digital content distribution In this area embedded data is "hidden", but is "explained" to publicize the content. Today, digital contents are getting more and more commonly distributed by Internet than ever before. For example, music companies release new albums on their Webpage in a free or charged manner. However, in this case, all the contents are equally distributed to the people who accessed the page. So, an ordinary Web distribution scheme is not suited for a "case-by-case" and "selective" distribution. Of course it is always possible to attach digital content to e-mail messages and send to the customers. But it will takes a lot of cost in time and labor.If you have some valuable content, which you think it is okay to provide others if they really need it, and if it is possible to upload such content on the Web in some covert manner. And if you can issue a special "access key" to extract the content selectively, you will be very happy about it. A steganographic scheme can help realize a this type of system. We have developed a prototype of an "Access Control System" for digital content distribution through Internet. The following steps explain the scheme. (1) A content owner classify his/her digital contents in a folder-by-folder manner, and embed the whole folders in some large vessel according to a steganographic method using folder access keys, and upload the embedded vessel (stego data) on his/her own Webpage.

35

(2) On that Webpage the owner explains the contents in depth and publicize worldwide. The contact information to the owner (post mail address, e-mail address, phone number, etc.) will be posted there. (3) The owner may receive an access-request from a customer who watched that Webpage. In that case, the owner may (or may not) creates an access key and provide it to the customer (free or charged).. In this mechanism the most important point is, a "selective extraction" is possible or not. 4. Media Database systems In this application area of steganography secrecy is not important, but unifying two types of data into one is the most important. Media data (photo picture, movie, music, etc.) have some association with other information. A photo picture, for instance, may have the following. (1) The title of the picture and some physical object information (2) The date and the time when the picture was taken (3) The camera and the photographer's information Formerly, these are annotated beside the each picture in the album. Recently, almost all cameras are digitalized. They are cheap in price, easy to use, quick to shoot. They eventually made people feel reluctant to work on annotating each picture. Now, most home PC's are stuck with the huge amount of photo files. In this situation it is very hard to find a specific shot in the piles of pictures. A "photo album software" may help a little. You can sort the pictures and put a couple of annotation words to each photo. When you want to find a specific picture, you can make a search by keywords for the target picture. However, the annotation data in such software are not unified with the target pictures. Each annotation only has a link to the picture. Therefore, when you transfer the pictures to a different album software, all the annotation data are lost. This problem is technically referred to as "Metadata (e.g., annotation data) in a media database system (a photo album software) are separated from the media data (photo data) in the database managing system (DBMS)." This is a big problem. Steganography can solve this problem because a steganography program unifies two types of data into one by way of embedding operation. So, metadata can easily be
36

transferred from one system to another without hitch. Specifically, you can embed all your good/bad memory (of your sight-seeing trip) in each snap shot of the digital photo. You can either send the embedded picture to your friend to extract your memory on his/her PC, or you may keep it silent in your own PC to enjoy extracting the memory ten years after.

3.6 ADVANTAGES AND LIMITATIONS


3.6.1 ADVANTAGES Hard to detect . Original image is very similar to altered image. Embedded data resembles Gaussian noise. Hard to detect as data and fundamental image share same range. 3.6.2 DISADVANTAGES Message is hard to recover if image is subject to attack such as translation and rotation. Significant damage to picture appearance . Message difficult to recover. Image is distorted. Message easily lost if image is compressed.

CHAPTER-4
37

SOFTWARE DEVELOPMENT
4.1 INTRODUCTION TO MATLAB
MATLAB is a high-performance language for technical computing. It integrates computation, visualization, and programming in an easy-to-use environment where problems and solutions are expressed in familiar mathematical notation. Typical uses include: Math and Computation Algorithm Development Data Acquisition Modeling, Simulation, and Prototyping Data analysis, Exploration, and visualization Scientific and Engineering graphics Application development, including graphical user interface building MATLAB is an interactive system whose basic data element is an array that does not require dimensioning. This allows you to solve many technical computing problems, especially those with matrix and vector formulations, in a fraction of the time it would take to write a program in a scalar non-interactive language such as C or FORTRAN. The name MATLAB stands for Matrix Laboratory. MATLAB was originally written to provide easy access to matrix software developed by the LINPACK and EISPACK projects. Today, MATLAB engines incorporate the LAPACK and BLAS libraries, embedding the state of the art in software for matrix computation. MATLAB has evolved over a period of years with input from many users. In university environments, it is the standard instruction tool for introductory and advanced courses in mathematics, engineering, and science. In industry, MATLAB is a tool of choice for high productive research, development, and analysis. MATLAB features a family of add-on application-specific solutions called toolboxes. Very important to users of MATLAB, toolboxes allow you to learn and apply specialized technology. Toolboxes are comprehensive collections of MATLAB functions (M-files) that extend the MATLAB environment to solve the regular classes of problems. Areas in which the toolboxes are available include signal processing, control systems, neural networks, fuzzy logic, wavelets, simulation, and many others.
38

4.2 The MATLAB System


The MATLAB system consists of five main parts: Develop Environment: This is the set of tools and facilities that help you use MATLAB functions and files. Many of these tools graphical user interfaces. It includes the MATLAB desktop and command window, an editor and debugger, and browsers for viewing help, the workspace, files, and the search path. MATLAB Mathematical Function: This is a vast collection of computational algorithms ranging from elementary functions like sum, sine, cosine, and complex arithmetic, to more sophisticated functions like matrix inverse, matrix Eigen values, Bessel functions, and fast Fourier transforms. MATLAB Language: This is a high level matrix/array language with control flow statements, functions, data structures, input/output, and object-oriented programming features. It allows both programming in the small to rapidly create quick and dirty throw-away programs, and programming in the large to create complete large and complex application programs. Graphics: MATLAB has extensive facilities for displaying vectors and matrices as graphs, as well as annotating and printing these graphs. It includes high-level functions for twodimensional and three-dimensional data visualization, image processing, animation, and presentation graphics. It also includes low-level functions that allow you to fully customize the appearance of graphics as well as to build complete graphical user interfaces on your MATLAB applications. The MATLAB Application Program Interface (API): This is the library that allows you to write C and FORTRAN programs that interact with MATLAB. It includes facilities for calling routines from MATLAB (dynamic linking), calling MATLAB as a computational engine, and for reading and writing MAT-files.

4.3 MATLAB WORKING ENVIRONMENT

39

Fig21:Opening MATLAB Editor

Fig22:Setting path to MATLAB MATLAB Desktop MATLAB Desktop is the main MATLAB application window. The desktop contains five sub-windows, the command window, the workspace browser, the current directory window, the command history window, and one or more figure windows, which are shown only when the user displays a graphic.

40

Fig23:The MATLAB windows The command window is where the user types MATLAB commands and expressions at the prompt (>>) and where the output of those commands is displayed. MATLAB defines the workspace as the set of variables that the user creates in a work session. The workspace browser shows these variables and some information about them. Double clicking on a variable in the workspace browser launches the Array Editor, which can be used to obtain information and incoming instances edit certain properties of the variable. MATLAB uses a search path to find M-files and other MATLAB related files, which are organize in directories in the computer file system. Any file run in MATLAB must reside in the current directory or in a directory that is on search path. By default, the files supplied with MATLAB and math works toolboxes are included in the search path. The easiest way to see which directories is soon the search path, or to add or modify a search path is to select set path from the File menu the desktop, and then use the set path dialog box. It is good practice to add any commonly used directories to the search path to avoid repeatedly having the change the current directory. The Command History Window contains a record of the commands a user has entered in the command window, including both current and previous MATLAB sessions. Previously entered MATLAB commands can be selected and re-executed from the command history window by right clicking on a command or sequence of commands. This action launches a menu from which to select various options in addition to executing the commands. This is useful to select various options in addition to executing the commands. This is a useful feature when experimenting with various commands in a work session. Using the MATLAB Editor to create M-Files: The MATLAB editor is both a text editor specialized for creating M-Files and a graphical MATLAB debugger. The editor can appear in a window by itself, or it can be a sub window in the desktop. M-Files are denoted by the extension .m, as in pixel up.m. The MATLAB editor window has numerous pull-down menus for tasks such as saving, viewing, and debugging files. Because it performs some simple checks and also uses color to differentiate between various elements of code, this text editor is recommended
41

as the tool of choice for writing and editing M-Functions. To open the editor, type edit at the prompt opens the M-File filename.m in an editor window, ready for editing. As noted earlier, the file must be in the current directory, or in a directory in the search path.

Fig 24 : Creating an m file

42

Fig25:saving the MATLAB file Getting Help: The principal way to get help online is to use the MATLAB help browser, opened as a separate window either by clicking on the question mark symbol (?) on the desktop toolbar, or by typing help browser at the prompt in the command window. The help browser is a web browser integrated into the MATLAB desktop that displays a Hyper Text Markup Language (HTML) documents. The Help Browser consists of two panes, the help navigator pane, used to find information, and the display pane, used to view the information. Self-explanatory tabs other than navigator pane are used to perform a search.

43

Fig26: Selecting the Matlab file Description of functions used for coding: Uigetfile: Uigetfile displays a modal dialog box that lists files in the current directory and enables the user to select or type the name of a file to be opened. If the filename is valid and if the file exists, uigetfile returns the filename when the user clicks Open. Otherwise uigetfile displays an appropriate error message from which control returns to the dialog box. The user can then enter another filename or click Cancel. If the user clicks Cancel or closes the dialog window, uigetfile returns 0. [FileName,PathName,FilterIndex] = uigetfile(FilterSpec) displays only those files with extensions that match FilterSpec. The uigetfile function appends 'All Files' to the list of file types.FilterSpec can be a string or a cell array of strings, and can include the * wildcard.

If FilterSpec is a string that contains a filename, the filename is displayed and selected in the File name field and the file's extension is used as the default filter.

If FilterSpec is a string, it can include a path. That path can contain '.','..', or '/'. For example, '../*.m' lists all M-files in the directory above the current directory.

44

If FilterSpec is a cell array of strings, the first column contains a list of file extensions. The optional second column contains a corresponding list of descriptions. If FilterSpec is not specified, uigetfile uses the default list of file types (i.e., all MATLAB files).After the user clicks Open and if the filename exists,uigetfile returns the name of the file in FileName and its path in PathName. If the user clicks Cancel or closes the dialog window, FileName and PathName are set to 0. Wavread: Syntax: y = wavread(filename) [y, Fs, nbits] = wavread(filename) [...] = wavread(filename, N) [...] = wavread(filename,[N1 N2]) y = wavread(filename, fmt) siz = wavread(filename,'size') [y, fs, nbits, opts] = wavread(...) Description: y = wavread(filename) loads a WAVE file specified by filename, returning the sampled data in y. The filename input is a string enclosed in single quotes. The .wav extension is appended if no extension is given. [y, Fs, nbits] = wavread(filename) returns the sample rate (Fs) in Hertz and the number of bits per sample (nbits) used to encode the data in the file. y = wavread(filename, fmt) specifies the data type format of y used to represent samples read from the file. fmt can be either of the double or native .
45

Sound: Syntax: sound(y,Fs) sound(y) sound(y,Fs,bits)

sound(y,Fs) sends the signal in vector y (with sample frequency Fs) to the speaker on PC and most UNIX platforms. Values in y are assumed to be in the range . Values outside that range are clipped. Stereo sound is played on platforms that support it when y is an n-by-2 matrix. The values in column 1 are assigned to the left channel, and those in column 2 to the right. sound(y) plays the sound at the default sample rate or 8192 Hz. sound(y,Fs,bits) plays the sound using bits number of bits/sample, if possible. Most platforms support bits = 8 or bits = 16. fopen: Syntax: fid = fopen(filename) fid = fopen(filename, permission) fid = fopen(filename, permission_tmode) [fid, message] = fopen(filename, permission) [fid, message] = fopen(filename, permission, machineformat) [fid, message] = fopen(filename, permission, machineformat, encoding) fids = fopen('all') [filename, permission, machineformat, encoding] = fopen(fid)

Description:

46

fid = fopen(filename) opens the file filename for read access.The filename argument is a string enclosed in single quotes. It can be a MATLABPATH relative partial pathname if the file is opened for reading only. A relative path is always searched for first with respect to the current directory. If it is not found, and reading only is specified or implied, then fopen does an additional search of the MATLABPATH. fread: Syntax: A = fread(fid) A = fread(fid, count) A = fread(fid, count, precision) A = fread(fid, count, precision, skip) A = fread(fid, count, precision, skip, machineformat) [A, count] = fread(...) A = fread(fid) reads data in binary format from the file specified by fid into matrix A. Open the file using fopen before calling fread. The fid argument is the integer file identifier obtained from the fopen operation. The MATLAB software reads the file from beginning to end, and then positions the file pointer at the end of the file. fwrite: Syntax: fwrite(obj,A) fwrite(obj,A,'precision') fwrite(obj,A,'mode') fwrite(obj,A,'precision','mode') Description: fwrite(obj,A) writes the binary data A to the device connected to obj.

47

fwrite(obj,A,'precision')

writes

binary

data

with

precision

specified

by

precision.precision controls the number of bits written for each value and the interpretation of those bits as integer, floating-point, or character values. fclose: Syntax: status=fclose(fid) status = fclose('all') Description: status = fclose(fid) closes the specified file if it is open, returning 0 if successful and -1 if unsuccessful. Argument fid is a file identifier associated with an open file. If fid does not represent an open file, or if it is equal to 0, 1, or 2, then fclose throws an error. status = fclose('all') closes all open files (except standard input, output, and error), returning 0 if successful and -1 if unsuccessful. display: Syntax: You control the display format using the Format parameter: short displays a 5-digit scaled value with fixed decimal point long displays a 15-digit scaled value with fixed decimal point short_e displays a 5-digit value with a floating decimal point long_e displays a 16-digit value with a floating decimal point bank displays a value in fixed dollars and cents format (but with no $ or commas) hex (Stored Integer) displays the stored integer value of a fixed-point input in hexadecimal format binary (Stored Integer) displays the stored integer value of a fixed-point input in binary format decimal (Stored Integer) displays the stored integer value of a fixed-point input in decimal format
48

octal (Stored Integer) displays the stored integer value of a fixed-point input in octal format reshape: Syntax: B = reshape(A,m,n) B = reshape(A,m,n,p,...) B = reshape(A,[m n p ...]) B = reshape(A,...,[],...) B = reshape(A,siz) Description: B = reshape(A,m,n) returns the m-by-n matrix B whose elements are taken columnwise from A. An error results if A does not have m*n elements. B = reshape(A,m,n,p,...) or B = reshape(A,[m n p ...]) returns an n-dimensional array with the same elements as A but reshaped to have the size m-by-n-by-p-by-.... The product of the specified dimensions, m*n*p*..., must be the same as prod(size(A)). B = reshape(A,...,[],...) calculates the length of the dimension represented by the placeholder [], such that the product of the dimensions equals prod(size(A)). The value of prod(size(A)) must be evenly divisible by the product of the specified dimensions. You can use only one occurrence of []. B = reshape(A,siz) returns an n-dimensional array with the same elements as A, but reshaped to siz, a vector representing the dimensions of the reshaped array. The quantity prod(siz) must be the same as prod(size(A)). bid2e: Syntax: d = bi2de(b) d = bi2de(b,flg)
49

d = bi2de(b,p) d = bi2de(b,p,flg) Description: d = bi2de(b) converts a binary row vector b to a nonnegative decimal integer. If b is a matrix, each row is interpreted separately as a binary number. In this case, the output d is a column vector, each element of which is the decimal representation of the corresponding row of b. d = bi2de(b,flg) is the same as the syntax above, except that flg is a string that determines whether the first column of b contains the lowest-order or highest-order digits. Possible values for flg are 'right-msb' and 'left-msb'. The value 'right-msb' produces the default behavior. d = bi2de(b,p) converts a base-p row vector b to a nonnegative decimal integer , where p is an integer greater than or equal to 2. The first column of b is the lowest base-p digit. If b is a matrix, the output d is a nonnegative decimal vector, each row of which is the decimal form of the corresponding row of b. d = bi2de(b,p,flg) is the same as the syntax above, except that flg is a string that determines whether the first column of b contains the lowest-order or highest-order digits. Possible values for flg are 'right-msb' and 'left-msb'. The value 'right-msb' produces the default behavior. bitset: Syntax: C = bitset(A, bit) C = bitset(A, bit, v) Description:

50

C = bitset(A, bit) sets bit position bit in A to 1 (on). A must be an unsigned integer or an array of unsigned integers, and bit must be a number between 1 and the number of bits in the unsigned integer class of A (e.g., 32 for the uint32 class). C = bitset(A, bit, v) sets the bit at position bit to the value v, which must be either 0 or 1. bitget: Syntax: C = bitget(A, bit) Description: C = bitget(A, bit) returns the value of the bit at position bit in A. Operand A must be an unsigned integer or an array of unsigned integers, and bit must be a number between 1 and the number of bits in the unsigned integer class of A (e.g., 32 for the uint32 class). char: Syntax: S = char(X) S = char(C) S = char(t1, t2, t3, ...) Description: S = char(X) converts the array X that contains nonnegative integers representing character codes into a MATLAB character array. The actual characters displayed depend on the character encoding scheme for a given font. The result for any elements of X outside the range from 0 to 65535 is not defined (and can vary from platform to platform). Use double to convert a character array into its numeric codes. S = char(C), when C is a cell array of strings, places each element of C into the rows of the character array s. Use cellstr to convert back.
51

S = char(t1, t2, t3, ...) forms the character array S containing the text strings T1, T2, T3, ... as rows, automatically padding each string with blanks to form a valid matrix. Each text parameter, Ti, can itself be a character array. This allows the creation of arbitrarily large character arrays. Empty strings are significant. numel: Syntax: n = numel(A) n = numel(A, index1, index2, ... indexn) Description: n = numel(A) returns the number of elements, n, in array A. n = numel(A, index1, index2, ... indexn) returns the number of subscripted elements, n, in A(index1, index2, ..., indexn). To handle the variable number of arguments, numel is typically written with the header function n = numel(A, varargin), where varargin is a cell array with elements index1, index2, ... indexn. The MATLAB software implicitly calls the numel built-in function whenever an expression generates a comma-separated list. This includes brace indexing (i.e., A{index1,index2,...,indexN}), and dot indexing (i.e., A.fieldname). imread: Syntax: A = imread(filename, fmt) [X, map] = imread(...) [...] = imread(filename) [...] = imread(URL,...) [...] = imread(..., idx) CUR or ICO [A, map, alpha] = imread(...) CUR or ICO [...] = imread(..., idx) GIF
52

[...] = imread(..., 'frames', idx) GIF [...] = imread(..., ref) HDF4 [...] = imread(...,'BackgroundColor',BG) PNG [A, map, alpha] = imread(...) PNG [...] = imread(..., idx) TIFF [...] = imread(..., 'PixelRegion', {ROWS, COLS}) TIFF Description: A = imread(filename, fmt) reads a grayscale or color image from the file specified by the string filename. If the file is not in the current directory, or in a directory on the MATLAB path, specify the full pathname. [X, map] = imread(...) reads the indexed image in filename into X and its associated colormap into map. Colormap values in the image file are automatically rescaled into the range [0,1]. [...] = imread(filename) attempts to infer the format of the file from its content. [...] = imread(URL,...) reads the image from an Internet URL. The URL must include the protocol type. textread: Syntax: [A,B,C,...] = textread('filename','format') [A,B,C,...] = textread('filename','format',N) [...] = textread(...,'param','value',...) Description: [A,B,C,...] = textread('filename','format') reads data from the file 'filename' into the variables A,B,C, and so on, using the specified format, until the entire file is read. The filename and format inputs are strings, each enclosed in single quotes. textread is useful

53

for reading text files with a known format. textread handles both fixed and free format files. [A,B,C,...] = textread('filename','format',N) reads the data, reusing the format string N times, where N is an integer greater than zero. If N is smaller than zero, textread reads the entire file. zeros: Syntax: B = zeros(n) B = zeros(m,n) B = zeros([m n]) B = zeros(m,n,p,...) B = zeros([m n p ...]) B = zeros(size(A)) zeros(m, n,...,classname) zeros([m,n,...],classname) Description: B = zeros(n) returns an n-by-n matrix of zeros. An error message appears if n is not a scalar. B = zeros(m,n) or B = zeros([m n]) returns an m-by-n matrix of zeros. B = zeros(m,n,p,...) or B = zeros([m n p ...]) returns an m-by-n-by-p-by-... array of zeros. B = zeros(size(A)) returns an array the same size as A consisting of all zeros. zeros(m, n,...,classname) or zeros([m,n,...],classname) is an m-by-n-by-... array of zeros of data type classname. classname is a string specifying the data type of the output. classname can have the following values: 'double', 'single', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', or 'uint64'.
54

floor: Syntax: B = floor(A) Description: B = floor(A) rounds the elements of A to the nearest integers less than or equal to A. For complex A, the imaginary and real parts are rounded independently. size: Syntax: d = size(X) [m,n] = size(X) m = size(X,dim) [d1,d2,d3,...,dn] = size(X) Description: d = size(X) returns the sizes of each dimension of array X in a vector d with ndims(X) elements. If X is a scalar, which MATLAB regards as a 1-by-1 array, size(X) returns the vector [1 1]. [m,n] = size(X) returns the size of matrix X in separate variables m and n. m = size(X,dim) returns the size of the dimension of X specified by scalar dim. [d1,d2,d3,...,dn] = size(X), for n > 1, returns the sizes of the dimensions of the array X in the variables d1,d2,d3,...,dn, provided the number of output arguments n equals ndims(X). If n does not equal ndims(X), the following exceptions hold.

55

double: Syntax: double(x)

Description:double(x) returns the double-precision value for X. If X is already a double-precision array, double has no effect. length: Syntax:n = length(X) Description:The statement length(X) is equivalent to max(size(X)) for nonempty arrays and 0 for empty arrays. n = length(X) returns the size of the longest dimension of X. If X is a vector, this is the same as its length.

4.4 MATLAB Applications


Communication systems

Fig 27: Usage in communications Communications systems products from MathWorks work with MATLAB and Simulink to provide an open, extensible design and simulation environment, with links to third party hardware and software cosimulation targets for verifying C/C++ and HDL software.

Control systems :

56

Design, test, and implement control systems MathWorks tools for control design support each stage of the development process, from plant modeling to deployment through automatic code generation. Their widespread adoption among control engineers around the world comes from the flexibility of the tools to accommodate different types of control problems. If your control problem is unique, you can create a custom tool or algorithm using MATLAB.

Digital Signal Processing (DSP) Analyze signals, develop algorithms, and design DSP systems MathWorks signal processing products provide extensive tools and algorithm libraries that let you analyze, design, and simulate DSP systems in a fraction of the time it takes with traditional programming languages such as C and C++.

Fig 28 :Usage in DSP

Embedded Systems

Fig 29:Usage in Embedded systems


57

Model, simulate, implement, and verify embedded software and hardware


MathWorks products streamline the development of embedded software and hardware by providing a complete environment for modeling, analysis, simulation, and code generation. You can:
Verify designs before implementation and test Automatically generate code for prototyping and production Verify software and detect run-time errors before compiling or testing

Image and Video Processing

Fig 30 : Usage in image and video processing

Acquire, process, and analyze images and video for algorithm development and system design
Algorithm development is central to image and video processing because each situation is unique, and good solutions require multiple design iterations. MathWorks provides a comprehensive environment to gain insight into your image and video data, develop algorithms, and explore implementation tradeoffs.

58

CHAPTER 5 RESULTS
The main aim of the project is .To hide textual data in an audio file . To hide textual data in an image. So the results will be the displaying the secret message and the verification of the original cover files. 5.1 AUDIO STEGANOGRAPHY original wavefile

1 0.5 0 -0.5 -1

0.5

1.5

2.5

3.5

1 0.5 0 -0.5 -1

0.5

1.5

2.5

3.5

Stego waveform Fig 31 :Results of Audio steganography The output shown in the command window will be great your message have been successfully encoded
59

secmsg = Hello how are you ? your message have been successfully decoded 5.2 IMAGE STEGANOGRAPHY :

60

O in l img r a ae ig

ste n g p im g g o ra h a e

Fig 32: Results of Image steganography original text to be embedded embedded text ans =

61

vignan retrived text from the steg image rextxt = vignan

CHAPTER 6
62

CONCLUSIONS AND FUTURE ENHANCEMENT


6.1 PROJECT CONCLUSION
In this project, we have studied and implemented a complete working of the steganography in which the textual data is embedded in an audio file and an image inorder to transfer the secret message to the destination. The complete project is done with the help of the MATLAB. In this project we can use the audio file of any format and here we used the the file of .wav extension. In the same way we can use the image of different formats and here we used the .bmp format. Steganography is the technology in which the data can be transferred secretly.

6.2 FUTURE ENHANCEMENT


In the near future, the most important use of steganographic techniques will probably be lying in the field of digital watermarking. Content providers are eager to protect their copyrighted works against illegal distribution provide a way of tracking the owners of these materials. Steganography might also become limited under laws, since governments already claimed that criminals use these techniques to communicate. The possible use of steganography technique is as following: Hiding data on the network in case of a breach. Peer-to-peer private communications. Posting secret communications on the Web to avoid transmission. Embedding corrective audio or image data in case corrosion occurs from a poor connection or transmission.

63

APPENDIX
CODE AUDIO STEGANOGRAPHY
%auhide %Description: Steganography in wav file using lsb method %Date of creation :19 Nov 2009 %sample file:slam.wav [filename, pathname] = uigetfile('*.wav','Select a file'); subplot(2,1,1); [y, fs]=wavread('sms.wav'); sound(y, fs); plot(time, y); % Playback of the sound data (?????) % Plot the waveform w.r.t. time (?????????) time=(1:length(y))/fs; % Time vector on x-axis (??????)

%open a wav file for hidding text fid1=fopen([pathname filename],'r'); %first 40 bytes make wav header,store the header header=fread(fid1,40,'uint8=>char'); %41st byte to 43rd byte,length of wav data samples data_size=fread(fid1,1,'uint32'); %copy the 16 bit wav data samples starting from 44th byte [dta,count]=fread(fid1,inf,'uint16'); %close the file only wav data samples are sufficient to hide the text fclose(fid1); lsb=1;

64

%%%%%%%%%%%%%%%%%%%%%%%%%%% msg='GOOD MORNING'; %%5 %%%%%%%%%%%%%%%%%%%%%%%%%%% %run aurecover.m to recover this message from new2.wav file %text message %%%%%%%%%%%%%%%%%%%

msg_double=double(msg); [m,n]=size(msg_bin); vector m_bin=de2bi(m,10)'; n_bin=de2bi(n,10)'; len=length(msg_bin_re); %len=m*n len_bin=de2bi(len,20)';

%convert it to double %size of message binary

msg_bin=de2bi(msg_double,8); %then convert message to binary msg_bin_re=reshape(msg_bin,m*n,1); %reshape the message binary in a column

%length of message binary

%convert the length to binary

%hide identity in first 8 wav data samples. identity=[1 0 1 0 1 0 1 0]'; dta(1:8)=bitset(dta(1:8),lsb,identity(1:8)); %hide binary length of message from 9th to 28 th sample dta(9:18)=bitset(dta(9:18),lsb,m_bin(1:10)); dta(19:28)=bitset(dta(19:28),lsb,n_bin(1:10)); %hide the message binary starting from 29th position of wave data samples dta(29:28+len)=bitset(dta(29:28+len),lsb,msg_bin(1:len)'); %open a new wav file in write mode fid2=fopen('sms.wav','w');

65

%copy the header of original wave file fwrite(fid2,header,'uint8'); fwrite(fid2,data_size,'uint32'); %copy the wav data samples with hidden text fwrite(fid2,dta,'uint16'); fclose(fid2); display('great your message have been successfully encoded'); subplot(2,1,2); [y, fs]=wavread('sms.wav'); sound(y, fs); plot(time, y); % Playback of the sound data (?????) % Plot the waveform w.r.t. time (?????????) time=(1:length(y))/fs; % Time vector on x-axis (??????)

%aurecover %Description: Steganography in wav file using lsb method %Date of creation :19 Nov 2009 %sample file:slam.wav [filename, pathname] = uigetfile('*.wav','Select a file');

%open the file with hidden text fid1=fopen([pathname filename],'r'); header=fread(fid1,40,'uint8=>char'); data_size=fread(fid1,1,'uint32'); %read the wave data samples [dta,count]=fread(fid1,inf,'uint16'); %close the file,only wav data samples are sufficient for extracting the text ans=fclose(fid1); lsb=1;
66

identity=bitget(dta(1:8),lsb)'; if identity==[1 0 1 0 1 0 1 0] %extract the length of text from first 9th to 28th wav data samples len_bin=zeros(20,1); m_bin=zeros(10,1); n_bin=zeros(10,1); m_bin(1:10)=bitget(dta(9:18),lsb); n_bin(1:10)=bitget(dta(19:28),lsb); %convert the length to decimal %len=bi2de((len_bin)'); len=bi2de(m_bin')*bi2de(n_bin');

secmsg_bin=zeros(len,1); %extract the lsb from wave data sample secmsg_bin(1:len)=bitget(dta(29:28+len),lsb); secmsg_bin_re=reshape(secmsg_bin,len/8,8); secmsg_double=bi2de(secmsg_bin_re); %convert it to decimal secmsg=char(secmsg_double)' %convert to char(ASCII) display('your message have been successfully decoded'); else display('there is no secret message'); end

67

IMAGE STEGANOGRAPHY
% I=imread('rep.bmp');%%read an image I=uigetfile('.bmp','select the image'); I=imread(I); b=1; disp('original text to be embedded'); %txt=textread('message.txt','%c','whitespace',''); fid=fopen('message.txt'); A=fread(fid,'schar'); fclose(fid); A1=char(A); disp('embedded text'); txt=A1; txt' N=8*numel(txt); S=numel(I); if N>S warning('Text truncated to be with in size of image');%if text size is more than the image size %process block segmentation% txt=txt(1:floor(s/8)); N=8*numel(txt); end %initializing the totalizing the total no., of bits for the text and the image p=2^b; h=2^(b-1); I1=reshape(I,1,S); addl=S-N; dim=size(I); I2=round(abs(I1(1:N))); %take the complexity of each block
68

%to find out the total no.,of elements for the text %total no., of elements of an image

%dividing into 8*8 blocks for the text

%resize the elements for the new image size

%figure,imshow(I1,'trye size'); %take the differences of the elements for the image and the text

si=sign(I1(1:N)); for k=1:N if si(k)==0 si(k)=1; end I2(k)=round(I2(k)); if mod((I2(k)),p)>=h I2(k)=I2(k)-h; end end bt=dec2bin(txt,8);%%%%%% bint=reshape(bt,1,N); d=h*48; bi=(h*bint)-d; %remove the complexity blocks of the image and replace with the non complexity blocks of image I3=double(I2)+bi; binadd=[bi zeros(1,addl)]; I4=double(si).*double(I3); I5=[I4 I1(N+1:S)]; int1=reshape(I5,dim); %resize the image and display the stego contents %return% figure,imshow(I);title('Original image'); figure,imshow(int1);title('stegnograph image'); I=im2bw(I); %%% decoding %%%%%%%%%%%%% siz=length(txt); bsiz=8*siz; n=numel(int1); if bsiz>n error('Size of text given exceeds the maximum that can be embedded in the image'); return end dim=size(int1); addl=n-bsiz;
69

%replacement of the bits for the complexity blocks

I1=reshape(int1,1,n); I2=round(abs(I1(1:bsiz))); p=2^b; h=2^(b-1); rb=zeros(1,bsiz); for k=1:bsiz; I2(k)=round(I2(k)); r=rem(I2(k),p); if r>=h rb(k)=1; end end rbi=(dec2bin(rb,1))'; rbin=reshape(rbi,siz,8); rectxt=(bin2dec(rbin))'; disp('retrived text from the steg image'); rextxt=char(rectxt)

70

REFERENCES

https://mail-attachment.googleusercontent.com/attachment/? ui=2&ik=dc3c7bb8f6&view=att&th=13648695ee8b3717&attid=0.1&disp=safe &realattid=file0&zw&saduie=AG9B_P8r8_NCVI_qSi2W1ny9aHGK&sadet=1 332677698167&sads=1sN9N_8PyGIpPSHlSlkpbk1YgQ0

http://seminarprojects.com/attachment.php?aid=15651

https://mail-attachment.googleusercontent.com/attachment/? ui=2&ik=dc3c7bb8f6&view=att&th=136338f7b6e51075&attid=0.1&disp=safe &realattid=f_h01vux460&zw&saduie=AG9B_P8r8_NCVI_qSi2W1ny9aHGK &sadet=1332318997475&sads=WgvEXAVgiqEOiKmey5eoOV9Voco&sadssc =1

http://www.google.co.in/#hl=en&output=search&sclient=psy-

ab&q=future+scope+of+image+steganography&oq=Future+scope+of+st&aq=4 b&aqi=g2g-v1g-j1gb1&aql=&gs_l=hp.3.4.0l2j0i15j0i18j0i8.1660884l1969614l1l1973781l27l27l4l 9l9l0l306l2279l0j12j1j1l14l0.frgbld.&psj=1&bav=on.2,or.r_gc.r_pw.r_qf.,cf.os b&fp=d44fb0c9cad92aea&biw=1280&bih=709


Wayner,

Peter

(2002). Disappearing & watermarking.

cryptography: Amsterdam:

information

hiding:

steganography

MK/Morgan

Kaufmann

Publishers. ISBN 1-55860-769-2.


Wayner, Peter (2009). Disappearing cryptography 3rd Edition: information

hiding: steganography & watermarking. Amsterdam: MK/Morgan Kaufmann Publishers. ISBN 978-0123744791.
Petitcolas, Fabian A.P.; Katzenbeisser, Stefan (2000). Information Hiding

Techniques for Steganography and Digital Watermarking. Artech House Publishers. ISBN 1-58053-035-4.
Johnson, Neil; Duric, Zoran; Jajodia, Sushil (2001). Information hiding:

steganography

and

watermarking:

attacks

and

countermeasures.

Springer. ISBN 978-0-7923-7204-2.

71

BIBLIOGRAPHY
FilterFirst (LSB) algorithm: Kurak, C., McHugh J.: "A cautionary note on image downgrading". Computer Security Applications Conference. San Antonio, USA, 1992.

SLSB algorithm and Roque filter: Roque, J. J., Minguet, J.: "SLSB: improving the steganographic algorithm LSB". V Congreso Iberoamericano de Seguridad Informtica CIBSI'09. Montevideo, Uruguay, 2009.

Roberts filter: Roberts, L. G.: "Machine perception of three-dimensional solids". Optical and Electro-optical Information Processing, MIT Press, Cambridge, 1965.

Laplace filter: Ziou, D., Tabbone, S.: "Edge detection techniques - An overview". International Journal of Pattern Recognition and Image Analysis, vol. 8, 1998.

Prewitt filter :Prewitt, J. M. S.: "Object enhancement and extraction". Picture Analysis and Psychopictorics. B.S. Lipkin & A. Rosenfeld Eds., Academic Press, New York, 1970.

Sobel filter :Sobel, I.: "Neighborhood coding of binary images for fast contour following and general array binary processing". Computer Graphics Image Process, vol. 8, 1978.

Frei-Chen filter: Frei, W., Chen, C.: "Fast boundary detection: A generalization and a new algorithm". IEEE Transactions on Computers, vol. 26, 1977.
72

RS analysis: Fridrich, J., Goljan, M., Du, R.: "Reliable detection of LSB steganography in color and grayscale images". ACM Workshop on Multimedia and Security, 2001.

73

You might also like