You are on page 1of 42

Abstract

Access control mechanisms protect sensitive information from unauthorized


users. However, when sensitive information is shared and a Privacy Protection
Mechanism (PPM) is not in place, an authorized user can still compromise the
privacy of a person leading to identity disclosure. A PPM can use suppression and
generalization of relational data to anonymize and satisfy privacy requirements,
e.g., k-anonymity and l-diversity, against identity and attribute disclosure.
However, privacy is achieved at the cost of precision of authorized information. In
this paper, we propose an accuracy-constrained privacy-preserving access control
framework. The access control policies define selection predicates available to
roles while the privacy requirement is to satisfy the k-anonymity or l-diversity. An
additional constraint that needs to be satisfied by the PPM is the imprecision bound
for each selection predicate. The techniques for workload-aware anonymization for
selection predicates have been discussed in the literature. However, to the best of
our knowledge, the problem of satisfying the accuracy constraints for multiple
roles has not been studied before. In our formulation of the aforementioned
problem, we propose heuristics for anonymization algorithms and show
empirically that the proposed approach satisfies imprecision bounds for more
permissions and has lower total imprecision than the current state of the art.

TABLE OF CONTENTS
CHAPTER NO. TITLE

PAGE NO.

ABSTRACT (ENGLISH)
LIST OF FIGURES
LIST OF ABBREVIATIONS
1

INTRODUCTION
1.1 Role Based Access Control and Privacy Definitions
1.2 Access Control for Relational Data
1.3 Predicate Evaluation and Imprecision
1.4 Top down Selection Mondrian

LITERATURE SURVEY
2.1 Database Security Concepts and Challenges
2.2 Protecting Respondents Identities in Microdata
2.3 Privacy-Preserving Data Publishing
2.4 L-Diversity: Privacy Beyond k-anonymity
2.5 Workload-Aware Anonymization Techniques
2.6 K-Anonymization as Spatial Indexing

SYSTEM ORGANIZATION
3.1 System Architecture Design
3.2 Feature Extraction

3.3 Data Flow Diagram


4

SYSTEM ANALYSIS
4.1 Existing System
4.2 Proposed System

REQUIREMENT SPECIFICATION
5.1 System Requirements
5.1.1 Hardware Required
5.1.2 Software Required
5.2 MICROSOFT.NET FRAMEWORK

IMPLEMENTATION RESULT
6.1 Coding
6.2 Screen Shots

CONCLUSION

REFERENCES

CHAPTER 1
INTRODUCTION

Organizations collect and analyze consumer data to improve their services.


Access Control Mechanisms (ACM) are used to ensure that only authorized
information is available to users. However, sensitive information can still be
misused by authorized users to compromise the privacy of consumers. The concept
of privacy-preservation for sensitive data can require the enforcement of privacy
policies or the protection against identity disclosure by satisfying some privacy
requirements. In this approach, we investigate privacy-preservation from the
anonymity aspect. The sensitive information, even after the removal of identifying
attributes, is still susceptible to linking attacks by the authorized users. This
problem has been studied extensively in the area of micro data publishing and
privacy definitions, e.g., k-anonymity, l-diversity, and variance diversity.
Anonymization algorithms use suppression and generalization of records to satisfy
privacy requirements with minimal distortion of micro data. The anonymity
techniques can be used with an access control mechanism to ensure both security
and privacy of the sensitive information. The privacy is achieved at the cost of
accuracy and imprecision is introduced in the authorized information under an
access control policy.
We use the concept of imprecision bound for each permission to define a
threshold on the amount of imprecision that can be tolerated. Existing
workloadaware anonymization techniques minimize the imprecision aggregate for
all queries and the imprecision added to each permission/query in the anonymized
micro data is not known. Making the privacy requirement more stringent (e.g.,
increasing the value of k or l) results in additional imprecision for queries.
However,the problem of satisfying accuracy constraints for individual permissions
in a policy/workload has not been studied before. The heuristics proposed in this
paper for accuracy-constrained privacy-preserving access control are also relevant
in the context of workload-aware anonymization. The anomization for continuous
data publishing has been studied in literature. In this approach the focus is on a
static relational table that is anonymized only once. To exemplify our approach,
role-based access control is assumed. However, the concept of accuracy constraints
for permissions can be applied to any privacy-preserving security policy, e.g.,
discretionary access control.

Fig.1. Access Control Policy


1.1 ROLE BASED ACCESS CONTROL AND PRIVACY DEFINITIONS
A role-based access control and privacy definitions based on anonymity are
over-viewed. Query evaluation semantics, imprecision, and the Selection Mondrian
algorithm. Given a relation T fA1;A2; . . .;Ang, where Ai is an attribute, T is the
anonymized version of the relation T. We assume that T is a static relational table.
The attributes can be of the following types:
* Identifier. Attributes, e.g., name and social security, that can uniquely
identify an individual. These attributes are completely removed from the
anonymized relation.
* Quasi-identifier (QI). Attributes, e.g., gender, zip code, birth date, that can
potentially identify an individual based on other information available to an
adversary. QI attributes are generalized to satisfy the anonymity requirements.

* Sensitive attribute. Attributes, e.g., disease or salary, that if associated to a


unique individual will cause privacy breach.
1.2 ACCESS CONTROL FOR RELATIONAL DATA
Fine-grained access control for relational data allows to define tuple-level
permissions, e.g., Oracle VPD and SQL. For evaluating user queries, most
approaches assume a Truman model. In this model, a user query is modified by the
access control mechanism and only the authorized tuples are returned. Column
level access control llows queries to execute on the authorized column of the
elational data only. Cell level access control for relational data is implemented by
replacing the unauthorized cell values by NULL values. Role-based Access
Control (RBAC) allows defining permissions on objects based on roles in an
organization. An RBAC policy configuration is composed of a set of Users (U), a
set of Roles (R), and a set of Permissions (P). For the relational RBAC model, we
assume that the selection predicates on the QI attributes define a permission. UA is
a user-to-role (U - R) assignment relation and PA is a roleto- permission (R - P)
assignment relation. A role hierarchy (RH) defines an inheritance relationship
among roles and is a partial order on roles (R R). Each permission defines a hyperrectangle in the tuple space and all the tuples enclosed by this hyper-rectangle are
authorized to the role assigned to the permission. In practice, when a user assigned
to a role executes a query, the tuples satisfying the conjunction of the query
predicate and the permission are returned.
1.3PREDICATE EVALUATION AND IMPRECISION
1.4 The query predicate evaluation semantics have been discussed. For query
predicate evaluation over a table, say T, a tuple is included in the result if all the
attribute values satisfy the query predicate. Here, we only consider conjunctive
queries (The disjunctive queries can be expressed as a union of conjunctive
queries), where each query can be expressed as a d-dimensional hyperrectangle. The semantics for query evaluation on an anonymized table T needs
to be defined. When the equivalence class partition (Each equivalence class can
be represented as a d-dimensional hyper-rectangle) is fully enclosed inside the

query region, all tuples in the equivalence class are part of the query result.
Uncertainty in query evaluation arises when a partition overlaps the query
region but is not fully enclosed. In this case, there can be many possible
semantics. We discuss the following three choices:
1. Uniform. Assuming the uniform distribution of tuples in the overlapping
partitions, include tuples from all partitions according to the ratio of overlap
between the query and the partition. Query evaluation under this option might
under-count or overcount the query result depending upon the original
distribution of tuples in the partition region. Most of the literature uses this
uniform distribution semantics to compare anonymity techniques over selection
tasks. However, the choice of the sensitive attribute value for the selected tuples
from an overlapping partition is not defined under uniform semantics. For
access control, a tuples QI attribute values along with the sensitive attribute
value need to be returned.
2. Overlap. Include all tuples in all partitions that overlap the query region. This
option will add false positives to the original query result.
3. Enclosed. Discard all tuples in all partitions that partially overlap the query
region. This option will have false negatives with respect to the original query
result.
1.4. TOP DOWN SELECTION MONDRIAN
Top Down Selection Mondrian (TDSM) algorithm is proposed by LeFevre
et al. for a given query workload. This is the current state of the art for
queryworkload- based anonymization. The objective of TDSM is to minimize the
total imprecision for all queries while the imprecision bounds for queries have not
been considered. The anonymization for a given query workload with imprecision
bounds has not investigated before to the best of our knowledge. We compare our
results with DSM in the experiments section. The algorithm presented in is similar

to the kd-tree construction.TDSM starts with the whole tuple space as one partition
and then partitions are recursively divided till the time new partitions meet the
privacy requirement. To divide a partition, two decisions need to be made, i)
Choosing a split value along each dimension, and ii) Choosing a dimension along
which to split. In the TDSM algorithm the split value is chosen along the median
and then the dimension is selected along which the sum of imprecision for all
queries is minimum. The time complexity of TDSM has not been reported in and is
OdjQjnlgn, where d is the number of dimensions of a tuple, Q is the

CHAPTER 2
LITERATURE SURVEY
Literature survey is the most important step in software development
process. Before developing the tool it is necessary to determine the time factor,

economy and company strength. Once these things are satisfied, then the next step
is to determine which operating system and language can be used for developing
the tool. Once the programmers start building the tool the programmers need lot of
external support. This support can be obtained from senior programmers, from
book or from websites. Before building the system the above consideration are
taken into account for developing the proposed system.
The major part of the project development sector considers and fully survey
all the required needs for developing the project. For every project Literature
survey is the most important sector in software development process. Before
developing the tools and the associated designing it is necessary to determine and
survey the time factor, resource requirement, man power, economy, and company
strength. Once these things are satisfied and fully surveyed, then the next step is to
determine about the software specifications in the respective system such as what
type of operating system the project would require, and what are all the necessary
software are needed to proceed with the next step such as developing the tools, and
the associated operations.
2.1
DATABASE
SECURITY-CONCEPTS,
APPROACHES,
CHALLENGES - E. BERTINO AND R. SANDHU - 2005

AND

As organizations increase their reliance on, possibly distributed, information


systems for daily business, they become more vulnerable to security breaches even
as they gain productivity and efficiency advantages. Though a number of
techniques, such as encryption and electronic signatures, are currently available to
protect data when transmitted across sites, a truly comprehensive approach for data
protection must also include mechanisms for enforcing access control policies
based on data contents, subject qualifications and characteristics, and other
relevant contextual information, such as time. It is well understood today that the
semantics of data must be taken into account in order to specify effective access
control policies. Also, techniques for data integrity and availability specifically

tailored to database systems must be adopted. In this respect, over the years the
database security community has developed a number of different techniques and
approaches to assure data confidentiality, integrity, and availability. However,
despite such advances, the database security area faces several new challenges.
Factors such as the evolution of security concerns, the "disintermediation of
access to data, new computing paradigms and applications, such as grid-based
computing and on-demand business, have introduced both new security
requirements and new contexts in which to apply and possibly extend current
approaches. In this paper, we first survey the most relevant concepts underlying the
notion of database security and summarize the most well-known techniques. We
focus on access control systems, on which a large body of research has been
devoted, and describe the key access control models, namely, the discretionary and
mandatory access control models, and the role-based access control (RBAC)
model. We also discuss security for advanced data management systems, and cover
topics such as access control for XML. We then discuss current challenges for
database security and some preliminary approaches that address some of these
challenges.
2.2 PROTECTING RESPONDENTS IDENTITIES IN MICRODATA
RELEASE - P. SAMARATI - 2005
Today's globally networked society places great demand on the
dissemination and sharing of information. While in the past released information
was mostly in tabular and statistical form, many situations call today for the release
of specific data (microdata). In order to protect the anonymity of the entities
(called respondents) to which information refers, data holders often remove or
encrypt explicit identifiers such as names, addresses, and phone numbers.
Deidentifying data, however, provides no guarantee of anonymity. Released
information often contains other data, such as race, birth date, sex, and ZIP code,
that can be linked to publicly available information to reidentify respondents and
inferring information that was not intended for disclosure. In this paper we address
the problem of releasing microdata while safeguarding the anonymity of the
respondents to which the data refer. The approach is based on the definition of kanonymity. A table provides k-anonymity if attempts to link explicitly identifying
information to its content map the information to at least k entities. We illustrate
how k-anonymity can be provided without compromising the integrity (or

truthfulness) of the information released by using generalization and suppression


techniques. We introduce the concept of minimal generalization that captures the
property of the release process not to distort the data more than needed to achieve
k-anonymity, and present an algorithm for the computation of such a
generalization. We also discuss possible preference policies to choose among
different minimal generalizations.
2.3 PRIVACY-PRESERVING DATA PUBLISHING: A SURVEY OF
RECENT DEVELOPMENTS - B. FUNG, K. WANG, R. CHEN - 2010
The collection of digital information by governments, corporations, and
individuals has created tremendous opportunities for knowledge- and informationbased decision making. Driven by mutual benefits, or by regulations that require
certain data to be published, there is a demand for the exchange and publication of
data among various parties. Data in its original form, however, typically contains
sensitive information about individuals, and publishing such data will violate
individual privacy. The current practice in data publishing relies mainly on policies
and guidelines as to what types of data can be published and on agreements on the
use of published data. This approach alone may lead to excessive data distortion or
insufficient protection. Privacy-preserving data publishing (PPDP) provides
methods and tools for publishing useful information while preserving data privacy.
Recently, PPDP has received considerable attention in research communities, and
many approaches have been proposed for different data publishing scenarios. In
this survey, we will systematically summarize and evaluate different approaches to
PPDP, study the challenges in practical data publishing, clarify the differences and
requirements that distinguish PPDP from other related problems, and propose
future research directions.
2.4 L-DIVERSITY: PRIVACY BEYOND
MACHANAVAJJHALA, D. KIFER - 2007

K-ANONYMITY

A.

In this approach, we show using two simple attacks that a k-anonymized


dataset has some subtle but severe privacy problems. First, an attacker can discover
the values of sensitive attributes when there is little diversity in those sensitive
attributes. This is a known problem. Second, attackers often have background
knowledge, and we show that k-anonymity does not guarantee privacy against

attackers using background knowledge. We give a detailed analysis of these two


attacks, and we propose a novel and powerful privacy criterion called -diversity
that can defend against such attacks. In addition to building a formal foundation for
-diversity, we show in an experimental evaluation that -diversity is practical and
can be implemented efficiently.
2.5 WORKLOAD-AWARE ANONYMIZATION TECHNIQUES
LARGE-SCALE DATASETS - K. LEFEVRE, D. DEWITT - 2008

FOR

Protecting individual privacy is an important problem in microdata


distribution and publishing. Anonymization algorithms typically aim to satisfy
certain privacy definitions with minimal impact on the quality of the resulting data.
While much of the previous literature has measured quality through simple onesize-fits-all measures, we argue that quality is best judged with respect to the
workload for which the data will ultimately be used. This article provides a suite of
anonymization algorithms that incorporate a target class of workloads, consisting
of one or more data mining tasks as well as selection predicates. An extensive
empirical evaluation indicates that this approach is often more effective than
previous techniques. In addition, we consider the problem of scalability. The article
describes two extensions that allow us to scale the anonymization algorithms to
datasets much larger than main memory. The first extension is based on ideas from
scalable decision trees, and the second is based on sampling. A thorough
performance evaluation indicates that these techniques are viable in practice.
2.6 K-ANONYMIZATION AS SPATIAL INDEXING: TOWARD SCALABLE
AND INCREMENTAL ANONYMIZATION - T. IWUCHUKWU AND J.
NAUGHTON - 2007
In this approach we observe that k-anonymizing a data set is strikingly
similar to building a spatial index over the data set, so similar in fact that classical
spatial indexing techniques can be used to anonymize data sets. We use this
observation to leverage over 20 years of work on database indexing to provide
efficient and dynamic anonymization techniques. Experiments with our
implementation show that the R-tree index-based approach yields a batch
anonymization algorithm that is orders of magnitude more efficient than previously
proposed algorithms and has the advantage of supporting incremental updates.

Finally, we show that the anonymizations generated by the R-tree approach do not
sacrifice quality in their search for efficiency; in fact, by several previously
proposed quality metrics, the compact partitioning properties of R-trees generate
anonymizations superior to those generated by previously proposed anonymization
algorithms.

CHAPTER 3
SYSTEM ARCHITECTURE DESIGN

Figure 3.1.1 System Architecture Design


3.2 FEATURE EXTRACTION
Access control mechanisms for databases allow queries only on the
authorized part of the database. Predicate based fine-grained access control has

further been proposed, where user authorization is limited to pre-defined


predicates. However, studying the interaction between the access control
mechanisms and the privacy protection mechanisms has been missing. Recently,
Chaudhuri et al. have studied access control with privacy mechanisms. They use
the definition of differential privacy whereby random noise is added to original
query results to satisfy privacy constraints. However, they have not considered the
accuracy constraints for permissions. We define the privacy requirement in terms
of k-anonymity. It has been shown by Li et al. that after sampling, k-anonymity
offers similar privacy guarantees as those of differential privacy. The proposed
accuracy-constrained privacypreserving access control framework allows the
access control administrator to specify imprecision constraints that the privacy
protection mechanism is required to meet along with the privacy requirements.

3.3 DATA FLOW DIAGRAM

Admin

View
View Receivers
Senders

Sender

Select
the
Receiver
Send
Processing
Decryption
for
Verify the Receiver mail-id
toKey
Send
Message
Decryption
to
Receiver
Key
STOP
to Send
Message
Encrypt
the
Message to

Receiver

Message
View
Receive
Message
Message
and
Received
Decrypted
Enter Decryption
Decrypt
Message

Valid

Invalid
Block the Message
to Decrypt

CHAPTER 4
SYSTEM ANALYSIS
4.1. EXISTING SYSTEM
Organizations collect and analyze consumer data to improve their services.
Access Control Mechanisms (ACM) are used to ensure that only authorized
information is available to users. However, sensitive information can still be
misused by authorized users to compromise the privacy of consumers. The concept

of privacy-preservation for sensitive data can require the enforcement of privacy


policies or the protection against identity disclosure by satisfying some privacy
requirements. Existing workload aware anonymization techniques minimize the
imprecision aggregate for all queries and the imprecision added to each
permission/query in the anonymized micro data is not known. Making the privacy
requirement more stringent (e.g., increasing the value of k or l) results in additional
imprecision for queries.
Disadvantages:
1. There is no privacy for users
2. The sensitive information,even after the removal of identifying
attributes,is still susceptible to linking attacks by the authorized users.
4.2. PROPOSED SYSTEM
The heuristics proposed in this paper for accuracy-constrained privacypreserving access control are also relevant in the context of workload-aware
anonymization. The anonymization for continuous data publishing has been
studied in literature. In this paper the focus is on a static relational table that is
anonymized only once. To exemplify our approach, role-based access control is
assumed. However, the concept of accuracy constraints for permissions can be
applied to any privacy-preserving security policy, e.g., discretionary access control.
Advantages:
1. Accuracy constrained privacy preserving access.
2. its maintain datas in secure manner.

CHAPTER 5
REQUIREMENT SPECIFICATION
5.1 System Requirements
5.1.1 Hardware Requirements
System

: Pentium IV 2.4 GHz

Hard Disk

: 40 GB

Floppy Drive

: 1.44 Mb

Monitor

: 15 VGA Colour

Mouse

: Logitech

Ram

: 512 Mb

5.1.2 Software Requirements


Operating system

: Windows XP

Technology Used

: Microsoft .NET

Backend Used

: SQL Server

5.2 MICROSOFT.NET FRAMEWORK


Features OF .Net

Microsoft .NET is a set of Microsoft software technologies for rapidly


building and integrating XML Web services, Microsoft Windows-based
applications, and Web solutions. The .NET Framework is a language-neutral
platform for writing programs that can easily and securely interoperate. Theres no
language barrier with .NET: there are numerous languages available to the
developer including Managed C++, C#, Visual Basic and Java Script. The .NET
framework provides the foundation for components to interact seamlessly, whether
locally or remotely on different platforms. It standardizes common data types and
communications protocols so that components created in different languages can
easily interoperate.
.NET is also the collective name given to various software
components built upon the .NET platform. These will be both products (Visual
Studio.NET and Windows.NET Server, for instance) and services (like Passport,
.NET My Services, and so on).
THE .NET FRAMEWORK
The .NET Framework has two main parts:
1. The Common Language Runtime (CLR).
2. A hierarchical set of class libraries.
The CLR is described as the execution engine of .NET. It provides the
environment within which programs run. The most important features are
Conversion from a low-level assembler-style language, called
Intermediate Language (IL), into code native to the platform being
executed on.
Memory management, notably including garbage collection.

Checking and enforcing security restrictions on the running code.


Loading and executing programs, with version control and other such
features.
The following features of the .NET framework are also worth
description:
Managed Code
The code that targets .NET, and which contains certain extra Information metadata - to describe itself. Whilst both managed and unmanaged code can run
in the runtime, only managed code contains the information that allows the CLR to
guarantee, for instance, safe execution and interoperability.
Managed Data
With Managed Code comes Managed Data. CLR provides memory
allocation and Deal location facilities, and garbage collection. Some .NET
languages use Managed Data by default, such as C#, Visual Basic.NET and
JScript.NET, whereas others, namely C++, do not. Targeting CLR can, depending
on the language youre using, impose certain constraints on the features available.
As with managed and unmanaged code, one can have both managed and
unmanaged data in .NET applications - data that doesnt get garbage collected but
instead is looked after by unmanaged code.

Common Type System


The CLR uses something called the Common Type System (CTS) to strictly
enforce type-safety. This ensures that all classes are compatible with each other, by
describing types in a common way. CTS define how types work within the

runtime, which enables types in one language to interoperate with types in another
language, including cross-language exception handling. As well as ensuring that
types are only used in appropriate ways, the runtime also ensures that code doesnt
attempt to access memory that hasnt been allocated to it.
Common Language Specification
The CLR provides built-in support for language interoperability. To ensure
that you can develop managed code that can be fully used by developers using any
programming language, a set of language features and rules for using them called
the Common Language Specification (CLS) has been defined. Components that
follow these rules and expose only CLS features are considered CLS-compliant.
THE CLASS LIBRARY
.NET provides a single-rooted hierarchy of classes, containing over
7000 types. The root of the namespace is called System; this contains basic types
like Byte, Double, Boolean, and String, as well as Object. All objects derive from
System. Object. As well as objects, there are value types. Value types can be
allocated on the stack, which can provide useful flexibility. There are also efficient
means of converting value types to object types if and when necessary.
The set of classes is pretty comprehensive, providing collections, file,
screen, and network I/O, threading, and so on, as well as XML and database
connectivity.
The class library is subdivided into a number of sets (or namespaces),
each providing distinct areas of functionality, with dependencies between the
namespaces kept to a minimum.
LANGUAGES SUPPORTED BY .NET

The multi-language capability of the .NET Framework and Visual


Studio .NET enables developers to use their existing programming skills to build
all types of applications and XML Web services. The .NET framework supports
new versions of Microsofts old favorites Visual Basic and C++ (as VB.NET and
Managed C++), but there are also a number of new additions to the family.

Visual Basic .NET has been updated to include many new and
improved language features that make it a powerful object-oriented programming
language. These features include inheritance, interfaces, and overloading, among
others. Visual Basic also now supports structured exception handling, custom
attributes and also supports multi-threading.
Visual Basic .NET is also CLS compliant, which means that any CLScompliant language can use the classes, objects, and components you create in
Visual Basic .NET.
Managed Extensions for C++ and attributed programming are just
some of the enhancements made to the C++ language. Managed Extensions
simplify the task of migrating existing C++ applications to the new .NET
Framework.
C# is Microsofts new language. Its a C-style language that is
essentially C++ for Rapid Application Development. Unlike other languages, its
specification is just the grammar of the language. It has no standard library of its
own, and instead has been designed with the intention of using the .NET libraries
as its own.

Microsoft Visual J# .NET provides the easiest transition for Javalanguage developers into the world of XML Web Services and dramatically
improves the interoperability of Java-language programs with existing software
written in a variety of other programming languages.
Active State has created Visual Perl and Visual Python, which
enable .NET-aware applications to be built in either Perl or Python. Both products
can be integrated into the Visual Studio .NET environment. Visual Perl includes
support for Active States Perl Dev Kit.
Other languages for which .NET compilers are available include

FORTRAN
COBOL
Eiffel

ASP.NET
XML

Windows Forms
WEB

SERVICES
Base Class Libraries
Common Language Runtime
Operating System

Figure 5.2.1 .Net Framework


C#.NET is also compliant with CLS (Common Language Specification) and
supports structured exception handling. CLS is set of rules and constructs that
are supported by the CLR (Common Language Runtime). CLR is the runtime
environment provided by the .NET Framework; it manages the execution of the
code and also makes the development process easier by providing services
C#.NET is a CLS-compliant language. Any objects, classes, or components that
created in C#.NET can be used in any other CLS-compliant language. In
addition, we can use objects, classes, and components created in other CLScompliant languages in C#.NET .The use of CLS ensures complete
interoperability among applications, regardless of the languages used to create
the application.
CONSTRUCTORS AND DESTRUCTORS:
Constructors are used to initialize objects, whereas destructors are used to
destroy them. In other words, destructors are used to release the resources
allocated to the object. In C#.NET the sub finalize procedure is available. The
sub finalize procedure is used to complete the tasks that must be performed
when an object is destroyed. The sub finalize procedure is called automatically
when an object is destroyed. In addition, the sub finalize procedure can be
called only from the class it belongs to or from derived classes.

GARBAGE COLLECTION
Garbage Collection is another new feature in C#.NET. The .NET Framework
monitors allocated resources, such as objects and variables. In addition, the
.NET Framework automatically releases memory for reuse by destroying
objects that are no longer in use. In C#.NET, the garbage collector checks for
the objects that are not currently in use by applications. When the garbage
collector comes across an object that is marked for garbage collection, it
releases the memory occupied by the object.
OVERLOADING
Overloading is another feature in C#. Overloading enables us to define
multiple procedures with the same name, where each procedure has a different
set of arguments. Besides using overloading for procedures, we can use it for
constructors and properties in a class.
MULTITHREADING:
C#.NET also supports multithreading. An application that supports
multithreading can handle multiple tasks simultaneously, we can use
multithreading to decrease the time taken by an application to respond to user
interaction.
STRUCTURED EXCEPTION HANDLING
C#.NET supports structured handling, which enables us to detect and
remove errors at runtime. In C#.NET, we need to use TryCatchFinally
statements to create exception handlers. Using TryCatchFinally statements,
we can create robust and effective exception handlers to improve the
performance of our application.

THE .NET FRAMEWORK


The .NET Framework is a new computing platform that simplifies
application development in the highly distributed environment of the Internet.

OBJECTIVES OF. NET FRAMEWORK


1. To provide a consistent object-oriented programming environment whether
object codes is stored and executed locally on Internet-distributed, or executed
remotely.
2. To provide a code-execution environment to minimizes software deployment
and guarantees safe execution of code.
3. Eliminates the performance problems.
There are different types of application, such as Windows-based applications
and Web-based applications.

CHAPTER 6
IMPLEMENTATION AND RESULTS
6.1 CODING
REGISTRATION

Imports System.Data.SqlClient
Partial Class Register
Inherits System.Web.UI.Page
Dim S As String = ""
Dim Ws As New CodeClass
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
If Page.IsPostBack = False Then
Clear()
P1.Visible = True
P2.Visible = False
P3.Visible = False
End If
End Sub
Protected Sub CmdSubmit_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles CmdSubmit.Click
Dim Str As String = ""
If Trim(TxtName.Text) = "" Then
Str += "Enter Name\n"
End If
If Trim(TxtMail.Text) = "" Then
Str += "Enter Mail-ID\n"
End If
If Trim(TxtMobile.Text) = "" Then
Str += "Enter Mobile Number\n"
End If
If Val(TxtAge.Text) <= 0 Then
Str += "Enter Age\n"
End If
If Trim(TxtDOB.Text) = "" Then
Str += "Enter Date Of Birth\n"
End If
If Trim(TxtCity.Text) = "" Then
Str += "Enter City\n"
End If
If Trim(TxtState.Text) = "" Then
Str += "Enter State\n"
End If
If Trim(TxtCntry.Text) = "" Then
Str += "Enter Country\n"
End If
Dim Cn As New SqlConnection(Ws.Con)
Cn.Open()
Dim Cmd As SqlCommand
S = "Select Mail From Register Where Mail=@Ml"
Cmd = New SqlCommand(S, Cn)
Cmd.Parameters.Add(New SqlParameter("@Ml", TxtMail.Text))
If Convert.ToString(Cmd.ExecuteScalar) = TxtMail.Text Then
Str += "Mail-ID Already Exist...\n"
End If
Cmd.Dispose()
Cmd.Parameters.Clear()

If Trim(Str) <> "" Then


ClientScript.RegisterStartupScript(Me.GetType(), "myalert",
"alert('" & Str & "');", True)
Exit Sub
End If
Dim RN As Long = Ws.RandomNumber(13333, 3487384)
Ws.MailSending(TxtMail.Text, "Admin - Security Code", "Your Security
Code is : " & Ws.Encrypt(RN) & "")
Session("Key") = RN.ToString()
Session("EID") = TxtEmpID.Text
P1.Visible = False
P2.Visible = False
P3.Visible = True
End Sub
Private Function IncrID() As Long
Dim Cn As New SqlConnection(Ws.Con)
Cn.Open()
Dim Cmd As SqlCommand
S = "Select Max(EmpID) From Register"
Cmd = New SqlCommand(S, Cn)
If Val(Convert.ToString(Cmd.ExecuteScalar)) <= 0 Then
TxtEmpID.Text = 1
ElseIf Val(Convert.ToString(Cmd.ExecuteScalar)) >= 1 Then
TxtEmpID.Text = Val(Convert.ToString(Cmd.ExecuteScalar)) + 1
End If
Cmd.Dispose()
Cn.Close()
End Function
Protected Sub CmdReset_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles CmdReset.Click
Clear()
End Sub
Private Sub Clear()
TxtCity.Text = ""
TxtMail.Text = ""
TxtMobile.Text = ""
TxtName.Text = ""
TxtAge.Text = ""
TxtDOB.Text = ""
TxtCntry.Text = ""
TxtState.Text = ""
DrpType.SelectedIndex = 0
IncrID()
End Sub
Protected Sub CmdCheck_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles CmdCheck.Click
If Session("Key").ToString() = Ws.Decrypt(TxtSecCd.Text) Then
Dim Cn As New SqlConnection(Ws.Con)
Cn.Open()

Dim Cmd As SqlCommand


Dim Pwd As String = ""
Pwd = TxtMail.Text.Substring(0, 3) & TxtMobile.Text.Substring(0,
2) & TxtAge.Text
S = "Insert Into Register
Values(@EID,@Nm,@Ml,@Pwd,@Mb,@Age,@DOB,@City,@State,@Country,@Type,1)"
Cmd = New SqlCommand(S, Cn)
Cmd.Parameters.Add(New SqlParameter("@EID",
Session("EID").ToString()))
Cmd.Parameters.Add(New SqlParameter("@Nm", UCase(TxtName.Text)))
Cmd.Parameters.Add(New SqlParameter("@Ml", TxtMail.Text))
Cmd.Parameters.Add(New SqlParameter("@Pwd", Ws.Encrypt(Pwd)))
Cmd.Parameters.Add(New SqlParameter("@Mb", TxtMobile.Text))
Cmd.Parameters.Add(New SqlParameter("@Age", TxtAge.Text))
Cmd.Parameters.Add(New SqlParameter("@DOB", TxtDOB.Text))
Cmd.Parameters.Add(New SqlParameter("@City", UCase(TxtCity.Text)))
Cmd.Parameters.Add(New SqlParameter("@State",
UCase(TxtState.Text)))
Cmd.Parameters.Add(New SqlParameter("@Country",
UCase(TxtCntry.Text)))
Cmd.Parameters.Add(New SqlParameter("@Type", UCase(DrpType.Text)))
Cmd.ExecuteNonQuery()
Cmd.Dispose()
Cn.Close()
Ws.MailSending(TxtMail.Text, "Administrator - Registered
Successfully", "Keep this mail more Safe. Kindly keep this mail in your inbox
without delete it.<br><hr color=red size=1><b>Employee ID : </b>" &
Session("EID").ToString() & "<br><b>Your Password is : </b>" & Pwd & "")
Clear()
P1.Visible = False
P2.Visible = True
P3.Visible = False
Else

ClientScript.RegisterStartupScript(Me.GetType(), "myalert",
"alert('Invalid Security Code');", True)
End If
End Sub
End Class

SEND MESSAGE
Imports System.Data.SqlClient
Imports Microsoft.Office.Interop
Partial Class ShareResources
Inherits System.Web.UI.Page
Dim Ws As New CodeClass
Dim S As String = ""
Dim a As String = ""

Protected Sub Page_Load(ByVal sender As Object, ByVal e As


System.EventArgs) Handles Me.Load
If Page.IsPostBack = False Then
a = Session("UN").ToString()
Session("UN") = a
Lbl.Text = a
TxtEmpID.Text = Ws.GetEmpID(Lbl.Text)
LoadCmb()
End If
End Sub
Private Sub LoadCmb()
Dim Cn As New SqlConnection(Ws.Con)
Dim Cmd As SqlCommand
Dim dr As SqlDataReader
Cn.Open()
TxtEmpMail.Text = ""
DrpEmpNameID.Items.Clear()
S = "Select Name + ' - ' + cast(EmpID as Varchar) 'Name',EmpID From
Register Where Type='RECEIVER' And Active=1 Order By Name Asc"
Cmd = New SqlCommand(S, Cn)
dr = Cmd.ExecuteReader
DrpEmpNameID.Items.Add("---------------------Select--------------------")
While dr.Read
If Val(Ws.GetEmpID(Lbl.Text)) <> Val(Convert.ToString(dr(1))) Then
DrpEmpNameID.Items.Add(dr(0).ToString())
End If
End While
dr.Close()
Cmd.Dispose()
Cmd.Parameters.Clear()
Cn.Close()
End Sub
Protected Sub DrpEmpNameID_SelectedIndexChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles DrpEmpNameID.SelectedIndexChanged
If Trim(DrpEmpNameID.Text) <> "" And DrpEmpNameID.Text <>
"----------------------Select--------------------" Then
Dim x() As String
x = DrpEmpNameID.Text.Split(" - ")
Dim EID As Long = 0
EID = Val(x(2))
TxtEmpMail.Text = Ws.GetMailIDFromEmpID(EID)
End If
End Sub
Protected Sub CmdShare_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles CmdShare.Click
Dim Str As String = ""
Dim Ext As String = ""
If Trim(TxtEmpMail.Text) = "" Then
Str += "Select Proper Employee to Transfer Data\n"

End If
If Trim(TxtSubject.Text) = "" Then
Str += "Enter Subject\n"
End If
If Trim(TxtDesc.Text) = "" Then
Str += "Enter Description\n"
End If
If FileUpload1.FileName.ToString() = "" Then
Str += "Select Attachment\n"
End If
Ext = System.IO.Path.GetExtension(FileUpload1.PostedFile.FileName)
If Ext <> ".txt" And Ext <> ".doc" And Ext <> ".docx" Then
Str += "Invalid File Format\n"
End If
If Trim(Str) <> "" Then
ClientScript.RegisterStartupScript(Me.GetType(), "myalert",
"alert('" & Str & "');", True)
Exit Sub
End If
Dim Cn As New SqlConnection(Ws.Con)
Cn.Open()
Dim Cmd As SqlCommand
Dim Subj As String = ""
Dim Descr As String = ""
Dim FileContent As String = ""
Subj = Ws.Encrypt(UCase(TxtSubject.Text))
Descr = Ws.Encrypt(TxtDesc.Text)
Dim FilePath As String = Request.PhysicalApplicationPath + "Uploads/"
+ System.IO.Path.GetFileName(FileUpload1.FileName)
FileUpload1.SaveAs(FilePath)
Dim filebytes As Byte() = New
Byte(FileUpload1.PostedFile.InputStream.Length - 1) {}
FileUpload1.PostedFile.InputStream.Read(filebytes, 0,
filebytes.Length)
Dim filesiz As String = CSng(FileUpload1.PostedFile.ContentLength) /
1024
Dim splitfilesize As String = Convert.ToString(filesiz)
Dim binary1 As String = ""
For i As Integer = 0 To splitfilesize.Length - 1
Dim c As Char = splitfilesize(i)
Dim binary As String = c
binary1 = binary1 & binary
Next
Dim Src As String = ""
If Ext = ".txt" Then
Dim tr As IO.TextReader = New IO.StreamReader(FilePath)
Src = tr.ReadToEnd
tr.Close()
ElseIf Ext = ".doc" Or Ext = ".docx" Then
Dim word As New Microsoft.Office.Interop.Word.Document

Dim objWord As Word.ApplicationClass


Dim strText As String
objWord = New Word.Application()
With objWord
.Visible = False
.Documents.Open(FilePath, , True)
.WordBasic.EditSelectAll()
.WordBasic.SetDocumentVar("MyVar",
.ActiveDocument.ActiveWindow.Selection.Text)
strText = .WordBasic.GetDocumentVar("MyVar")
Src = InsertNewLineChars(Strings.Left(strText, Len(strText) 1))
.Documents.Close(0)
.Quit()
End With
End If
FileContent = Src
Dim RK As Long = 0
RK = Ws.RandomNumber(23232, 32433)
Dim Msg As String = ""
Msg = "Dear " & Ws.GetOwnerName(TxtEmpMail.Text) & "<br>A document
shared to you by the Employee : " & Ws.GetOwnerName(Lbl.Text) & ".<br>Message
Subject : " & UCase(TxtSubject.Text) & "<br>Decryption Key : " &
Ws.Encrypt(RK) & "."
Ws.MailSending(TxtEmpMail.Text, "Message From - " & Lbl.Text & "",
Msg)
S = "Insert Into SharedResources
Values(@ShareID,@FromEmpID,@ToEmpID,@ToMail,
(GetDate()),@Subject,@Description,@MetaData,@FileName,@Sts,@Active,@DecKey)"
Cmd = New SqlCommand(S, Cn)
Cmd.Parameters.Add(New SqlParameter("@ShareID", IncrID))
Cmd.Parameters.Add(New SqlParameter("@FromEmpID", TxtEmpID.Text))
Cmd.Parameters.Add(New SqlParameter("@ToEmpID",
Ws.GetEmpID(TxtEmpMail.Text)))
Cmd.Parameters.Add(New SqlParameter("@ToMail", TxtEmpMail.Text))
Cmd.Parameters.Add(New SqlParameter("@Subject", Subj))
Cmd.Parameters.Add(New SqlParameter("@Description", Descr))
Cmd.Parameters.Add(New SqlParameter("@MetaData", FileContent))
Cmd.Parameters.Add(New SqlParameter("@FileName", "Uploads/" &
FileUpload1.FileName.ToString()))
Cmd.Parameters.Add(New SqlParameter("@Sts", 1))
Cmd.Parameters.Add(New SqlParameter("@Active", 1))
Cmd.Parameters.Add(New SqlParameter("@DecKey", Ws.Encrypt(RK)))
Cmd.ExecuteNonQuery()
Cmd.Dispose()
Cmd.Parameters.Clear()
Cn.Close()
ClientScript.RegisterStartupScript(Me.GetType(), "myalert",
"alert('Message Sent Successfully');", True)
Clear()
End Sub
Private Function IncrID() As Long

Dim Cn As New SqlConnection(Ws.Con)


Cn.Open()
Dim Cmd As SqlCommand
S = "Select Max(ShareID) From SharedResources"
Cmd = New SqlCommand(S, Cn)
If Val(Convert.ToString(Cmd.ExecuteScalar)) <= 0 Then
IncrID = 1
ElseIf Val(Convert.ToString(Cmd.ExecuteScalar)) >= 1 Then
IncrID = Val(Convert.ToString(Cmd.ExecuteScalar)) + 1
End If
Cmd.Dispose()
Cn.Close()
End Function
Protected Sub CmdReset_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles CmdReset.Click
Clear()
End Sub
Private Function InsertNewLineChars(ByVal strText As String) As String
Dim pos As Integer, l As Integer
pos = 1
Do While pos < Len(strText)
l = Strings.InStr(pos, strText, vbCr)
If l = 0 Then Exit Do
strText = Strings.Left(strText, l - 1) & vbCrLf & Mid(strText, l +
1)

pos = l + 2
Loop
Return strText
End Function

Private Sub Clear()


TxtDesc.Text = ""
TxtEmpMail.Text = ""
TxtSubject.Text = ""
DrpEmpNameID.Items.Clear()
End Sub
End Class

VIEW MESSAGES
Imports System.Data.SqlClient
Imports System.Data
Partial Class ViewSharedResources
Inherits System.Web.UI.Page
Dim
Dim
Dim
Dim

S As String = ""
Ws As New CodeClass
a As String = ""
EmpID As Long = 0

Protected Sub Page_Load(ByVal sender As Object, ByVal e As


System.EventArgs) Handles Me.Load
If Page.IsPostBack = False Then
a = Session("UN").ToString()
Session("UN") = a
Lbl.Text = a
EmpID = Ws.GetEmpID(Lbl.Text)
End If
Clear()
End Sub
Private Sub Clear()
DG.DataSource = Nothing
DG.DataBind()
Dim Cn As New SqlConnection(Ws.Con)
Cn.Open()
Dim Cmd As SqlCommand
Dim dr As SqlDataReader
Dim dt As New DataTable
Dim row As DataRow
dt.Columns.Add("a")
dt.Columns.Add("b")
dt.Columns.Add("c")
dt.Columns.Add("d")
dt.Columns.Add("e")
dt.Columns.Add("f")
dt.Columns.Add("g")
dt.Columns.Add("h")
S = "Select ShareID,(Select Name From Register b Where
b.EmpID=a.ToEmpID) 'To',ToEmpID,ToMail,SentDT,Subject,Description,FileName
From SharedResources a Where FromEmpID=" & EmpID & " And Active=1"
Cmd = New SqlCommand(S, Cn)
dr = Cmd.ExecuteReader
While dr.Read
row = dt.NewRow
row(0) = dr("ShareID").ToString()
row(1) = dr("To").ToString()
row(2) = dr("ToEmpID").ToString()
row(3) = dr("ToMail").ToString()
row(4) = Format(dr("SentDT"), "dd-MMM-yyyy")
row(5) = Ws.Decrypt(dr("Subject").ToString())
row(6) = Ws.Decrypt(dr("Description").ToString())
row(7) = dr("FileName").ToString()
dt.Rows.Add(row)
End While
dr.Close()
Cmd.Dispose()
DG.DataSource = dt
DG.DataBind()
Dim Flg As Integer = 0
For i = 0 To dt.Rows.Count - 1

DG.Rows(i).Cells(0).Text = dt.Rows(i).Item(0).ToString()
DG.Rows(i).Cells(1).Text = dt.Rows(i).Item(1).ToString()
DG.Rows(i).Cells(2).Text = dt.Rows(i).Item(2).ToString()
DG.Rows(i).Cells(3).Text = dt.Rows(i).Item(3).ToString()
DG.Rows(i).Cells(4).Text = dt.Rows(i).Item(4).ToString()
DG.Rows(i).Cells(5).Text = dt.Rows(i).Item(5).ToString()
DG.Rows(i).Cells(6).Text = dt.Rows(i).Item(6).ToString()
DG.Rows(i).Cells(7).Text = "<a href='" &
dt.Rows(i).Item(7).ToString() & "' target='sds' Style='textdecoration:none;'><font color='red'>View</font></a>"
Next
DG.Columns(0).Visible = False
DG.Columns(2).Visible = False
Cn.Close()
End Sub
End Class

6.2 SCREEN SHOTS


6.2.1 Main Page

Figure 6.2.1 Main Page

6.2.2 Registration

Figure 6.2.2 Registration

6.2.3 View Messages

Figure 6.2.3 View Messages

6.2.4 View Senders

Figure 6.2.4 View Senders

CHAPTER 7
CONCLUSION
An accuracy-constrained privacy-preserving access control framework for
relational data has been proposed. The framework is a combination of access
control and privacy protection mechanisms. The access control mechanism allows
only authorized query predicates on sensitive data. The privacy preserving module

anonymizes the data to meet privacy requirements and imprecision constraints on


predicates set by the access control mechanism. We formulate this interaction as
the problemof k-anonymous Partitioning with Imprecision Bounds (k-PIB). We
give hardness results for the k-PIB problem and present heuristics for partitioning
the data to the satisfy the privacy constraints and the imprecision bounds. In the
current work, static access control and relational data model has been assumed. For
future work, we plan to extend the proposed privacy-preserving access control to
incremental data and cell level access control.

CHAPTER 8
REFERENCES
[1] E. Bertino and R. Sandhu, Database Security-Concepts, Approaches, and
Challenges, IEEE Trans. Dependable and Secure Computing, vol. 2, no. 1, pp. 219, Jan.-Mar. 2005.

[2] P. Samarati, Protecting Respondents Identities in Microdata Release, IEEE


Trans. Knowledge and Data Eng., vol. 13, no. 6, pp. 1010-1027, Nov. 2001.
[3] B. Fung, K. Wang, R. Chen, and P. Yu, Privacy-Preserving Data Publishing: A
Survey of Recent Developments, ACM Computing Surveys, vol. 42, no. 4, article
14, 2010.
[4] A. Machanavajjhala, D. Kifer, J. Gehrke, and M. Venkitasubramaniam, LDiversity: Privacy Beyond k-anonymity, ACM Trans. Knowledge Discovery from
Data, vol. 1, no. 1, article 3, 2007.
[5] K. LeFevre, D. DeWitt, and R. Ramakrishnan, Workload-Aware
Anonymization Techniques for Large-Scale Datasets, ACM Trans. Database
Systems, vol. 33, no. 3, pp. 1-47, 2008.
[6] T. Iwuchukwu and J. Naughton, K-Anonymization as Spatial Indexing:
Toward Scalable and Incremental Anonymization, Proc. 33rd Intl Conf. Very
Large Data Bases, pp. 746-757, 2007.

You might also like