Watermarking Relational Databases Using Optimization
-
Upload
usha-baburaj -
Category
Documents
-
view
219 -
download
0
Transcript of Watermarking Relational Databases Using Optimization
-
8/11/2019 Watermarking Relational Databases Using Optimization
1/71
-
8/11/2019 Watermarking Relational Databases Using Optimization
2/71
S.No INDEX Page No
1.
2.
3
4
5
6
7
8
9
10
11
Abstract
1.1 Organization Profile1.2 Problem Definition
System St!y
2.1 Existing System
2.2 Proposed System
System A"a#ys$s
3.1 Packages selected3.2 Resorces Re!ired
3.3 System "lo# Diagram
System Des$g"
$.1 %npt deign$.2 Otpt design
Im%#eme"tat$o"
&est$"g
'a$"te"a"ce
(ser 'a"a#
&.1 'ard#are Re!irement
&.2 Soft#are Re!irement
)o"c#s$o"
*e+ere"ces
A%%e"!$,es
11.1 Soft#are Profile
11.2 Sorce (ode
11.3 Screen S)ots
-
8/11/2019 Watermarking Relational Databases Using Optimization
3/71
-
8/11/2019 Watermarking Relational Databases Using Optimization
4/71
A-S&*A)&
Pro*ing o#ners)ip rig)ts on otsorced relational databases is a crcial isse intoday+s internet,based application en*ironments and in many content distribtion
applications. %n t)is paper- #e present a mec)anism for proof of o#ners)ip based on t)e
secre embedding of a robst imperceptible #atermark in relational data. e formlate
t)e #atermarking of relational databases as a constrained optimization problem and
discss efficient tec)ni!es to sol*e t)e optimization problem and to )andle t)e
constraints. Or #atermarking tec)ni!e is resilient to #atermark sync)ronization errors
becase it ses a partitioning approac) t)at does not re!ire marker tples. Or approac)
o*ercomes a ma/or #eakness in pre*iosly proposed #atermarking tec)ni!es.
atermark decoding is based on a t)res)old,based tec)ni!e c)aracterized by an optimal
t)res)old t)at minimizes t)e probability of decoding errors. e implemented a proof of
concept implementation of or #atermarking tec)ni!e and s)o#ed by experimental
reslts t)at or tec)ni!e is resilient to tple deletion- alteration- and insertion attacks.
-
8/11/2019 Watermarking Relational Databases Using Optimization
5/71
IN&*D()&IN/
0)e rapid gro#t) of internet and related tec)nologies )as offered an
nprecedented ability to access and redistribte digital contents. %n sc) a context-
enforcing data o#ners)ip is an important re!irement #)ic) re!ires articlated
soltions- encompassing tec)nical- organizational and legal aspects. 0)og) #e are still
far from sc) compre)ensi*e soltions- in t)e last years #atermarking tec)ni!es )a*e
emerged as an important bilding block #)ic) plays a crcial role in addressing t)e
o#ners)ip problem. Sc) tec)ni!es allo# t)e o#ner of t)e data to embed an
imperceptible #atermark into t)e data.
#atermark describes information t)at can be sed to pro*e t)e o#ners)ip of
data- sc) as t)e o#ner- origin- or recipient of t)e content. Secre embedding re!ires
t)at t)e embedded #atermark mst not be easily tampered #it)- forged- or remo*ed from
t)e #atermarked data. %mperceptible embedding means t)at t)e presence of t)e
#atermark is nnoticeable in t)e data. "rt)ermore- t)e #atermark detection is blinded-
t)at is- it neit)er re!ires t)e kno#ledge of neit)er t)e original data nor t)e #atermark.
atermarking tec)ni!es )a*e been de*eloped for *ideo- images- adio- and text data
and also for soft#are and natral langage text.
y contrast t)e problem of #atermarking relational data )as not been gi*en
appropriate attention. 0)ere are- )o#e*er- many application contexts for #)ic) data
represent an important asset- t)e o#ners)ip of #)ic) mst t)s be careflly enforced.
0)is is t)e case- for example- of #eat)er data- stock market data- po#er consmption-
consmer be)a*ior data- medical and scientific data.
-
8/11/2019 Watermarking Relational Databases Using Optimization
6/71
atermark embedding for relational data is made possible by t)e fact t)at real
data can *ery often tolerate a small amont of error #it)ot any significant degradation
#it) respect to t)eir sability. "or example #)en dealing #it) #eat)er data- c)anging
some daily temperatres of 1 or 2 degrees is a modification t)at lea*es t)e data still
sable.
0o date only a fe# approac)es to t)e problem of #atermarking relational data
)a*e been proposed. 0)ese tec)ni!es- )o#e*er- are not *ery resilient to #atermark
attacks. %n t)is pro/ect- #e present a #atermarking tec)ni!e for relational data t)at is
)ig)ly resilient compared to t)ese tec)ni!es. %n particlar- or proposed tec)ni!e is
resilient to tple deletion- alteration- and insertion attacks.
-
8/11/2019 Watermarking Relational Databases Using Optimization
7/71
-
8/11/2019 Watermarking Relational Databases Using Optimization
8/71
)'PAN P*IE/
Softec) lobal Soltions #as incorporated in t)e year 1445- as a soft#are
ser*ices company. Since 1445- t)e company is in*ol*ed in *arios acti*ities like
Soft#are De*elopment- Systems %ntegration- (onsltancy Ser*ices and (orporate
0raining etc.-. 0)e (ompany is a )ig) tec)nology dri*en organization fonded and
managed by efficient and )ig)ly respected *isionaries #it) #ide range of experience and
expertise in t)e %0 related indstry. Or company mission is to sol*e traditional bsiness
problems in ne# #ays and )o# to address t)e ne# set of isses t)at come #it) progress.
e )a*e t)e tec)nology and bsiness expertise to make it a reality.
0)e company is specializing in t)e areas like eb de*elopment sing
62EE 0ec)nologies- .7et 0ec)nologies and so on. 0)e company also in*ol*es in t)e areas
like client ser*er tec)nologies- distribted compting- data #are)osing and P
tec)nologies. 0)e company )as a soft#are de*elopment centre at ()ennai )as a 2$ 8 9
spport facility for clients. 0)e (ompany )as its (orporate Office at : 7e# 7o:
12- ;nited %ndia (olony- 3rd(ross Street- = )ig)ly skilled professionals.
Prese"t -s$"ess Act$$ty/
Or company is engaged in t)e acti*ities of Soft#are De*elopment-
Systems %ntegration- (onsltancy Ser*ices and (orporate 0raining. e )a*e de*eloped
many eb Portals- pplication Prodcts- (on*ersion Pro/ects- ?aintenance Pro/ects
and a #ide range of mini ERP soltions to *arios medim range indstries. lso #e
in*ol*ed in migration of applications from DOS based applications to ;% based
applications.
-
8/11/2019 Watermarking Relational Databases Using Optimization
9/71
e )a*e de*eloped some applications like tomation soft#are for Sper
?arket- Soft#are for 0extile %ndstries- Soft#are for 0ra*el %ndstries and ccont
?anagement Soft#are for *arios companies. e )a*e also set p #eb based intranet
soltions to its clients. e are offering or ser*ices in t)e follo#ing areas of %0:
S&A*E S(&INS/
1.Dee#o%$"g E)ommerce Porta#s/
e )a*e de*eloping and deploying eb Portals for or cstomers in 2 and
2( applications. Or professional ser*ices for )elp in formlating E,bsiness strategy-
as #ell as in designing- cstomizing and implementing E,bsiness soltions. lso #e #ill
gi*e t)e spport for %nternet and %ntranet based applications for *arios
2. Dee#o%$"g '$"$ a"! '$cro E*P Pacages/
e )a*e already de*eloped mini ERP soltions sing @- 62EE and .7et
tec)nologies #it) *arios databases for its cstomers. e )a*e planned to de*elop more
cstomized applications to sit medim scale establis)ments. e )a*e also proposed to
de*elop ?icro ERP applications sing eb 0ec)nologies #it) SAB ser*er as a database.
3. Dee#o%$"g A%%#$cat$o" Pro!cts/
Presently or team )as in*ol*ed in t)e en)ancement #ork for Bogistics
pro/ect. 0)is applications are sed as a front end as SP.net C @.net. 0)ese applications
are mainly sed for (learing and "or#arding gents and (argo ?anagement prposes.
4. Pro+ess$o"a# Ser$ces/
So+tare )o"s#ta"t )o"tract$"g/
e pro*ide )ig)ly skilled soft#are professionals for *arios companies
bot) in %ndia and O*erseas. e )a*e a separate team #)o #ork for t)is prpose. e are
crrently tied p #it) some ?7( companies for )man resorces on contract basis for
giants like %?- ipro and so on. e are also tied p #it) ?ascon lobal- Satyam
-
8/11/2019 Watermarking Relational Databases Using Optimization
10/71
(ompter Ser*ices- '(B 0ec)nologies for pro*iding resorces of *aried skill sets. e
can pro*ide good- !alified- experienced and cltred resorces to sit t)e re!irements
of t)e clients.
5.)or%rate &ra$"$"g/
0raining is carried ot #it) #ell planned met)odology of t)eory and
pro/ect orientation #)ic) )elps to de*elop potential )man resorce for %0 sector. e
)a*e also carried ot corporate 0raining to ma/or companies sc) as '(B- (0S- %PRO-
S0?- (O@7SS and etc.
6. r ar$os )#$e"ts/
ccentra Systems Pte Btd.- ?alaysiaF
?en+s Parc ()ennaiF
7ellai Stores ()ennaiF
Sri ?t)aramman Departmental Stores ()ennaiF
7e# 6ot)i Stores ()ennaiF
?acsoft 0ec)nologies (oimbatoreF
Bogic soft Systems 7e# Del)iF
-
8/11/2019 Watermarking Relational Databases Using Optimization
11/71
-
8/11/2019 Watermarking Relational Databases Using Optimization
12/71
2. SSE' S&(D
System stdy deals #it) t)e process of defining t)e fnctioning of existing
system. 0)e ad*antages and disad*antages of t)e existing system are elaborately
discssed to pro*e t)e #ay for t)e proposed system. 0)en t)e proposed system is defined
for t)e problem and t)e ad*antages of t)e proposed system are also defined.
2.1 EXIS&IN SS&E'/
Existing #atermarking tec)ni!e t)at embeds #atermark bits in t)e data
statistics. 0)e data partitioning tec)ni!e sed is based on t)e se of special marker
tples #)ic) makes it *lnerable to #atermark sync)ronization errors reslting from
tple deletion and tple insertionG t)s sc) tec)ni!e is not resilient to deletion and
insertion attacks. Existing system recommend storing t)e marker tples to enable t)e
decoder to accrately reconstrct t)e nderlying partitionsG )o#e*er t)is *iolates t)e
blinded #atermark detection property.
Existing #atermarking algorit)m t)at embeds t)e #atermark bits in t)e least
significant bits BSF of selected attribtes of a selected sbset of tples. 0)is tec)ni!e
does not pro*ide a mec)anism for mltibit #atermarksG instead only a secret key is sed.
"or eac) tple- a secre message at)enticated code ?(F is compted sing t)e secret
key and t)e tpleHs primary key. 0)e compted ?( is sed to select candidate tples-
attribtes and t)e BS position in t)e selected attribtes.
-
8/11/2019 Watermarking Relational Databases Using Optimization
13/71
2.2 P*PSED SS&E'/
0)e main contribtions of t)e paper are smmarized as follo#s:
e formlate t)e #atermarking of relational databases as a constrained
optimization problem- and discss efficient tec)ni!es to )andle t)e constraints. e
present t#o tec)ni!es to sol*e t)e formlated optimization problem based on genetic
algorit)ms and pattern searc) tec)ni!es.
e present a data partitioning tec)ni!e t)at does not depend on marker tples to
locate t)e partitions and t)s it is resilient to #atermark sync)ronization errors.
e de*elop an efficient tec)ni!e for #atermark detection t)at is based on an
optimal t)res)old. 0)e optimal t)res)old is selected by minimizing t)e probability of
decoding error.
it) a proof of concept implementation of or #atermarking tec)ni!e- #e )a*e
condcted experiments sing real,#orld data.
-
8/11/2019 Watermarking Relational Databases Using Optimization
14/71
3. SS&E' ANASIS
-
8/11/2019 Watermarking Relational Databases Using Optimization
15/71
System analysis is t)e process of gat)ering and interpreting facts-
diagnosing problems of t)e existing system and sing t)ose facts for t)e design and
de*elopment of an impro*ed system t)at )elps to determine )o# and #)ere
compterized system can benefits all sers of t)e system.
3.1 Pacage se#ecte! /
Operating system : indo#s 2===
Bangage : (I
3.2 *esorces re:$re!/
So+tare /
Operating system : indo#s 2=== and abo*e
"ront end : SP.7et
ackend : SAB Ser*er 2==>
;ar!are/
Processor J System : Pentim %@
Processor Speed : 5==?'z
?ain ?emory : >12? R?
'ard Disk : $=
Secondary Storage : "DD1.$$?C>28 (D RO?
-
8/11/2019 Watermarking Relational Databases Using Optimization
16/71
'o!#es/
1. Data set partitioning
2. atermark embedding
3. Optimal t)res)old e*alation
$. 0)res)old based decoding
> . atermark Decoding
1. Data set %art$t$o"$"g
y sing t)e secret key
-
8/11/2019 Watermarking Relational Databases Using Optimization
17/71
2. atermar embe!!$"g
#atermark bit is embedded in eac) partition by altering t)e partition statistics
#)ile still *erifying t)e sability constraints in . 0)is alteration is performed by sol*ing
a constrained optimization problem.
"ormalizing t)e bit encoding as a constrained optimization problem. 0)en #e propose a
genetic algorit)m and a pattern searc) tec)ni!e t)at can be sed to efficiently sol*e sc)
optimization problem. 0)e selection of #)ic) optimization algorit)m to se is decided
according to t)e application time and processing re!irements. Or #atermarking
tec)ni!e is able to )andle tples #it) mltiple attribtes.
3. %t$ma# t
-
8/11/2019 Watermarking Relational Databases Using Optimization
18/71
t)e data partitioning algorit)m t)at partitions t)e data set based on a secret key
-
8/11/2019 Watermarking Relational Databases Using Optimization
19/71
-
8/11/2019 Watermarking Relational Databases Using Optimization
20/71
4. SS&E' DESIN
)o"ce%ts
0)e Design of an information system prodces t)e details t)at state )o# a system
#ill meet t)e re!irements identified dring analysis. 0)e emp)asis is on translating t)e
Performance- re!irements into design Specifications. 0)e *arios steps in designing t)e
Kn Efficient 0ime,ond 'ierarc)ical
-
8/11/2019 Watermarking Relational Databases Using Optimization
21/71
destination. Destination ser name is t)e ser #)o is going to reassemble t)e spited
packets. 0aking into accont- all t)e abo*e needs of t)e inpt designing- t)e ne# process
designing cold )a*e t)e follo#ing featres. %n all cases processing s)old be atomatic
and manal #ork s)old be kept minimm.
Similarly- t)e ser inpt s)old also be kept minimm or least extend possible. y gi*ing
t)e abo*e inpt calclations s)old be atomatic. 0)e ato calclation is t)e motto of t)is
ne# process- #)ile pro*iding t)e ato calclation t)e reslts #it) minimm time
operation- s)old be accrate and free from errors.
(&P(& DESIN/
Otpt design generally refers to t)e reslts and informationHs t)at are generated
by t)e system for many end,sersG otpt is t)e main reason for de*eloping t)e system
and t)e basis on #)ic) t)ey e*alate t)e seflness of t)e application. 0)e basic
re!irements of otpt are t)at it s)old be accrate- timely and appropriate- in terms of
content- medim and layot for its intended prpose.
-
8/11/2019 Watermarking Relational Databases Using Optimization
22/71
-
8/11/2019 Watermarking Relational Databases Using Optimization
23/71
5.I'PE'EN&A&IN
0)e final and important p)ase in t)e system life cycle is t)e implementation of t)ene# system. 0)e term implementation )as different meanings ranging from t)e
con*ersion of a basic application to a complete replacement of a compter system. 0)e
procedres )o#e*er- are *irtally t)e same. %mplementation incldes all t)ose acti*ities
t)at take place to con*ert from old system to ne#. 0)e ne# system may be totally ne#
replacing an existing algorit)m. 0)e performance is *ery good- #)en #e compare to
existing system.
0)e met)od of implementation and time scale to be adopted is fond ot initially.
7ext t)e system is tested properly and at t)e same time t)e sers are trained in t)e ne#
procedre. Proper implementation is essential to pro*ide a reliable system to meet
organization re!irements. Sccessfl implementation may not garantee impro*ement in
t)e organization sing t)e ne# system- bt it #ill pre*ent improper installation.
SA'PE )DIN/
usingSystem;usingSystem.Collections;usingSystem.Collections.Generic;usingSystem.Data;usingSystem.Drawing;usingSystem.Diagnostics;usingSystem.Windows.Forms;usingSystem.Text;usingSystem.IO;usingSystem.Data.SqlClient;
namespacerelationdataasewatermar!ing
-
8/11/2019 Watermarking Relational Databases Using Optimization
24/71
" pulicpartialclassForm# "
$regionde%inition stringpat& ' (c)**output**(;
$endregion
internalForm#+, " Initiali-eComponent+,;
pri/ate/oidForm#01oad+o2ectsender3 System.4/ent5rgse, " 1ist6ox#.7isile ' %alse;
pri/ate/oid6utton80Clic!0#+o2ectsender3 4/ent5rgse, " 1ist6ox#.7isile ' true;
System.IO.FileStreamInputFileStream ' null; System.IO.FileStreamOutputFileStream ' null; yte9: 6u%%er ' newyte9: " ; 6inaryeader6inaryeader ' null; 6inaryWriter6inaryWriter ' null; string%name ' null; string%ext ' null;
%ext 'Text6ox#.Text.Sustring+Text6ox#.Text.1astIndexO%+(**(, < #,;
%name ' %ext.Sustring+=3 %ext.1astIndexO%+(.(,,; string%ilename ' Text6ox#.Text; intsi-e ' #====;
try " InputFileStream ' newFileStream+%ilename3File>ode.Open,; 6inaryeader ' new6inaryeader+InputFileStream,; 6inaryeader.6aseStream.See!+=3 See!Origin.6egin,;
intlimit ' =;
limit 'Con/ert.ToInt#?+>icroso%t.7isual6asic.FileSystem.File1en+%ilename, @si-e,;
longamountsent ' =;
longi ' =; w&ile+A+i '' limit,,
-
8/11/2019 Watermarking Relational Databases Using Optimization
25/71
"
6u%%er ' newyte9si-e:; 6inaryeader.ead+6u%%er3 =3 si-e,; 6inaryeader.6aseStream.See!+=3 See!Origin.Current,;
OutputFileStream ' newSystem.IO.FileStream+(c)**split**(< %name < (.(icroso%t.7isual6asic.Strings.Format+i < #3 ((,3 File>ode.Create,;
6inaryWriter ' new6inaryWriter+OutputFileStream,; 6inaryWriter.Write+6u%%er,;
OutputFileStream.Flus&+,; 6inaryWriter.Close+,; OutputFileStream.Close+,;
amountsent ' amountsent < si-e; i ' i < #;
i%+amountsent B>icroso%t.7isual6asic.FileSystem.File1en+%ilename,, " si-e 'Con/ert.ToInt#?+>icroso%t.7isual6asic.FileSystem.File1en+%ilename, amountsent,; 6u%%er ' newyte9si-e:; 6inaryeader.ead+6u%%er3 =3 si-e,; 6inaryeader.6aseStream.See!+=3 See!Origin.Current,;
@@ OutputFileStream ' ewSystem.IO.FileStream+(4)*sud&es&*WeSite#8*images*( E (split.( EFormat+i < #3 (==(,3 File>ode.Create,
OutputFileStream ' newSystem.IO.FileStream+(c)**split**(< %name < (.(icroso%t.7isual6asic.Strings.Format+i < #3 ((,3 File>ode.Create,;
6inaryWriter ' new6inaryWriter+OutputFileStream,; 6inaryWriter.Write+6u%%er,;
OutputFileStream.Flus&+,; 6inaryWriter.Close+,; OutputFileStream.Close+,;
amountsent ' amountsent < si-e;
-
8/11/2019 Watermarking Relational Databases Using Optimization
26/71
@@IST5T C$ OT4) Commented t&is declaration sincelooping /ariales in %oreac& loops are declared in t&e %oreac&&eader in C$ @@ string s ' null;
%oreac&+strings inSystem.IO.Directory.GetFiles+(c)**split(3 %name < (.(,, "
1ist6ox#.Items.5dd+s,;
>essage6ox.S&ow+(data partioned sucess%ully(,; catc&+4xceptionex, "
>essage6ox.S&ow+ex.>essage,;
@@>essage6ox.S&ow+(pli- c&oose t&e %ile(,;
1ist6ox#.7isile ' %alse;
pulic/oiddecode+, " string9: %iles ' Directory.GetFiles+(c)**split(,; %oreac&+string%ile in%iles, " File.Delete+(c)**output**(28 (D RO?
-
8/11/2019 Watermarking Relational Databases Using Optimization
35/71
-
8/11/2019 Watermarking Relational Databases Using Optimization
36/71
9. )N)(SIN/
0)e #atermarking problem #as formlated as a constrained optimization
problem- t)at maximizes or minimizes a )iding fnction based on t)e bit to be embedded.
enetic algorit)m and pattern searc) tec)ni!es #ere employed to sol*e t)e proposed
optimization problem and to )andle t)e constraints. "rt)ermore- #e presented a data
partitioning tec)ni!e t)at does not depend on special marker tples to locate t)e
partitions and pro*ed its resilience to #atermark sync)ronization errors. e de*eloped an
efficient t)res)old,based tec)ni!e for #atermark detection t)at is based on an optimal
t)res)old t)at minimizes t)e probability of decoding error. 0)e #atermark resilience #as
impro*ed by t)e repeated embedding of t)e #atermark and sing ma/ority *oting
tec)ni!e in t)e #atermark decoding p)ase. ?oreo*er- t)e #atermark resilience #as
impro*ed by sing mltiple attribtes.
-
8/11/2019 Watermarking Relational Databases Using Optimization
37/71
-
8/11/2019 Watermarking Relational Databases Using Optimization
38/71
-I-I*AP;/
-oos re+erre!/
-
8/11/2019 Watermarking Relational Databases Using Optimization
39/71
SA'PE S)*EENS
-
8/11/2019 Watermarking Relational Databases Using Optimization
40/71
-
8/11/2019 Watermarking Relational Databases Using Optimization
41/71
-
8/11/2019 Watermarking Relational Databases Using Optimization
42/71
-
8/11/2019 Watermarking Relational Databases Using Optimization
43/71
-
8/11/2019 Watermarking Relational Databases Using Optimization
44/71
-
8/11/2019 Watermarking Relational Databases Using Optimization
45/71
-
8/11/2019 Watermarking Relational Databases Using Optimization
46/71
11.1 So+tare %ro+$#e
ASP.NE&
-
8/11/2019 Watermarking Relational Databases Using Optimization
47/71
0)e SP.7E0 application platform ses a frame #ork model. pplication logic is
di*ided into components according to fnction- and t)e *arios application components
t)at make p a SP.7E0 application are installed on different mac)ines depending on t)e
application component belongs.
(lient,tier components rn on t)e client mac)ine.
eb,tier components rn on t)e ser*er.
siness,tier components rn on t)e ser*er.
%nternet information system %%SF,tier soft#are rns on t)e ser*er.
0)e .7E0 infrastrctre consists of all t)e tec)nologies t)at )elp in creating an
rnning robst- scalable and distribted applications. 0)e core of t)e .7E0 infrastrctre
is t)e .7E0 frame#ork- #)ic) is a collection of ser*ices and classes. %t exists as a layer
bet#een .7E0 applications and t)e nderlying operating system. sp .7E0 is one of t)e
langages t)at are directed to#ards meeting t)e ob/ecti*es of t)e .7E0 initiati*e of
creating distribted applications. %t )as in)erited t)e capability of rapid application
de*elopment from its earlier *ersions and strengt)ened considerably t)e implementation
of ob/ect oriented featres. sp .7E0 )as many ne# and impro*ed featres sc) as
in)eritance- interfaces- and o*erloading t)at makes it a po#erfl ob/ect,oriented
programming langage. Ot)er ne# langage featres inclde free t)reading and
strctred exception )andling. sp .7E0 flly integrates t)e .7E0 "rame#ork and t)e
(ommon Bangage Rntime- #)ic) toget)er pro*ide langage interoperability- garbage
collection- en)anced secrity- and impro*ed *ersioning spport. s a sp de*eloper- #e
can create mltit)readed- scalable applications sing explicit mltit)reading.
)''N AN(AE SPE)II)A&IN
Ot)er ne# langage featres in sp.7E0 inclde strctred exception )andling-
cstom attribtes- and common langage specification (BSF compliance. 0)e (BS is a
-
8/11/2019 Watermarking Relational Databases Using Optimization
48/71
-
8/11/2019 Watermarking Relational Databases Using Optimization
49/71
#it) exceptions- protected blocks of code- and filters. Strctred exception )andling
makes it easy to create and maintain programs #it) robst- compre)ensi*e error )andlers.
er#oa!$"g
O*erloading is t)e ability to define properties- met)ods- or procedres t)at )a*e
t)e same name bt se different data types. O*erloaded procedres allo# yo to pro*ide
as many implementations as necessary to )andle different kinds of data- #)ile gi*ing t)e
appearance of a single- *ersatile procedre.
err$!$"g Pro%ert$es a"! 'et
-
8/11/2019 Watermarking Relational Databases Using Optimization
50/71
I"ter+aces
%nterfaces describe t)e properties and met)ods of classes- bt nlike classes- do
not pro*ide implementations. 0)e %nterface statement allo#s yo to declare interfaces-
#)ile t)e %mplements statement lets yo #rite code t)at pts t)e items described in t)e
interface into practice.
De#egates
Delegates W ob/ects t)at can call t)e met)ods of ob/ects on yor be)alf W are
sometimes described as type,safe- ob/ect,oriented fnction pointers. o can se
delegates to let procedres specify an e*ent )andler met)od t)at rns #)en an e*ent
occrs. o can also se delegates #it) mltit)readed applications.
S
-
8/11/2019 Watermarking Relational Databases Using Optimization
51/71
Names%aces
7amespaces pre*ent naming conflicts by organizing classes- interfaces- and
met)ods into )ierarc)ies.
Assemb#$es
ssemblies replace and extend t)e capabilities of type libraries by- describing all
t)e re!ired files for a particlar component or application. n assembly can contain one
or more namespaces.
Attr$btes
ttribtes enable yo to pro*ide additional information abot program elements.
"or example- yo can se an attribte to specify #)ic) met)ods in a class s)old be
exposed #)en t)e class is sed as a 8?B eb ser*ice.
'#t$t
-
8/11/2019 Watermarking Relational Databases Using Optimization
52/71
ssemblies form t)e fndamental nit of deployment- *ersion control- rese-
acti*ation scoping- and secrity permissions for a .7E0,based application. ssemblies
take t)e form of an exectable .exeF file or dynamic link library .dllF file- and are t)e
bilding blocks of t)e .7E0 "rame#ork. 0)ey pro*ide t)e common langage rntime
#it) t)e information it needs to be a#are of type implementations. o can t)ink of an
assembly as a collection of types and resorces t)at form a logical nit of fnctionality
and are bilt to #ork toget)er. it) sp.7E0- yo se t)e contents of assemblies- and
add references to t)em. )at makes assemblies different from .exe or .dll files.
Assemb#y 'a"$+est
it)in e*ery assembly is an assembly manifest. Similar to a table of contents- t)e
assembly manifest contains t)e follo#ing: 0)e assembly+s identity its name and
*ersionF. file table describing all t)e ot)er files t)at make p t)e assembly- inclding-
for example- any ot)er assemblies yo created t)at yor .exe or .dll file relies on- or e*en
bitmap or Readme files. n assembly reference list- #)ic) is a list of all external
dependencies W .dlls or ot)er files yor application needs t)at may )a*e been created by
someone else. ssembly references contain references to bot) global and pri*ate ob/ects.
lobal ob/ects reside in t)e global assembly cac)e- an area a*ailable to ot)er
applications- some#)at like t)e System32 directory. 0)e ?icrosoft.@isalasic
namespace is an example of an assembly in t)e global assembly cac)e. Pri*ate ob/ects
mst be in a directory at eit)er t)e same le*el as or belo# t)e directory in #)ic) yor
application is installed.
Des$g" Pr$"c$%#es
sp .7E0 reflects t)e follo#ing design principles:
-
8/11/2019 Watermarking Relational Databases Using Optimization
53/71
%t is recognizably t)e descendant of @isal asic. n existing @isal asic
programmer #ill feel immediately familiar #it) t)e langage.
%ts syntax and semantics are simple- straig)tfor#ard- and easy to nderstand. 0)e
langage a*oids nintiti*e featres.
%t gi*es de*elopers t)e ma/or featres of t)e .7E0 "rame#ork and is consistent
#it) t)e frame#ork+s con*entions.
%t is reasonably pgradeable from @isal asic. ecase t)e .7E0 "rame#ork
explicitly spports mltiple compter langages- it #orks #ell in a ?ltilangage
en*ironment.
%t is as compatible #it) pre*ios *ersions of @isal asic as possible. )ene*er
practical- @isal asic .7E0 )as t)e same syntax- t)e same semantics- and t)e
same rn,time be)a*ior as its predecessors.
0)ese principles complement t)e original design principles of @isal asic:
%t is as safe a langage to #rite in as possible. %n general- @isal asic tries to
balance reliability- ease of se- and efficiency in t)e definition of t)e langage.
%t is an extremely approac)able langage.
%t enables rapid program de*elopment- #)ile not compromising reliability.
%t prodces predictable and efficient code.
%t #orks as a strongly type langage- as #ell as a loosely typed one- for more
correct ser code in t)e former case- and for faster de*elopment in t)e latter.
-
8/11/2019 Watermarking Relational Databases Using Optimization
54/71
'I)*S& S= SE*E* 2000 S&*AE ENINE
IN&*D()&IN
SAB Ser*er 2=== is a scalable- reliable- and easy,to,se prodct t)at #ill pro*ide a solid
fondation for application design for t)e next 2= years.
S&*AE ENINE DESIN AS
Database applications can no# be deployed #idely de to intelligent- atomated storage
engine operations. Sop)isticated yet simplified arc)itectre impro*es performance-
reliability- and scalability.
eatre Descr$%t$o" a"! -e"e+$ts
Reliability (oncrrency- scalability- and reliability are impro*ed #it) simplified
data strctres and algorit)ms. Rn,time c)ecks of critical data
strctres make t)e database mc) more robst- minimizing t)e need for
consistency c)ecks.
Scalability 0)e ne# disk format and storage sbsystem pro*ide storage t)at is
scalable from *ery small to *ery large databases. Specific c)anges
inclde.
Simplified mapping of database ob/ects to files eases management and
enables tning flexibility. D ob/ects can be mapped to specific disks
for load balancing.
-
8/11/2019 Watermarking Relational Databases Using Optimization
55/71
?ore efficient space management inclding increasing page size from 2
-
8/11/2019 Watermarking Relational Databases Using Optimization
56/71
necessary to pre allocate space and manage data strctres.
E*oltion 0)e ne# arc)itectre is designed for extensibility- #it) a fondation for
ob/ect,relational featres.
Barge ?emory
Spport
SAB Ser*er 9.= Enterprise Edition #ill spport memory addressing
greater t)an $ - in con/nction #it) indo#s 70 Ser*er >.=- lp)a
processor,based systems- and ot)er tec)ni!es.
;nicode 7ati*e ;nicode- #it) OD( and OBE D ;nicode P%s- impro*es
mltilingal spport.
-ENEI&S
0)ere are many benefits of t)e ne# on,disk layot- inclding:
.
%mpro*ed scalability and integration #it) indo#s 70 Ser*er
etter performance #it) larger %COs
Stable record locators allo# more indexes
?ore indexes speed decision spport !eries
Simpler data strctres pro*ide better !ality
reater extensibility- so t)at sbse!ent releases #ill )a*e a cleaner de*elopment
process and ne# featres are faster to implement
DA&A-ASES> IES> AND IE *(PS
E*IE
-
8/11/2019 Watermarking Relational Databases Using Optimization
57/71
SAB Ser*er 9.= is mc) more integrated #it) indo#s 70 Ser*er t)an any of its
predecessors. Databases are no# stored directly in indo#s 70 Ser*er files .SAB Ser*er
is being stretc)ed to#ards bot) t)e )ig) and lo# end.
IES
SAB Ser*er 9.= creates a database sing a set of operating system files- #it) a
separate file sed for eac) database. ?ltiple databases can no longer s)are t)e same file.
0)ere are se*eral important benefits to t)is simplification. "iles can no# gro# and
s)rink- and space management is greatly simplified.
ll data and ob/ects in t)e database- sc) as tables- stored procedres- triggers- and
*ie#s- are stored only #it)in t)ese operating system files:
"ile 0ype Description
Primary data
file
0)is file is t)e starting point of t)e database. E*ery database )as only
one primary data file and all system tables are al#ays stored in t)e
primary data file.
Secondary data
files
0)ese files are optional and can )old all data and ob/ects t)at are not on
t)e primary data file. Some databases may not )a*e any secondary data
files- #)ile ot)ers )a*e mltiple secondary data files.
-
8/11/2019 Watermarking Relational Databases Using Optimization
58/71
Bog files 0)ese files )old all of t)e transaction log information sed to reco*er t)e
database. E*ery database )as at least one log file.
)en a database is created- all t)e files t)at comprise t)e database are zeroed ot filled
#it) zerosF to o*er#rite any existing data left on t)e disk by pre*iosly deleted files. 0)is
impro*es t)e performance of day,to,day operations.
SPA)E 'ANAE'EN&
0)ere are many impro*ements in t)e allocations of space and t)e management of
space #it)in files. 0)e data strctres t)at keep track of page,to,ob/ect relations)ips #ere
redesigned. %nstead of linked lists of pages- bitmaps are sed becase t)ey are cleaner and
simpler and facilitate parallel scans. 7o# eac) file is more atonomosG it )as more data
abot itself- #it)in itself. 0)is #orks #ell for copying or mailing database files.
SAB Ser*er no# )as a mc) more efficient system for tracking table space. 0)e c)anges
enable
ro#ing and s)rinking files
etter spport for large %CO
Ro# space management #it)in a table
Bess expensi*e extent allocations
-
8/11/2019 Watermarking Relational Databases Using Optimization
59/71
-
8/11/2019 Watermarking Relational Databases Using Optimization
60/71
space is ex)asted. lternati*ely- data files can be configred to gro# atomatically- bt
only to a predefined maximm size. 0)is pre*ents disk dri*es from rnning ot of space.
SAB Ser*er index is a strctre associated #it) a table t)at speeds retrie*al of t)e ro#s
in t)e table. n index contains keys bilt from one or more colmns in t)e table. 0)ese
keys are stored in a strctre t)at allo#s SAB Ser*er to !ickly and efficiently find t)e
ro# or ro#s associated #it) t)e key *ales. 0)is strctre is called a )eap. 0)e t#o types
of SAB Ser*er indexes are clstered and nonclstered indexes
)(S&E*ED INDEXES
clstered index is one in #)ic) t)e order of t)e *ales in t)e index is t)e same
as t)e order of t)e data stored in t)e table. 0)e clstered index contains a )ierarc)ical
tree. )en searc)ing for data based on a clstered index *ale- SAB Ser*er !ickly
isolates t)e page #it) t)e specified *ale and t)en searc)es t)e page for t)e record or
records #it) t)e specified *ale. 0)e lo#est le*el- or leaf node- of t)e index tree is t)e
page t)at contains t)e data.
NN)(S&E*ED INDEXES
non,clstered index is analogos to an index in a textbook. 0)e data is stored in
one placeG t)e index is stored in anot)er- #it) pointers to t)e storage location of t)e
indexed items in t)e data. 0)e lo#est le*el- or leaf node- of a non,clstered index is t)e
Ro# %dentifier of t)e index entry- #)ic) gi*es SAB Ser*er t)e location of t)e actal data
-
8/11/2019 Watermarking Relational Databases Using Optimization
61/71
ro#. 0)e Ro# %dentifier can )a*e one of t#o forms. %f t)e table )as a clstered index- t)e
identifier of t)e ro# is t)e clstered index key. %f t)e table is a )eap- t)e Ro# %dentifier is
t)e actal location of t)e data ro#- indicated #it) a page nmber and offset on t)e page.
0)erefore- a non,clstered index- in comparison #it) a clstered index- )as an extra le*el
bet#een t)e index strctre and t)e data itself.)en SAB Ser*er searc)es for data based
on a non,clstered index- it searc)es t)e index for t)e specified *ale to obtain t)e
location of t)e ro#s of data and t)en retrie*es t)e data from t)eir storage locations. 0)is
makes non,clstered indexes t)e optimal c)oice for exact,matc) !eries.
Some books contain mltiple indexes. Since non,clstered indexes fre!ently store
clstered index keys as t)eir pointers to data ro#s- it is important to keep clstered index
keys as small as possible.
SAB Ser*er spports p to 2$4 non,clstered indexes on eac) table. 0)e non,clstered
indexes )a*e a b,tree index strctre similar to t)e one in clstered indexes. 0)e
difference is t)at non,clstered indexes )a*e no effect on t)e order of t)e data ro#s. 0)e
collection of data pages for a )eap is not affected if non,clstered indexes are defined for
t)e table.
DA&A &PE );ANES
("$co!e Data
SAB Ser*er no# spports ;nicode data types- #)ic) makes it easier to store data
in mltiple langages #it)in one database by eliminating t)e problem of con*erting
c)aracters and installing mltiple code pages. ;nicode stores c)aracter data sing t#o
bytes for eac) c)aracter rat)er t)an one byte. 0)ere are 5>->35 different bit patterns in
t#o bytes- so ;nicode can se one standard set of bit patterns to encode eac) c)aracter in
-
8/11/2019 Watermarking Relational Databases Using Optimization
62/71
all langages- inclding langages sc) as ()inese t)at )a*e large nmbers of c)aracters.
?any programming langages also spport ;nicode data types.
0)e ne# data types t)at spport ;nicode are ntext- nc)ar- and n*arc)ar. 0)ey are
t)e same as text- c)ar- and *arc)ar- except for t)e #ider range of c)aracters spported and
t)e increased storage space sed.
I'P*ED DA&A S&*AE
Data storage flexibility is greatly impro*ed #it) t)e expansion of t)e maximm
limits for c)ar- *arc)ar- binary- and *ar binary data types to &-=== bytes- increased from
2>> bytes. %t is no longer necessary to se text and image data types for data storage for
anyt)ing bt *ery large data *ales. 0)e 0ransact,SAB string fnctions also spport t)ese
*ery long c)ar and *arc)ar *ales- and t)e S;S0R%7 fnction can be sed to process
text and image colmns. 0)e )andling of 7lls and empty strings )as been impro*ed.
ne# ni!e identifier data type is pro*ided for storing a globally ni!e identifier
;%DF.
-
8/11/2019 Watermarking Relational Databases Using Optimization
63/71
Sorce )o!e
usingSystem;usingSystem.Collections;usingSystem.Collections.Generic;usingSystem.Data;usingSystem.Drawing;
usingSystem.Diagnostics;usingSystem.Windows.Forms;usingSystem.Text;usingSystem.IO;usingSystem.Data.SqlClient;
namespacerelationdataasewatermar!ing" pulicpartialclassForm# "
$regionde%inition stringpat& ' (c)**output**(;
$endregion
internalForm#+, " Initiali-eComponent+,;
pri/ate/oidForm#01oad+o2ectsender3 System.4/ent5rgse, " 1ist6ox#.7isile ' %alse;
pri/ate/oid6utton80Clic!0#+o2ectsender3 4/ent5rgse, " 1ist6ox#.7isile ' true;
System.IO.FileStreamInputFileStream ' null; System.IO.FileStreamOutputFileStream ' null; yte9: 6u%%er ' newyte9: " ; 6inaryeader6inaryeader ' null;
-
8/11/2019 Watermarking Relational Databases Using Optimization
64/71
6inaryWriter6inaryWriter ' null; string%name ' null; string%ext ' null;
%ext 'Text6ox#.Text.Sustring+Text6ox#.Text.1astIndexO%+(**(, < #,;
%name ' %ext.Sustring+=3 %ext.1astIndexO%+(.(,,; string%ilename ' Text6ox#.Text; intsi-e ' #====;
try " InputFileStream ' newFileStream+%ilename3File>ode.Open,; 6inaryeader ' new6inaryeader+InputFileStream,; 6inaryeader.6aseStream.See!+=3 See!Origin.6egin,;
intlimit ' =;
limit 'Con/ert.ToInt#?+>icroso%t.7isual6asic.FileSystem.File1en+%ilename, @si-e,;
longamountsent ' =;
longi ' =; w&ile+A+i '' limit,, "
6u%%er ' newyte9si-e:; 6inaryeader.ead+6u%%er3 =3 si-e,; 6inaryeader.6aseStream.See!+=3 See!Origin.Current,;
OutputFileStream ' newSystem.IO.FileStream+(c)**split**(< %name < (.(icroso%t.7isual6asic.Strings.Format+i < #3 ((,3 File>ode.Create,;
6inaryWriter ' new6inaryWriter+OutputFileStream,; 6inaryWriter.Write+6u%%er,;
OutputFileStream.Flus&+,; 6inaryWriter.Close+,; OutputFileStream.Close+,;
amountsent ' amountsent < si-e; i ' i < #;
i%+amountsent B>icroso%t.7isual6asic.FileSystem.File1en+%ilename,, "
-
8/11/2019 Watermarking Relational Databases Using Optimization
65/71
-
8/11/2019 Watermarking Relational Databases Using Optimization
66/71
pulic/oiddecode+, " string9: %iles ' Directory.GetFiles+(c)**split(,; %oreac&+string%ile in%iles, " File.Delete+(c)**output**(