You are on page 1of 65

Security Proficient Tool for Text File

ABSTRACT

This Project Titled Security Proficient Tool for Text File is the software developed for hiding information which uses the technology called as Steganography derived from the Gree words meaning! "overed writing! is the art of hiding information in ways that prevent its detection# $t is a method a in to covert channels! and invisi%le lin s! which add another step in security# & message in cipher text may arouse suspicion while an invisi%le message is not# 'igital stenography uses a host data or message nown as a "ontainer or "over to hide another data or message in it# The conventional way of protecting information was to use a standard symmetric or asymmetric ey system in encryption# Steganography can also %e used to place a hidden trademar in images! music! and software! a techni(ue referred to as watermar ing# To ensure the privacy of the communication %etween two parties! various new methods are %eing developed# "ryptography %eing the mother to all those projects# )owever! cryptography is li e a tool! it can do as well as it is programmed to do# &lso! there are various different techni(ues that can %e implemented to attain a certain level of security# )ere we implement a techni(ue for data hiding in audio images! nown as &udio file Steganography# First the audio file which %ehaves as carrier file is selected# Then a message or a text file to %e em%edded in audio is selected# Then a ey file is selected# The ey file contains characters whose &S"$$ values are ta en for encryption# Then the file is em%edded in audio using low %it encoding mechanism and extraction of em%edded message is %eing done vice* versa#

TABLE OF CONTENTS CHAPTER NO TITLE PAGE NO

&,ST-&"T +# $.T-/'0"T$/. +#+ &,/0T T)1 /-G&.$2&T$/. +#3 3# P-/41"T '1S"-$PT$/.

S5ST16 ST0'5 3#+ F1&S&,$7$T5 ST0'5 3#3 18$ST$.G S5ST16 3#9 P-/P/S1' S5ST16

S5ST16 SP1"$F$"&T$/. 9#+ S/FT:&-1 -1;0$-161.TS 9#3 )&-':&-1 -1;0$-161.TS

<

7&.G0&G1 SP1"$F$"&T$/. <#+ F1&T0-1S /F &SP#.1T <#3 F1&T0-1S /F S;7 S1-=1- 3>>>

S5ST16 '1S$G. ?#+ $.P0T '1S$G. ?#3 /0TP0T '1S$G. ?#9 '&T&,&S1 '1S$G. ?#< '&T& F7/: '$&G-&6 ?#? S5ST1. F7/: '$&G-&6

S5ST16 T1ST$.G &.' 6&$.T1.&."1 @#+ 0.$T T1ST$.G

@#3 $.T1G-&T$/. T1ST$.G @#9 =&7$'&T$/. T1ST$.G A S5ST16 $6P7161.T&T$/. A#+ S"/P1 F/- F0T0-1 '1=17/P61.T B C "/."70S$/. ,$,7$/G-&P)5 &PP1.'$8 S"-11. S)/T '&T& T&,71 ST-0"T0-1 S&6P71 "/'$.G

LIST OF ABBREVIATIONS )T67 ')T67 "G$ &SP "TS "7867 S;7 "7S $7 &'/ "/6 $$S 0-7 4SP D D D D D D D D D D D D D D D )yper Text 6ar up 7anguage 'ynamic )yper Text 6ar up 7anguage "ommon Gateway $nterface &ctive Server Pages "ommon Type System "ommon 7anguage -untime 1xtended 6ar up 7anguage Structured ;uery 7anguage "ommon 7anguage Specification $ntermediate 7anguage &ctive8 'ata /%ject "omponent /%ject 6odel $nternet $nformation Server 0niform -esource 7ocator 4ava Server Pac age

<

1. INTRO !CTION
1.1 ABO!T THE ORGANISATION

CO"PAN# PROFILE &t .int Technologies! :e go %eyond providing software solutions# :e wor with our clientEs technologies and %usiness changes that shape their competitive advantages# Founded in 3>>>! .int Technologies FPG 7td# is a software and service provider that helps organiHations deploy! manage! and support their %usiness*critical software more effectively# 0tiliHing a com%ination of proprietary software! services and specialiHed expertise! .int Technologies FPG 7td# helps mid*to*large enterprises! software companies and $T service providers improve consistency! speed! and transparency with service delivery at lower costs# .int Technologies FPG 7td# helps companies avoid many of the delays! costs and ris s associated with the distri%ution and support of software on des tops! servers and remote devices# /ur automated solutions include rapid! touch*free deployments! ongoing software upgrades! fixes and security patches! technology asset inventory and trac ing! software license optimiHation! application self*healing and policy management# &t .int Technologies! we go %eyond providing software solutions# :e wor technologies and %usiness processes that shape their with our clientsE advantages# competitive

A$out T%e Peo&le &s a team we have the prowess to have a clear vision and realiHe it too# &s a statistical evaluation! the team has more than <>!>>> hours of expertise in providing real*time solutions in the fields of 1m%edded Systems! "ontrol systems! 6icro*"ontrollers! c ,ased $nterfacing! Programma%le 7ogic "ontroller! =7S$ 'esign &nd $mplementation! .etwor ing :ith "! II! java! client Server Technologies in 4ava!F4311J4361J43S1J14,G!=, K ="II! /racle and operating system concepts with 7$.08#

Our Vi'ion 'reaming a vision is possi%le and realiHing it is our goal# Our "i''ion :e have achieved this %y creating and perfecting processes that are in par with the glo%al standards and we deliver high (uality! high value services! relia%le and cost effective $T products to clients around the world#

1.( PRO)ECT ESCRIPTION* AI" OF THE PRO)ECT* :e are of the %elief that the easiest way to eep something from prying eyes is to place it right in front of the person loo ing for it and ma e it loo as innocuous as possi%le# 1veryone has a taste for a certain ind of music# )ence! it is more than li ely that the person will have that ind of music on the storage device of his computer# &lso! it is (uite common case where people share and transfer different music files to one another# $f one were a%le to hide the message can %e# &lso! transfer of this message can %e done (uite conveniently without raising any eye%rows# /ur aim is to come up with a techni(ue of hiding the message in the audio file in such a way! that there would %e no perceiva%le changes in the in the audio file after the message insertion# &t the same time! if the message that is to %e hidden were encrypted! the level of security would %e raised to (uite a satisfactory level# .ow! even if the hidden message were to %e discovered the person trying to get the message would only %e a%le to lay his hands on the encrypted message with no way of %eing a%le to decrypt it# STEGANOGRAPH# IN A! IO* 'ata hiding in audio signals is especially challenging! %ecause the )uman &uditory System F)&SG operates over a wide dynamic range# The )&S perceives over a range of power greater than one %illion to one and a range of fre(uencies greater than thousand to one# Sensitivity to additive random noise is also acute# The pertur%ations in a sound file can %e detected as low as one part in ten million which is B>d, %elow am%ient level# )owever there are some LholesE availa%le# :hile the )&S has a large dynamic range! it has a fairly small differential range# &s a result! loud sounds tend to mas out the (uieter sounds# &dditionally! the )&S is una%le to perceive a%solute phase! only relative phase# Finally there are some environmental distortions so common as to %e ignored %y the listener in most cases#

Lo+,$it enco-in.* 7ow*%it encoding is the one of the simplest way to em%ed data into other data structures# ,y replacing the least significant %it of each sampling point %y a coded %inary string! we can encode a large amount of data in an audio signal# $deally! the channel capacity is + % per second F %psG per + ilohertHF )HG! e#g#! in a noiseless channel! the %it rate will %e B %ps in an B )H sampled se(uence and << %ps in a << )H sampled se(uence# $n return for this large channel capacity! audi%le noise is introduced# The impact of this noise is a direct function of the content of the host signal! e#g#! crowd noise during a live sports event would mas low*%it encoding noise that would %e audi%le in a string (uartet performance# &daptive data attenuation has %een used to compensate this variation# The major advantage of this method is its poor immunity to manipulation# 1ncoded information can %e destroyed %y channel noise! re*sampling! etc#! unless it is encoded using redundancy techni(ues# $n order to %e ro%ust! these techni(ues reduce the data rate which could result in the re(uirement of a host of higher magnitude! often %y one to two orders of magnitude# $n practice! this method is useful only in closed! digital*to*digital environments#

F$G0-1 +#> B

PRO)ECT ESCRIPTION* 'ata hiding and extracting from an audio file is done in two main modules# 1m%ed module# 1xtract module#

E/$e- /o-uleFTo em%ed the text file into the audio fileG $n this module! the first step is selecting an input audio file # The selction is made through opening a new dialog %ox and the path selected is displayed through a text%ox# The second step is selecting an output audio file in which text data or a text file is em%edded# The third step is choosing a text file or typing any text message for em%edding#fourth step is selecting a ey file# $n the fifth step what ever the files that we have selected are viewed and verification of the path is done# $n the sixth process data is em%edded in to the audio file using low %it encoding techni(ue# &fter em%edding the content %oth the audio files are played and a listener cannot find any difference %etween the audios# Extr0ct /o-uleFTo extract the text file from the audio fileG $n this module! the first step is the process of selecting the encrypted audio file# This is the file !that a user has to extract information from the output audio# second process involved in selecting a new text file to display the em%edded meassage#Symmetric encryption method is used here! so the ey selected during the em%edding process is used in decrypting the message#&ll the process done till now are displayed using a list %ox and finally the em%edded message can %e viewed with the help of a file or in a text%ox#

(. S#STE" ST! #

(.1 FEASIBILIT# ST! #* The feasi%ility of the project is analyHed in this phase and %usiness proposal is put forth with a very general plan for the project and some cost estimates# 'uring system analysis the feasi%ility study of the proposed system is to %e carried out# This is to ensure that the proposed system is not a %urden to the company# For feasi%ility analysis! some understanding of the major re(uirements for the system is essential# Three ey considerations involved in the feasi%ility analysis are MG 1"/./6$"&7 F1&S$,$7$T5 MG T1").$"&7 F1&S$,$7$T5 MG S/"$&7 F1&S$,$7$T5 (.1.1 ECONO"ICAL FEASIBILIT#* This study is carried out to chec the economic impact that the system will have on the organiHation# The amount of found that the company can pour into the research and development of the system is limited# The expenditures must %e justified# Thus the developed system as well within the %udget and this was achieved %ecause most of the technologies used are freely availa%le# /nly the customiHed products had to %e purchased# (.1.( TECHNICAL FEASIBILIT#* This study is carried out to chec the technical feasi%ility! that is! the technical re(uirements of the system# &ny system developed must not have a high demand on the availa%le technical resources# This will lead to high demands on the availa%le technical resources# This will lead to high demands %eing placed on the client# The developed system must have a modest re(uirement! as only minimal or null changes are re(uired for implementing this system#

+>

(.1.1 SOCIAL FEASIBILIT#* The aspect of study is to chec the level of acceptance of the system %y the user# This includes the process of training the user to use the system efficiently# The user must not feel threatened %y the system! instead must accept it as a necessity# The level of acceptance %y the users solely depends on the methods that are employed to educate the user a%out the system and to ma e him familiar with it# )is level of confidence must %e raised so that he is also a%le to ma e some constructive criticism! which is welcomed! as he is the final user of the system#

(.( E2ISTING S#STE"* .owadays! several methods are used for communicating secret messages for defense purposes or in order to ensure the privacy of communication %etween two parties# So we go for hiding information in ways that prevent its detection# Some of the methods used for privacy communication are the use of invisi%le lin s! covert channels are some of existing systems that are used to convey the messages# (.( PROPOSE S#STE"* The proposed system uses &udio file as a carrier medium which add another step in security# The o%jective of the newly proposed system is to create a system that ma es it very difficult for an opponent to detect the existence of a secret message %y encoding it in the carrier medium as a function of some secret ey and that remains as the advantage of this system

++

1. S#STE" SPECIFICATION
1.1 SOFT3ARE SPECIFICATION*, /P1-&T$.G S5ST16 F-/.T 1.' "/'$.G 7&.G0&G1 D :indows 8P sp9 Professional D 6icrosoft =isual Studio #.et 3>+> D "N #.et

1.( HAR 3ARE SPECIFICATION*, S5ST16 )&-' '$SO F7/PP5 '-$=1 6/.$T/6/0S1 -&6 D Pentium $= processor D <> G, D +#<< 6, D +? =G& colour monitor D 7ogitech# D ?+3 6,#

+3

4. LANGA!GE SPECIFICATION
4.1 SOFT3ARE SPECIFICATION 3%0t i' .NET5 :hen #.1T was announced in late +CCC! 6icrosoft positioned the technology as a platform for %uilding and consuming 1xtensi%le 6ar up 7anguage F867G :e% services# 867 :e% services allow any type of application! %e it a :indows* or %rowser*%ased application running on any type of computer system! to consume data from any type of server over the $nternet# The reason this idea is so great is the way in which the 867 messages are transferredD over esta%lished standard protocols that exist today# 0sing protocols such as S/&P! )TTP! and S6TP! 867 :e% services ma e it possi%le to expose data over the wire with little or no modifications to your existing code# Figure +#+ presents a high*level overview of the #.1T Framewor and how 867 :e% services are positioned#

+9

Fi.ure 1.1. St0tele'' 2"L 3e$ 'er6ice' /o-el.

Since the initial announcement of the #.1T Framewor ! itPs ta en on many new and different meanings to different people# To a developer! #.1T means a great environment for creating ro%ust distri%uted applications# To an $T manager! #.1T means simpler deployment of applications to end users! tighter security! and simpler management# To a "T/ or "$/! #.1T means happier developers using state*of*the*art development technologies and a smaller %ottom line# To understand why all these statements are true! you need to get a grip on what the #.1T Framewor consists of! and how itPs truly a revolutionary step forward for application architecture! development! and deployment# NET Fr0/e+or7 .ow that you are familiar with the major goals of the #.1T Framewor ! letPs %riefly examine its architecture# &s you can see in Figure +*3! the #.1T Framewor sits on top of the

+<

operating system! which can %e a few different flavors of :indows and consists of a num%er of components #.1T is essentially a system application that runs on :indows#

"onceptually! the "7- and the 4=6 are similar in that they are %oth runtime infrastructures that a%stract the underlying platform differences# )owever! while the 4=6 officially supports only the 4ava language! the "7- supports any language that can %e represented in its "ommon $ntermediate 7anguage F"$7G# The 4=6 executes %ytecode! so it can! in principle! support many languages! too# 0nli e 4avaPs %ytecode! though! "$7 is never interpreted# &nother conceptual difference %etween the two infrastructures is that 4ava code runs on any platform with a 4=6! whereas #.1T code runs only on platforms that support the "7-# $n &pril! 3>>9! the $nternational /rganiHation for StandardiHation and the $nternational 1lectrotechnical "ommittee F$S/Q$1"G recogniHed a functional su%set of the "7-! nown as the "ommon 7anguage $nterface F"7$G! as an international standard# This development! initiated %y 6icrosoft and developed %y 1"6& $nternational! a 1uropean standards organiHation! opens the way for third parties to implement their own versions of the "7- on other platforms! such as 7inux or 6ac /S 8# For information on third*party and open source projects wor ing to implement the $S/Q$1" "7$ and "N specifications The layer on top of the "7- is a set of framewor %ase classes# This set of classes is similar to the set of classes found in ST7! 6F"! &T7! or 4ava# These classes support rudimentary input and output functionality! string manipulation! security management! networ communications! thread management! text management! reflection functionality! collections functionality! as well as other functions#

+?

/n top of the framewor %ase classes is a set of classes that extend the %ase classes to support data management and 867 manipulation# These classes! called &'/#.1T! support persistent data managementRdata that is stored on %ac end data%ases# &longside the data classes! the #.1T Framewor supports a num%er of classes to let you manipulate 867 data and perform 867 searching and 867 translations# "lasses in three different technologies Fincluding we% services! :e% Forms! and :indows FormsG extend the framewor %ase classes and the data and 867 classes# :e% services include a num%er of classes that support the development of lightweight distri%uted components! which wor even in the face of firewalls and .&T software# These components support plug*and*play across the $nternet! %ecause we% services employ standard )TTP and S/&P# :e% Forms! the ey technology %ehind &SP#.1T! include a num%er of classes that allow you to rapidly develop we% Graphical 0ser $nterface FG0$G applications# $f youPre currently developing we% applications with =isual $nterdev! you can thin of :e% Forms as a facility that allows you to develop we% G0$s using the same drag*and*drop approach as if you were developing the G0$s in =isual ,asic# Simply drag*and*drop controls onto your :e% Form! dou%le*clic on a control! and write the code to respond to the associated event# :indows Forms support a set of classes that allow you to develop native :indows G0$ applications# 5ou can thin of these classes collectively as a much %etter version of the 6F" in "II %ecause they support easier and more powerful G0$ development and provide a common! consistent interface that can %e used in all languages# T%e Co//on L0n.u0.e Runti/e &t the heart of the #.1T Framewor is the common language runtime# The common language runtime is responsi%le for providing the execution environment that code written in a #.1T language runs under# The common language runtime can %e compared to the =isual ,asic @ runtime! except that the common language runtime is designed to handle all #.1T languages! not just one! as the =isual ,asic @ runtime did for =isual ,asic @# The following list descri%es some of the %enefits the common language runtime gives youD

+@

&utomatic memory management "ross*language de%ugging "ross*language exception handling Full support for component versioning &ccess to legacy "/6 components 8"/P5 deployment -o%ust security model

5ou might expect all those features! %ut this has never %een possi%le using 6icrosoft development tools# Figure +#9 shows where the common language runtime fits into the #.1T Framewor # Figure 1.3. The common language runtime and the .NET Framework.

.ote "ode written using a #.1T language is nown as managed code# "ode that uses anything %ut the common language runtime is nown as unmanaged code# The common language runtime

+A

provides a managed execution environment for #.1T code! whereas the individual runtimes of non*#.1T languages provide an unmanaged execution environment# In'i-e t%e Co//on L0n.u0.e Runti/e The common language runtime ena%les code running in its execution environment to have features such as security! versioning! memory management and exception handling %ecause of the way #.1T code actually executes# :hen you compiled =isual ,asic @ forms applications! you had the a%ility to compile down to native node or p*code# Figure +#< should refresh your memory of what the =isual ,asic @ options dialog loo ed li e# Figure +#<# =isual ,asic @ compiler options dialog#

:hen you compile your applications in #.1T! you arenPt creating anything in native code# :hen you compile in #.1T! youPre converting your codeRno matter what #.1T language youPre usingRinto an assem%ly made up of an intermediate language called 6icrosoft $ntermediate 7anguage F6S$7 or just $7! for shortG# The $7 contains all the information a%out your application! including methods! properties! events! types! exceptions! security o%jects! and so on! and it also includes metadata a%out what types in your code can or cannot %e exposed to other applications# This was called a type li%rary in =isual ,asic @ or an $'7 Finterface definition languageG file in "II# $n #.1T! itPs simply the metadata that the $7 contains a%out your assem%ly#

+B

.ote The file format for the $7 is nown as P1 Fporta%le executa%leG format! which is a standard format for processor*specific execution# :hen a user or another component executes your code! a process occurs called just*in*time F4$TG compilation! and itPs at this point that the $7 is converted into the specific machine language of the processor itPs executing on# This ma es it very easy to port a #.1T application to any type of operating system on any type of processor %ecause the $7 is simply waiting to %e consumed %y a 4$T compiler# .ote The first time an assem%ly is called in #.1T! the 4$T process occurs# Su%se(uent calls donPt re*4$T the $7S the previously 4$Tted $7 remains in cache and is used over and over again# when you learn a%out &pplication "enter Test! you also see how the warm*up time of the 4$T process can affect application performance#

0nderstanding the process of compilation in #.1T is very important %ecause it ma es clear how features such as cross*language de%ugging and exception handling are possi%le# 5ouPre not actually compiling to any machine*specific codeRyouPre simply compiling down to an intermediate language thatPs the same for all #.1T languages# The $7 produced %y 4N #.1T and "N loo s just li e the $7 created %y the =isual ,asic #.1T compiler# These instructions are the same! only how you type them in =isual Studio #.1T is different! and the power of the common language runtime is apparent# :hen the $7 code is 4$Tted into machine*specific language! it does so on an as*needed %asis# $f your assem%ly is +>6, and the user is only using a fraction of that +>6,! only the re(uired $7 and its dependencies are compiled to machine language# This ma es for a very efficient execution process# ,ut during this execution! how does the common language runtime ma e sure that the $7 is correctT ,ecause the compiler for each language creates its own $7! there must %e a process that ma es sure whatPs compiling wonPt corrupt the system# The process that validates the $7 is nown as verification# Figure +#? demonstrates the process the $7 goes through %efore the code actually executes#

+C

Figure 1.5. The JIT process and verification.

:hen code is 4$T compiled! the common language runtime chec s to ma e sure that the $7 is correct# The rules that the common language runtime uses for verification are set forth in the "ommon 7anguage Specification F"7SG and the "ommon Type System F"TSG# T%e .NET Fr0/e+or7 Cl0'' Li$r0ry The second most important piece of the #.1T Framewor is the #.1T Framewor class li%rary FF"7G# &s youPve seen! the common language runtime handles the dirty wor of actually running the code you write# ,ut to write the code! you need a foundation of availa%le classes to access the resources of the operating system! data%ase server! or file server# The F"7 is made up of a hierarchy of namespaces that expose classes! structures! interfaces! enumerations! and delegates that give you access to these resources#

3>

The namespaces are logically defined %y functionality# For example! the System#'ata namespace contains all the functionality availa%le to accessing data%ases# This namespace is further %ro en down into System#'ata#S(l"lient! which exposes functionality specific to S;7 Server! and System#'ata#/le'%! which exposes specific functionality for accessing /71', data sources# The %ounds of a namespace arenPt necessarily defined %y specific assem%lies within the F"7S rather! theyPre focused on functionality and logical grouping# $n total! there are more than 3>!>>> classes in the F"7! all logically grouped in a hierarchical manner# Figure +#B shows where the F"7 fits into the #.1T Framewor and the logical grouping of namespaces# Figure 1. . The .NET Framework class li!rar".

To use an F"7 class in your application! you use the $mports statement in =isual ,asic #.1T or the using statement in "N# :hen you reference a namespace in =isual ,asic #.1T or "N! you also get the convenience of auto*complete and auto*list mem%ers when you access the o%jectsP types using =isual Studio #.1T# This ma es it very easy to determine what types are availa%le for each class in the namespace youPre using# &s youPll see over the next several wee s! itPs very easy to start coding in =isual Studio #.1T# T%e Structure of 0 .NET A&&lic0tion

3+

To understand how the common language runtime manages code execution! you must examine the structure of a #.1T application# The primary unit of a #.1T application is the assem%ly# &n assem%ly is a self*descri%ing collection of code! resources! and metadata# The assem%ly manifest contains information a%out what is contained within the assem%ly# The assem%ly manifest providesD

$dentity information! such as the assem%lyEs name and version num%er & list of all types exposed %y the assem%ly & list of other assem%lies re(uired %y the assem%ly & list of code access security instructions! including permissions re(uired %y the assem%ly and permissions to %e denied the assem%ly

1ach assem%ly has one and only one assem%ly manifest! and it contains all the description information for the assem%ly# )owever! the assem%ly manifest can %e contained in its own file or within one of the assem%lyEs modules# &n assem%ly contains one or more modules# & module contains the code that ma es up your application or li%rary! and it contains metadata that descri%es that code# :hen you compile a project into an assem%ly! your code is converted from high*level code to $7# ,ecause all managed code is first converted to $7 code! applications written in different languages can easily interact# For example! one developer might write an application in =isual "N that accesses a '77 in =isual ,asic #.1T# ,oth resources will %e converted to $7 modules %efore %eing executed! thus avoiding any language*incompati%ility issues# 1ach module also contains a num%er of types# Types are templates that descri%e a set of data encapsulation and functionality# There are two inds of typesD reference types FclassesG and value types FstructuresG# These types are discussed in greater detail in 7esson 3 of this chapter# 1ach type is descri%ed to the common language runtime in the assem%ly manifest# & type can contain fields! properties! and methods! each of which should %e related to a common functionality# For example! you might have a class that represents a %an account# $t contains fields! properties! and methods related to the functions needed to implement a %an account# & field represents storage of a particular type of data# /ne field might store the name of an account holder! for example# Properties are similar to fields! %ut properties usually

33

provide some ind of validation when data is set or retrieved# 5ou might have a property that represents an account %alance# :hen an attempt is made to change the value! the property can chec to see if the attempted change is greater than a predetermined limit# $f the value is greater than the limit! the property does not allow the change# 6ethods represent %ehavior! such as actions ta en on data stored within the class or changes to the user interface# "ontinuing with the %an account example! you might have a Transfer method that transfers a %alance from a chec ing account to a savings account! or an &lert method that warns users when their %alances fall %elow a predetermined level# Co/&il0tion 0n- Execution of 0 .NET A&&lic0tion :hen you compile a #.1T application! it is not compiled to %inary machine codeS rather! it is converted to $7# This is the form that your deployed application ta esRone or more assem%lies consisting of executa%le files and '77 files in $7 form# &t least one of these assem%lies will contain an executa%le file that has %een designated as the entry point for the application# :hen execution of your program %egins! the first assem%ly is loaded into memory# &t this point! the common language runtime examines the assem%ly manifest and determines the re(uirements to run the program# $t examines security permissions re(uested %y the assem%ly and compares them with the systemEs security policy# $f the systemEs security policy does not allow the re(uested permissions! the application will not run# $f the application passes the systemEs security policy! the common language runtime executes the code# $t creates a process for the application to run in and %egins application execution# :hen execution starts! the first %it of code that needs to %e executed is loaded into memory and compiled into native %inary code from $7 %y the common language runtimeEs 4ust*$n*Time F4$TG compiler# /nce compiled! the code is executed and stored in memory as native code# Thus! each portion of code is compiled only once when an application executes# :henever program execution %ranches to code that has not yet run! the 4$T compiler compiles it ahead of execution and stores it in memory as %inary code# This way! application performance is maximiHed %ecause only the parts of a program that are executed are compiled# The #.1T Framewor %ase class li%rary contains the %ase classes that provide many of the services and o%jects you need when writing your applications# The class li%rary is organiHed into namespaces# & namespace is a logical grouping of types that perform related functions# 39

For example! the System#:indows#Forms namespace contains all the types that ma e up :indows forms and the controls used in those forms# .amespaces are logical groupings of related classes# The namespaces in the #.1T %ase class li%rary are organiHed hierarchically# The root of the #.1T Framewor construction appears as followsD System System#'ata System#'ata#S;7"lient The first example refers to the System namespace# The second refers to the System#'ata namespace# The third example refers to the System#'ata#S;7"lient namespace# Ta%le +#+ introduces some of the more commonly used #.1T %ase class namespaces# Ta%le +*+# -epresentative #.1T .amespaces .amespace 'escription This namespace is the root for many of the low*level types re(uired System %y the #.1T Framewor # $t is the root for primitive data types as well! and it is the root for all the other namespaces in the #.1T %ase class li%rary# This namespace contains classes that represent a variety of different container types! such as &rray7ist! Sorted7ist! ;ueue! and System#"ollections Stac # 5ou also can find a%stract classes! such as "ollection,ase! which are useful for implementing your own collection functionality# This namespace contains classes involved in component creation System#"omponent6odel and containment! such as attri%utes! type converters! and license providers# This namespace contains classes re(uired for data%ase access and System#'ata manipulations! as well as additional namespaces used for data access# 3< is the System namespace# /ther namespaces can %e accessed with the period operator# & typical namespace

Ta%le +*+# -epresentative #.1T .amespaces .amespace System#'ata#"ommon 'escription This namespace contains a set of classes that are shared %y the #.1T managed data providers# This namespace contains classes that ma e up the managed data provider for /71 ', data access# This namespace contains classes that are optimiHed for interacting with 6icrosoft S;7 Server# This namespace exposes G'$I functionality and provides classes that facilitate graphics rendering# $n this namespace! you will find types for handling file system $Q/# This namespace is home to common mathematics functions such as extracting roots and trigonometry# This namespace provides support for o%taining information and dynamic creation of types at runtime# This namespace is home to types dealing with permissions! cryptography! and code access security# This namespace contains classes that facilitate the implementation of multithreaded applications# This namespace contains types involved in creating standard System#:indows#Forms :indows applications# "lasses that represent forms and controls reside here as well# The namespace names are self*descriptive %y design# Straightforward names ma e the #.1T Framewor easy to use and allow you to rapidly familiariHe yourself with its contents# Intro-uction to O$8ect,Oriente- Pro.r0//in. Programming in the #.1T Framewor environment is done with o%jects# /%jects are

System#'ata#/le'%

System#'ata#S;7"lient

System#'rawing System#$/ System#6ath

System#-eflection

System#Security

System#Threading

programmatic constructs that represent pac ages of related data and functionality# /%jects are

3?

self*contained and expose specific functionality to the rest of the application environment without detailing the inner wor ings of the o%ject itself# /%jects are created from a template called a class# The #.1T %ase class li%rary provides a set of classes from which you can create o%jects in your applications# 5ou also can use the 6icrosoft =isual Studio programming environment to create your own classes# This lesson introduces you to the concepts associated with o%ject*oriented programming# O$8ect'9 "e/$er'9 0n- A$'tr0ction &n o%ject is a programmatic construct that represents something# $n the real world! o%jects are cars! %icycles! laptop computers! and so on# 1ach of these items exposes specific functionality and has specific properties# $n your application! an o%ject might %e a form! a control such as a %utton! a data%ase connection! or any of a num%er of other constructs# 1ach o%ject is a complete functional unit! and contains all of the data and exposes all of the functionality re(uired to fulfill its purpose# The a%ility of programmatic o%jects to represent real*world o%jects is called a%straction# Cl0''e' Are Te/&l0te' for O$8ect' "lasses were discussed in "hapter + and represent user*defined reference types# "lasses can %e thought of as %lueprints for o%jectsD they define all of the mem%ers of an o%ject! define the %ehavior of an o%ject! and set initial values for data when appropriate# :hen a class is instantiated! an in*memory instance of that class is created# This instance is called an o%ject# To review! a class is instantiated using the .ew FnewG eyword as followsD =isual ,asic #.1T P 'eclares a varia%le of the :idget type 'im my:idget &s :idget P $nstantiates a new :idget o%ject and assigns it to the my:idget P varia%le my:idget U .ew :idgetFG :hen an instance of a class is created! a copy of the instance data defined %y that class is created in memory and assigned to the reference varia%le# $ndividual instances of a class are independent of one another and represent separate programmatic constructs# There is

3@

generally no limit to how many copies of a single class can %e instantiated at any time# To use a real*world analogy! if a car is an o%ject! the plans for the car are the class# The plans can %e used to ma e any num%er of cars! and changes to a single car do not! for the most part! affect any other cars# O$8ect' 0n- "e/$er' /%jects are composed of mem%ers# 6em%ers are properties! fields! methods! and events! and they represent the data and functionality that comprise the o%ject# Fields and properties represent data mem%ers of an o%ject# 6ethods are actions the o%ject can perform! and events are notifications an o%ject receives from or sends to other o%jects when activity happens in the application# To continue with the real*world example of a car! consider that a "ar o%ject has fields and properties! such as "olor! 6a e! 6odel! &ge! Gas7evel! and so on# These are the data that descri%e the state of the o%ject# & "ar o%ject might also expose several methods! such as &ccelerate! ShiftGears! or Turn# The methods represent %ehaviors the o%ject can execute# &nd events represent notifications# For example! a "ar o%ject might receive an 1ngine/verheating event from its 1ngine o%ject! or it might raise a "rash event when interacting with a Tree o%ject# O$8ect "o-el' Simple o%jects might consist of only a few properties! methods! and perhaps an event or two# 6ore complex o%jects might re(uire numerous properties and methods and possi%ly even su%ordinate o%jects# /%jects can contain and expose other o%jects as mem%ers# For example! the Text,ox control exposes a Font property! which consists of a Font o%ject# Similarly! every instance of the Form class contains and exposes a "ontrols collection that comprises all of the controls contained %y the form# The o%ject model defines the hierarchy of contained o%jects that form the structure of an o%ject# &n o%ject model is a hierarchical organiHation of su%ordinate o%jects contained and exposed within a main o%ject# To illustrate! letEs revisit the example of a car as an o%ject# & car is a single o%ject! %ut it also consists of su%ordinate o%jects# & "ar o%ject might contain an 1ngine o%ject! four :heel o%jects! a Transmission o%ject! and so on# The composition of

3A

these su%ordinate o%jects directly affects how the "ar o%ject functions as a whole# For example! if the "ylinders property of the 1ngine su%ordinate o%ject is e(ual to <! the "ar will %ehave differently than a "ar whose 1ngine has a "ylinders property value of B# "ontained o%jects can have su%ordinate o%jects of their own# For example! the contained 1ngine o%ject might contain several Spar Plug o%jects# Enc0&'ul0tion 1ncapsulation is the concept that implementation of an o%ject is independent of its interface# Put another way! an application interacts with an o%ject through its interface! which consists of its pu%lic properties and methods# &s long as this interface remains constant! the application can continue to interact with the component! even if implementation of the interface was completely rewritten %etween versions# /%jects should only interact with other o%jects through their pu%lic methods and properties# Thus! o%jects should contain all of the data they re(uire! as well as all of the functionality that wor s with that data# The internal data of an o%ject should never %e exposed in the interfaceS thus! fields rarely should %e Pu%lic Fpu%licG# -eturning to the "ar example# $f a "ar o%ject interacts with a 'river o%ject! the "ar interface might consist of a GoForward method! a Go,ac ward method! and a Stop method# This is all the information that the 'river needs to interact with the "ar# The "ar might contain an 1ngine o%ject! for example! %ut the 'river doesnEt need to now a%out the 1ngine o%jectRall the 'river cares a%out is that the methods can %e called and that they return the appropriate values# Thus! if one 1ngine o%ject is exchanged for another! it ma es no difference to the 'river as long as the interface continues to function correctly# Poly/or&%i'/ Polymorphism is the a%ility of different classes to provide different implementations of the same pu%lic interfaces# $n other words! polymorphism allows methods and properties of an o%ject to %e called without regard for the particular implementation of those mem%ers# For example! a 'river o%ject can interact with a "ar o%ject through the "ar pu%lic interface# $f another o%ject! such as a Truc o%ject or a Sports"ar o%ject! exposes the same pu%lic interface! the 'river o%ject can interact with them without regard to the specific

3B

implementation of that interface# There are two principal ways through which polymorphism can %e providedD interface polymorphism and inheritance polymorphism# Interf0ce Poly/or&%i'/ &n interface is a contract for %ehavior# 1ssentially! it defines the mem%ers a class should implement! %ut states nothing at all a%out the details of that implementation# &n o%ject can implement many different interfaces! and many diverse classes can implement the same interface# &ll o%jects implementing the same interface are capa%le of interacting with other o%jects through that interface# For example! the "ar o%ject in the previous examples might implement the $'riva%le interface F%y convention! interfaces usually %egin with $G! which specifies the GoForward! Go,ac ward! and )alt methods# /ther classes! such as Truc ! For lift! or ,oat might implement this interface and thus are a%le to interact with the 'river o%ject# The 'river o%ject is unaware of which interface implementation it is interacting withS it is only aware of the interface itself# $nterface polymorphism is discussed in detail in 7esson 9# In%erit0nce Poly/or&%i'/ $nheritance allows you to incorporate the functionality of a previously defined class into a new class and implement different mem%ers as needed# & class that inherits another class is said to derive from that class! or to inherit from that class# & class can directly inherit from only one class! which is called the %ase class# The new class has the same mem%ers as the %ase class! and additional mem%ers can %e added as needed# &dditionally! the implementation of %ase mem%ers can %e changed in the new class %y overriding the %ase class implementation# $nherited classes retain all the characteristics of the %ase class and can interact with other o%jects as though they were instances of the %ase class# For example! if the "ar class is the %ase class! a derived class might %e Sports"ar# The Sports"ar class might %e the %ase class for another derived class! the "onverti%leSports"ar# 1ach newly derived class might implement additional mem%ers! %ut the functionality defined in the original "ar class is retained# $nheritance polymorphism "icro'oft Vi'u0l B0'ic.Net

3C

:ith its release for the #.1T platform! the =isual ,asic language has undergone dramatic changes# For exampleD V V The language itself is now fully o%ject*oriented# &pplications and components written in =isual ,asic #.1T have full access to the #.1T Framewor ! an extensive class li%rary that provides system and application services# V &ll applications developed using =isual ,asic #.1T run within a managed runtime environment! the #.1T common language runtime# =isual ,asic #.1T is the next generation of =isual ,asic! %ut it is also a significant departure from previous generations# 1xperienced =isual ,asic @ developers will feel comforta%le with =isual ,asic #.1T code and will recogniHe most of its constructs# )owever! 6icrosoft has made some changes to ma e =isual ,asic #.1T a %etter language and an e(ual player in the #.1T world# These include such additions as a "lass eyword for defining classes and an $nherits eyword for o%ject inheritance! among others# =isual ,asic @ code canPt %e compiled %y the =isual ,asic #.1T compiler without significant modification# The good news is that 6icrosoft has provided a migration tool to handle the tas #

:. S#STE" ESIGN

'esign is multi*step process that focuses on data structure software architecture! procedural details! Falgorithms etc#G and interface %etween modules# The design process also translates the re(uirements into the presentation of software that can %e accessed for (uality %efore coding %egins# "omputer software design changes continuously as new methodsS %etter analysis and %roader understanding evolved# Software 'esign is at relatively early stage in its revolution#

9>

Therefore! Software 'esign methodology lac s the depth! flexi%ility and (uantitative nature that are normally associated with more classical engineering disciplines# )owever techni(ues for software designs do exist! criteria for design (ualities are availa%le and design notation can %e applied# :.1 INP!T ESIGN $nput design is the process of converting a user*oriented description of the inputs to a computer %ased %usiness system into a program*oriented specification# The o%jectives in the input designD To produce a cost*effective method of input# To achieve a highest possi%le level of accuracy# To ensure that input is accepta%le to and understood %y the user staff#

A! IO FILE FOR"AT* &n audio format is a medium for storing sound and music#$t is a container format for storing audio data on a computer system# There are numerous file formats for storing audio files# The general approach towards storing digital audio formats is to sample the audio voltage Fcorresponding to a certain position in the mem%rane of a spea erG in regular intervals Fe#g# <<!+>> times per second for "' audio or <B!>>> or C@!>>> times per second for '=' videoG and store the value with a certain resolution Fe#g# +@ %its per sample in "' audioG# Therefore sample rate! resolution and num%er of channels are ey parameters in audio file formats# T#PES OF FOR"ATS* There are three major groups of audio file formatsD +G "ommon formats! such as :&=! &$FF and &0# 3G Formats with lossless compression! such as F7&"! 6on eyEs &udio &udioF:6&G# 9G Formats with lossy compression! such as 6P9! =or%is! lossy :indows 6edia &udioF:6&G and &&"# Ffilename extension&P1G! :avPac ! Shorten! TT&! &pple 7ossless!and lossless :indows 6edia

9+

:&= is a flexi%le file format designed to store more or less any com%ination of sampling rates or %itrates# This ma es it an ade(uate file format for storing and archiving an original recording. 3AV FOR"AT* 3AV For 3AVEG! short for :aveform audio format! is a 6icrosoft and $,6 audio fileformat standard for storing audio on P"s # $t is a variant of the -$FF %itstream format method for storing data in Wchun sW# & :&=1 file is often just a -$FF file with a single W:&=1W chun which consists of two su%*chun s ** a Wfmt W chun specifying the data format and a WdataW chun containing the actual sample data#

FIG!RE 1.1 93

The canonical :&=1 format starts with the -$FF headerD > * < < C%un7I "ontains the letters W-$FFW in &S"$$ form 9@ I Su%"hun 3SiHe! or more preciselyD < I FB I Su%"hun +SiHeG I FB I Su%"hun 3SiHeG This is the siHe of the rest of the chun following this num%er# This is the siHe of the entire file in %ytes minus B %ytes for the two fields not included in this countD "hun $' and "hun SiHe# B * < For/0t "ontains the letters W:&=1W

* < C%un7Si;e

The W:&=1W format consists of two su%chun sD Wfmt W and WdataWD The Wfmt W su%chun descri%es the sound dataPs formatD +3 * +@ * < Su$c%un71I < Su$c%un71Si;e "ontains the letters Wfmt W +@ for P"6# This is the siHe of the rest of the Su%chun which follows this num%er# 3> * 3 Au-ioFor/0t P"6 U + Fi#e# 7inear (uantiHationG =alues other than + indicate some form of compression# 33 * 3< * 3B * 93 * 3 Nu/C%0nnel' < S0/&leR0te < ByteR0te 3 Bloc7Ali.n 6ono U +! Stereo U 3! etc# B>>>! <<+>>! etc# U Sample-ate M .o"hannels M ,itsPerSampleQB U .um"hannels M ,itsPerSampleQB The num%er of %ytes for one sample including all channels# 9< * 3 Bit'PerS0/&le B %its U B! +@ %its U +@! etc#

99

The WdataW su%chun contains the siHe of the data and the actual soundD 9@ * < Su$c%un7(I "ontains the letters WdataW This is the num%er of %ytes in the data# 5ou can also thin of this as the siHe of the read of the su%chun following this num%er# << M 0t0 The actual sound data#

<> * < Su$c%un7(Si;e U .oSamples M .o"hannelsM ,itsPerSampleQB

&s an example! here are the opening A3 %ytes of a :&=1 file with %ytes shown as hexadecimal num%ersD ?3 <C <@ <@ 3< >B >> >> ?A <+ ?@ <? @@ @d A< 3> +> >> >> >> >+ >> >3 >> 33 ?@ >> >> BB ?B >+ >> >< >> +> >> @< @+ A< @+ >> >B >> >> >> >> >> >> 3< +A +e f9 9c +9 9c +< +@ fC +B fC 9< eA 39 a@ 9c f3 3< f3 ++ ce +a >d )ere is the interpretation of these %ytes as a :&=1 soundfileD

9<

FIG!RE 1.( Though a :&= file can hold compressed audio! the most common :&= format contains uncompressed audio in the pulse*code modulation FP"6G format# P"6 audio is the standard audio file format for "'s at <<!+>> samples per second! +@ %its per sample# Since P"6 uses an uncompressed! lossless storage method! which eeps all the samples of an audio trac ! professional users or audio experts may use the :&= format for maximum audio (uality# :&= audio can also %e edited and manipulated with relative ease using software# The usage of the :&= format has more to do with its familiarity! its simplicity and simplestructure! which is heavily %ased on the $FF file format# ,ecause of this! it continues to enjoy widespread use with a variety of software applications# Li/it0tion'* The :&= format is limited to files that are less than < Gi, in siHe! due to its use of a 93 %it unsigned integer to record the file siHe header Fsome programs limit the file siHe to 3 Gi,G# $t is sometimes necessary to go over this limit! especially when higher sampling rates or %it

9?

resolutions are re(uired# The 3<4 format was therefore created for use in Sound Forge# $ts @<*%it header allows for much longer recording times# :.( O!TP!T ESIGN /utput design generally refers to the results and information that are generated %y the system for many end*usersS output is the main reason for developing the system and the %asis on which they evaluate the usefulness of the application# $n any system! the output design determines the input to %e given to the application#

:.1. ATABASE ESIGN The data%ase design is a must for any application developed especially more for the data store projects# Since the chatting method involves storing the message in the ta%le and produced to the sender and receiver! proper handling of the ta%le is a must# $n the project! admin ta%le is designed to %e uni(ue in accepting the username and the length of the username and password should %e greater than Hero#

:.4 S#STE" FLO3 IAGRA"*

9@

FIG!RE 1.1

9A

!SECASE IAGRA"1* =E"BE

ING "O !LE>*

FIG!RE 1.4

9B

!SECASE IAGRA"(* =E2TRACTION "O !LE>*

FIG!RE1.:

9C

CLASS IAGRA"*

FIG!RE 1.<

<. S#STE" TESTING AN "AINTENANCE


<>

<.1 !NIT TESTING* The procedure level testing is made first# ,y giving improper inputs! the errors occurred are noted and eliminated# Then the we% form level testing is made# For example storage of data to the ta%le in the correct manner# $n the company as well as see er registration form! the Hero length username and password are given and chec ed# &lso the duplicate username is given and chec ed# $n the jo% and (uestion entry! the %utton will send data to the server only if the client side validations are made# The dates are entered in wrong manner and chec ed# :rong email*id and we% site 0-7 F0niversal -esource 7ocatorG is given and chec ed# <.( INTEGRATION TESTING* Testing is done for each module# &fter testing all the modules! the modules are integrated and testing of the final system is done with the test data! specially designed to show that the system will operate successfully in all its aspects conditions# Thus the system testing is a confirmation that all is correct and an opportunity to show the user that the system wor s#

<.1 VALI ATION TESTING*

<+

The final step involves =alidation testing! which determines whether the software function as the user expected# The end*user rather than the system developer conduct this test most software developers as a process called &lpha and ,eta Testing to uncover that only the end user seems a%le to find# The compilation of the entire project is %ased on the full satisfaction of the end users# $n the project! validation testing is made in various forms# $n (uestion entry form! the correct answer only will %e accepted in the answer %ox# The answers other than the four given choices will not %e accepted# "AINTENANCE* The o%jectives of this maintenance wor are to ma e sure that the system gets into wor all time without any %ug# Provision must %e for environmental changes which may affect the computer or software system# This is called the maintenance of the system# .owadays there is the rapid change in the software world# 'ue to this rapid change! the system should %e capa%le of adapting these changes# $n our project the process can %e added without affecting other parts of the system# 6aintenance plays a vital role# The system lia%le to accept any modification after its implementation# This system has %een designed to favour all new changes# 'oing this will not affect the systemEs performance or its accuracy#

?. S#STE" I"PLE"ENTATION
<3

$mplementation is the most crucial stage in achieving a successful system and giving the userEs confidence that the new system is wor a%le and effective# $mplementation of a modified application to replace an existing one# This type of conversation is relatively easy to handle! provide there are no major changes in the system# 1ach program is tested individually at the time of development using the data and has verified that this program lin ed together in the way specified in the programs specification! the computer system and its environment is tested to the satisfaction of the user# The system that has %een developed is accepted and proved to %e satisfactory for the user# &nd so the system is going to %e implemented very soon# & simple operating procedure is included so that the user can understand the different functions clearly and (uic ly# $nitially as a first step the executa%le form of the application is to %e created and loaded in the common server machine which is accessi%le to all the user and the server is to %e connected to a networ # The final stage is to document the entire system which provides components and the operating procedures of the system#

7.1 SCOPE FOR FUTURE DEVELOPMENT


1very application has its own merits and demerits# The project has covered almost all the re(uirements# Further re(uirements and improvements can easily %e done since the coding is mainly structured or modular in nature# "hanging the existing modules or adding new modules can append improvements# Further enhancements can %e made to the application! so that the we% site functions very attractive and useful manner than the present one#

<9

@. CONCL!SION
Steganography transmits secrets through apparently innocuous covers in an effort to conceal the existence of a secret# &udio file Steganography and its derivatives are growing in use and application# $n areas where cryptography and strong encryption are %eing outlawed! citiHens are loo ing at Steganography to circumvent such policies and pass messages covertly# &lthough the algorithm presented is a simple one and not without its draw%ac s! it represents a significant improvement over simplistic steganographic algorithms that do not use eys# ,y using this algorithm! two parties can %e communicated with a fairly high level of confidence a%out the communication not %eing detected# $n designing the Steganography utmost care was ta en to meet user re(uirements as much as possi%le# The analysis and design phase was reviewed# "are was ta en strictly to follow the software engineering concepts# &nd principles so as to maintain good (uality in the developed system as per the user re(uirements#

APPEN I2
SCREENSHOTS* E"BE ING "O !LE*

Ste& 1* Selection of an input audio file# This is the wav file in which the user is going to hide the text file#

<<

<?

E"BE

ING "O !LE

Ste& (* Selection of an output &udio file# This is the name of the file given %y the user to save the message em%edded audio file#

<@

E"BE

ING "O !LE*

Ste& 1* Selection of the text file For the messageG to %e hidden and sent to the destination#

<A

E"BE

ING "O !LE*

Ste& 4* Selection of the Oey file F0sed for 1ncryption>

<B

E"BE

ING "O !LE*

Ste& <* &ctual process of em%edding the text file into the selected audio file.

The data file is successfully hidden in the selected audio file# &fter em%edding process! when we play the encrypted audio file it will listen the same as %efore without any changes#

<C

E2TRACTION "O !LE* The )idden message is extracted from the audio file and can %e viewed through the following process. Ste& 1D Selection of the 1ncrypted audio file# This is the name of the file given in step 3 of the 1m%edding module.

?>

E2TRACTION "O !LE* Ste& (* Selection of a new text file# This is the name of the file given %y the receiver to save the em%edded message#

?+

E2TRACTION "O !LE* Ste& 1* Selection of the Oey file# This is the same file as selected in step < of the 1m%edding module# FSymmetric 1ncryptionG

?3

E2TRACTION "O !LE* Ste& :* 1xtracting the data from the encrypted audio file.

?9

E2TRACTION "O !LE* Ste& <* =iewing the extracted message#

?<

SA"PLE CO E* T%i' i' t%e E/$e- cl0''. using SystemS namespace ')&F X QQQ Summary description for cls1m%ed# pu%lic class cls1m%ed X private int "ur1m%edStepU>S private string &udioFile.ameUWWS private string OeyFile.ameUWWS private string /utput&udioFileUWWS private string 1mded'ataType UWWS private string 1m%edTextFile.ameUWWS private string 1m%edText6essageUWWS pu%lic int Prop1m%edStep X get X return "ur1m%edStepS Y set X "ur1m%edStep U valueS Y Y pu%lic string Prop&udioFile.ame X get X QQ -eturns the value stored in the local varia%le return &udioFile.ameS ??

Y set X QQ Sets the value of the local varia%le &udioFile.ame U valueS Y Y pu%lic string PropOeyFile.ame X get X return OeyFile.ameS Y set X OeyFile.ameUvalueS Y Y pu%lic string Prop/utput&udioFile X get X return /utput&udioFileS Y set X /utput&udioFileUvalueS Y Y pu%lic string Prop1m%ed'ataType X get X return 1mded'ataTypeS ?@

Y set X 1mded'ataTypeUvalueS Y Y pu%lic string Prop1m%edText6essage X get X return 1m%edText6essageS Y set X 1m%edText6essageUvalueS Y Y pu%lic string Prop1m%edTextFile.ame X get X return 1m%edTextFile.ameS Y set X 1m%edTextFile.ameUvalueS Y Y pu%lic cls1m%edFG X QQ QQ T/'/D &dd constructor logic here QQ ?A

Y Y

QQThis is the extract class using SystemS namespace ')&F X QQ Summary description for cls1m%ed# pu%lic class cls1xtract X private int "ur1m%edStepU>S private string &udioFile.ameUWWS private string OeyFile.ameUWWS private string /utputTextFileUWWS private string 1mded'ataType UWWS QQ File!Text private string 1m%edTextFile.ameUWWS QQThis will %e assigned when em%ed'ataTypeUPFileP private string 1m%edText6essageUWWS pu%lic int Prop1m%edStep X get X return "ur1m%edStepS Y set X "ur1m%edStep U valueS Y Y

pu%lic string Prop&udioFile.ame ?B

X get X QQ -eturns the value stored in the local varia%le return &udioFile.ameS Y set X QQ Sets the value of the local varia%le &udioFile.ame U valueS Y Y pu%lic string PropOeyFile.ame X get X return OeyFile.ameS Y set X OeyFile.ameUvalueS Y Y pu%lic string Prop/utputTextFile X get X return /utputTextFileS Y set X /utputTextFileUvalueS Y Y ?C

pu%lic string Prop1m%ed'ataType X get X return 1mded'ataTypeS Y set X 1mded'ataTypeUvalueS Y Y pu%lic string Prop1m%edText6essage X get X return 1m%edText6essageS Y set X 1m%edText6essageUvalueS Y Y pu%lic string Prop1m%edTextFile.ame X get X return 1m%edTextFile.ameS Y set X 1m%edTextFile.ameUvalueS Y Y @>

pu%lic cls1xtractFG X QQ QQ T/'/D &dd constructor logic here QQ Y Y Y

QQ1m%edding methodD pu%lic void 1m%ed'ataFG X Stream sourceStream U nullS FileStream destinationStream U nullS :aveStream audioStream U nullS QQcreate a stream that contains the message! preceeded %y its length Stream messageStream U Get6essageStreamFGS QQopen the ey file Stream eyStream Unew FileStreamFo%j+#PropOeyFile.ame! File6ode#/penGS text,ox@#Text UWOey File 'ata gathered###WS try X QQhow many samples do we needT 7ong countSamples-e(uired U :ave0tility#"hec OeyFor6essageF eyStream! messageStream#7engthGS text,ox@#Text IUWJrJnW I countSamples-e(uired#ToString FG I W @+

Samples -e(uired###W S "onsole#:rite7ine FcountSamples-e(uired#ToString FGGS ifFcountSamples-e(uired Z $nt93#6ax=alueG X throw new 1xceptionFW6essage too long! or %ad ey[ This messageQ ey com%ination re(uiresWIcountSamples-e(uiredIW samples! only WI$nt93#6ax=alueIW samples are allowed#WGS Y QQuse a #wav file as the carrier sourceStream U new FileStreamFo%j+#Prop&udioFile.ame ! File6ode#/penGS QQthis#"ursor U "ursors#:ait"ursorS QQcreate an empty file for the carrier wave destinationStream U new FileStreamFo%j+#Prop/utput&udioFile ! File6ode#"reateGS text,ox@#Text IUWJrJnW I W/utput &udio File "reated###WS QQcopy the carrier filePs header audioStreamU new :aveStreamFsourceStream! destinationStreamGS if FaudioStream#7ength \U >G X throw new 1xceptionFW$nvalid :&= fileWGS Y Qare there enough samples in the carrier waveT ifFcountSamples-e(uired Z audioStream#"ountSamplesG X String error-eport U WThe carrier file is too small for this message &nd eyIaudioStream#"ountSamplesI WJrJn IWSamples neededDWIcountSamples-e(uiredS throw new 1xceptionFerror-eportGS Y @3

QQhide the message :ave0tility utilityUnew :ave0tilityFaudioStream! destinationStreamGS text,ox@#Text IUWJrJnW I WStart )iding###WS 6essage,ox#Show FWStarting###WGS utility#)ideFmessageStream! eyStreamGS text,ox@#Text IUWJrJnW I WFinished )iding###WS Y catchF1xception exG X 6essage,ox#ShowFex#6essageGS Y finally X ifF eyStream [U nullGX eyStream#"loseFGS Y ifFmessageStream [U nullGX messageStream#"loseFGS Y ifFaudioStream [U nullGX audioStream#"loseFGS Y ifFsourceStream [U nullGX sourceStream#"loseFGS Y ifFdestinationStream [U nullGX destinationStream#"loseFGS Y this#"ursor U "ursors#'efaultS Y QQ1xtract methodD pu%lic void 1xtract'ataFG X this#"ursor U "ursors#:ait"ursorS FileStream sourceStream U nullS :aveStream audioStream U nullS QQcreate an empty stream to receive the extracted message 6emoryStream messageStream U new 6emoryStreamFGS QQopen the ey file @9

Stream eyStream U new FileStreamFtxtOeyFile#Text! File6ode#/penGS text,ox@#Text UWOey File /pened###JrJnWS try X QQopen the carrier file sourceStream U new FileStreamFtxt$nput&udioFile#Text! File6ode#/penGS text,ox@#Text IUW&udio File /pened###JrJnWS audioStream U new :aveStreamFsourceStreamGS :ave0tility utility U new :ave0tilityFaudioStreamGS QQexctract the message from the carrier wave text,ox@#Text IUWStart 1xtracting ###JrJnWS utility#1xtractFmessageStream! eyStreamGS text,ox@#Text IUWFinished 1xtracting ###JrJnWS messageStream#See F>! See /rigin#,eginGS QQsave result to a file FileStream fs U new FileStreamFtxt/utputTextFile#Text! File6ode#"reateGS %yte]^ %uffer U new %yte]messageStream#7ength^S messageStream#-eadF%uffer! >! %uffer#7engthGS messageStream#See F>! System#$/#See /rigin#,egin GS txt1xtracted6essage#TextU new Stream-eaderFmessageStreamG#-eadTo1ndFGS fs#:riteF%uffer! >! %uffer#7engthGS fs#"loseFGS Y else X QQ display result

@<

txt1xtracted6essage#Text U new Stream-eaderFmessageStreamG#-eadTo1ndFGS Y Y catchF1xception exG X this#"ursor U "ursors#'efaultS 6essage,ox#ShowFex#6essageGS Y finally X ifF eyStream [U nullGX eyStream#"loseFGS Y ifFmessageStream [U nullGX messageStream#"loseFGS Y ifFaudioStream [U nullGX audioStream#"loseFGS Y ifFsourceStream [U nullGX sourceStream#"loseFGS Y this#"ursor U "ursors#'efaultS Y Y

@?

You might also like