Sie sind auf Seite 1von 97

1

DATA ENCRYPTION USING BRAIN SIGNALS

Data Encryption Using Brain Signal

DEPARTMENT OF COMPUTER APPLICATION

DATA ENCRYPTION USING BRAIN SIGNALS

ABSTRACT
The software uses a method that is based on the use of an event-related brain signal for data encryption. The idea used is to shuffle the Huffman tree using a random number. A unique key is generated for each individual and hence the encryption is robust to fraudulent attacks as compared to other encryption systems. Further, as Huffman tree is used to encode the data during encryption thereby the method achieves both shrinking and encryption. Here, biometric cryptosystem utilize physiological & behavioural characteristics to generate an encryption key that allows conversion of plain text into cipher text. One of the major hurdles in biometric encryption is the problem of obtaining a biometric encryption key that is secretive enough. Here, a better algorithm is used and data encryption is chosen. Biometric keys are generated for encryption and decryption.

DEPARTMENT OF COMPUTER APPLICATION

DATA ENCRYPTION USING BRAIN SIGNALS

INTRODUCTION

DEPARTMENT OF COMPUTER APPLICATION

DATA ENCRYPTION USING BRAIN SIGNALS

1. INTRODUCTION
A method based on event-related brain signal is used for data encryption. The idea is to shuffle the Huffman tree using an encryption key generated by

electroencephalogram (EEG) signals recorded when the user perceives a common black and white line picture. As different persons have different thought processes, the generated key is unique to each individual and hence the encryption is robust to fraudulent attacks as compared to other encryption systems. Further, as Huffman tree is used to encode the data during encryption, the method achieves both compression and encryption. This pilot study has shown the huge potential of the method as it is impossible to be compromised.

1.1 Overview of the System


Data encryption is not implemented by ordinary cryptographic applications. We implement a more secured environment for cryptography & security. Here biometric cryptosystem utilize physiological & behavioural characteristics to generate an encryption key that will allow conversion of plain text into cipher text. One of the major hurdles in biometric encryption is problem of obtaining a biometric encryption key that is secretive enough. Here we uses better algorithm and data encryption is chosen. Biometric keys are generated for encryption and decryption. Some of the biometrics that could be used for this purpose are face, finger prints, hand geometry, iris, keystroke, signature voice and odour. This document has been prepared in accordance with IEEE Std, IEEE recommended for SRS. It provides the information for Product Perspective , Product Functions , User Characteristics , Functional Requirements ,External Interface Requirements , Other Requirements , Design Constraints , Attributes , Performance Requirements

1.2 Objectives and Scope of the project


One of the major objectives in biometric cryptosystem is the problem of obtaining a biometric encryption key that is secretive enough. The use of brain signals evolved during perception of common black and white line pictures as proposed in the study circumvent. This hurdle as it is practically impossible to be faked and the user could easily avoid concavity on the picture during forced situations. The scope of this specification document is to specify customer requirements in a detailed way. Here the system uses event-related brain signals for data encryption. The
DEPARTMENT OF COMPUTER APPLICATION

DATA ENCRYPTION USING BRAIN SIGNALS

idea is

to

shuffle the Huffman tree using an

encryption key generated by

electroencephalogram (EEG) signals recorded when the user perceives a common black and white line picture. As different persons have different thought processes, the generated key is unique to each individual and hence the encryption is robust to fraudulent attacks as compared to other encryption systems. Further, as Huffman tree is used to encode the data during encryption, the method achieves both compression and encryption.

DEPARTMENT OF COMPUTER APPLICATION

DATA ENCRYPTION USING BRAIN SIGNALS

SYSTEM ANALYSIS

DEPARTMENT OF COMPUTER APPLICATION

DATA ENCRYPTION USING BRAIN SIGNALS

2. SYSTEM ANALYSIS
2.1 INTRODUCTION
System Analysis is a detailed study of the various things related to the system Operations and their relationships within and outside the system. The main thing is to find out What is to be done to solve the problems with current system. In this phase the problem or drawbacks of the current system is identified and the necessary actions to solve these problems are recommended. It is the process of gathering and interpreting facts, diagnosing Problems and using the information to recommend improvement to the system. In brief, Analysis specifies what system should do. It is a management technique that heads in designing a new system or improving an existing system. Feasibility analysis and hardware and software requirements will also be analysed in this phase.

2.2 Existing System


Existing encryption systems are very familiar encryption techniques using the signals from finger, eye, face or using any other complex text patterns. It is having lot of security problems for storing and transferring the messages. The use of this system sometimes requires not just the fingerprint of the user but also a valid pin, which can be more difficult to use than traditional systems. False rejections---also called a "type I error" on most biometric systems---happens when the system refuses to register an employee's own fingerprint as valid, failing to authorize that person. False acceptances---or type II errors on most biometric systems---happens when the system registers a punch made from a different employee, incorrectly identifying an unauthorized person.

2.2.1 Drawbacks of Existing System


1. One can easily identify the encryption key generated using what kind of input and can trace that one. For example, fingerprints are left everywhere and iris images can be captured by hidden cameras. 2. Low Efficiency. 3. Not user friendly. 4. False rejection.

DEPARTMENT OF COMPUTER APPLICATION

DATA ENCRYPTION USING BRAIN SIGNALS

5. False acceptance.

2.3 Proposed System


2.3.1 Justification for the Proposed system
It is the recording of electrical activity along the scalp produced by the firing of neurons within the brain. In clinical contexts, EEG refers to the recording of the brain's spontaneous electrical activity over a short period of time, usually 2040 minutes, as recorded from multiple electrodes placed on the scalp. In neurology, the main diagnostic application of EEG is in the case of epilepsy, as epileptic activity can create clear abnormalities on a standard EEG study Derivatives of the EEG technique include evoked potentials (EP), which involves averaging the EEG activity time-locked to the presentation of a stimulus of some sort (visual, somatosensory, or auditory). Event-related potentials refer to averaged EEG responses that are time-locked to more complex processing of stimuli; this technique is used in cognitive science, cognitive psychology, and psychophysiological research. The electrical activity of the brain can be described in spatial scales from the currents within a single dendritic spine to the relatively gross potentials that the EEG records from the scalp, much the same way that economics can be studied from the level of a single individual's personal finances to the macro-economics of nations. Neurons, or nerve cells, are electrically active cells which are primarily responsible for carrying out the brain's functions. Here Biometric cryptosystems utilize physiological and behavioral

characteristics to generate an encryption key that will allow conversion of plaintext (i.e. given data) into cipher text (i.e. encrypted data). The idea is to shuffle the Huffman tree using an encryption key generated by electroencephalogram (EEG) signals recorded when the user perceives a common black and white line picture. Here user gets an EDF file corresponding to the EEG analog signal. This file some field information about the EEG analog signal. As different persons have different thought processes, the generated key is unique to each individual and hence the encryption is robust to fraudulent attacks as compared to other encryption system Further, as Huffman tree is used to encode the data during encryption, the method achieves both compression and encryption. This pilot study has shown the huge potential of the method as it is impossible to be compromised.
DEPARTMENT OF COMPUTER APPLICATION

DATA ENCRYPTION USING BRAIN SIGNALS

One of the major hurdles in biometric cryptosystems is the problem of obtaining a biometric encryption key that is secretive enough. For example, fingerprints are left everywhere and iris images can be captured by hidden cameras. Further, most of the Standard biometrics could be easily obtained through force. However, the use of brain signals evoked during the perception of a common black and white line picture as proposed in this study circumvents this hurdle as it is practically impossible to be faked and the user could easily avoid concentrating on the picture during forced situations. But the use of brain signals or electroencephalogram (EEG) in cryptography has not met with huge success simply because of the difficulty in obtaining unique key for each individual. In this study, we show that EEG in gamma band frequencies from specific channels could be utilized to obtain repeatable and unique encryption key. Further, the method introduces data compression as well (though this is not the main objective) as it is based on the use of the encryption key to shuffle leaf nodes of a Huffman tree obtained with Huffman data coding . The Proposed System consists of a Huffman Tree encoding and encryption with EEG signals. The EDF files are taken from EEG Signals images and scanned horizontally and the wave patterns are applied on the Huffman tree and encrypted. So in this way a better secured encryption is achieved.

2.3.2 Advantage of Proposed System


1. Generated key is unique to each individual. 2. Encryption is robust to fraudulent attacks as compared to other encryption systems. 3. Promises more security than other.

DEPARTMENT OF COMPUTER APPLICATION

10

DATA ENCRYPTION USING BRAIN SIGNALS

2.4 FEASIBILITY STUDY


2.4.1 INTRODUCTION
The project is considered to be feasible only if the proposed system software is useful to the organization. For preparing feasibility study report, existing system must be investigated and the ideas should be generated about the new system. The proposed system must be evaluated from a technical viewpoint first and their impact on the organization should be studied. Feasibility analysis is performed to choose the system that meets the performance requirements at least cost. The main objective of feasibility analysis is to test the technical, behavioural and economic feasibility of developing the computer based systems. This is done by investigating the existing system and generating the ideas about the new system.

2.4.2 Technical Feasibility


This system uses c#.net and SQL server. Here in this system we require one EEG device for taking input biometric signals data .The system doesnt require any more external device. Assessment of technical feasibility must be based upon an outline design of the system requirements.

2.4.3 Economic Feasibility


The system being developed is more economic in the case we giving the input edf data file for corresponding EEG signal taken from EEG device. Cost of the system depends on the nature of device. An evaluation of development cost weighs against the ultimate income or benefits derived from the developed system. The technique of cost benefit analysis is often used as a basis for assessing economic feasibility. The system requires costs only for the EEG device.

DEPARTMENT OF COMPUTER APPLICATION

11

DATA ENCRYPTION USING BRAIN SIGNALS

2.4.4 Operational Feasibility


Operational feasibility is the consideration about the working of the system after installation. The system should be simple enough so that non-engineers also are able to work with this software without having any considerable training. The system is simple and can be used very easily. The user require special training for using the system and so they are operational feasible.

DEPARTMENT OF COMPUTER APPLICATION

12

DATA ENCRYPTION USING BRAIN SIGNALS

ANALYSIS MODELING

DEPARTMENT OF COMPUTER APPLICATION

13

DATA ENCRYPTION USING BRAIN SIGNALS

2.5 ANALYSIS MODELING


2.5.1 USECASE DIAGRAM
Unified Modelling Language (UML) Diagrams
The Unified Modelling Language (UML) is a graphical language for visualizing, specifying, constructing and documenting the artifacts of a software intensive system. The UML offers a standard way to write a systems blueprints, including conceptual things such as programming language statements, database schemes and reusable software components. The important point to note here is that UML is a language for specifying and not a method or procedure. The UML is used to define a software system to detail the artefacts in the system to document and construct-it is the language that the blueprint is written in. The UML may be used in a variety of ways to support a software development methodology (such as the Rational Unified Process)-but in itself it does not specify that methodology or process. The UML have many diagrams, some of them are following:

Use case Diagrams


The Use case model describes the proposed functionality of the new system. A Use case represents a discrete unit of interaction between a user (human or machine) and the system. A Use case is a single unit of meaningful work. A Use case diagram is a diagram that shows the relationships among actors and use cases within a system. A use case model is comprised of one or more use case diagrams and any supporting documentation such as use case specifications and actor definitions. This diagram include

1. Use cases
A use case describes a sequence of actions that provide something of measurable value to an actor and is drawn as a horizontal ellipse. It represents

DEPARTMENT OF COMPUTER APPLICATION

14

DATA ENCRYPTION USING BRAIN SIGNALS

2. Actors
An actor is a person, organization or external system that plays a role in one or more interactions with your system. Actors are drawn as stick figures. It represents

3. Associations
Associations between actors and use case are indicated in use case diagrams by solid lines. An association exists whenever an actor is involved with an interaction described by a usecase.It represent

4. System Boundary Boxes (optional)


You can draw a rectangle around the usecase, called the system boundary box to indicate the scope of your system. Anything within the box represents functionality that is in scope and anything outside the box is not.

DEPARTMENT OF COMPUTER APPLICATION

15

DATA ENCRYPTION USING BRAIN SIGNALS

2.5.2 CLASS DIAGRAM


The class diagram is the main building block of object oriented modeling. It is used both for general conceptual modeling of the systematic of the application, and for detailed modeling translating the models into programming code. Class diagrams can also be used for data modeling. The classes in a class diagram represent both the main objects and or interactions in the application and the objects to be programmed. Class diagrams are the mainstay of object-oriented analysis and design. Class diagrams show the classes of the system, their interrelationships (including inheritance, aggregation, and association), and the operations and attributes of the classes. Class diagrams are used for a wide variety of purposes, including both conceptual/domain modeling and detailed design modeling. Although I prefer to create class diagrams on whiteboards because simple tools are more inclusive most of the diagrams that Ill show in this article are drawn using a software-based drawing tool so you may see the exact notation. In the class diagram these classes are represented with boxes which contain three parts. A class with three sections:. 1. The upper part holds the name of the class 2. The middle part contains the attributes of the class 3. The bottom part gives the methods or operations the class can take or undertake

Members
UML provides mechanisms to represent class members, such as attributes and methods, and additional information about them.

Visibility
To specify the visibility of a class member (i.e., any attribute or method) there are the following notations that must be placed before the member's name + Public - Private # Protected
DEPARTMENT OF COMPUTER APPLICATION

16

DATA ENCRYPTION USING BRAIN SIGNALS

~ Package / Derived Underline Static

Scope
The UML specifies two types of scope for members: instance and classifier. Classifier members are commonly recognized as "static" in many programming languages. In the case of instance members, the scope is a specific instance. For attributes, it means that its value can vary between instances. For methods, it means that its invocation affects the instance state, in other words, affects the instance attributes. Otherwise, in the classifier member, the scope is the class. For attributes, it means that its value is equal for all instances. For methods, it means that its invocation does not affect the instance state. To indicate that a member has the classifier scope, its name must be underlined. Otherwise, as default, the instance scope is considered.

Relationships
A relationship is a general term covering the specific types of logical connections found on class and objects diagrams. UML shows the following relationships:

Instance Level Relationships External links


A link is the basic relationship among objects. It is represented as a line connecting two or more object boxes. It can be shown on an object diagram or class diagram. A link is an instance of an association. In other words, it creates a relationship between two classes.

Association
An association represents a family of links. Binary associations (with two ends) are normally represented as a line, with each end connected to a class box. Higher order associations can be drawn with more than two ends. In such cases, the ends are connected to a central diamond. An association can be named, and the ends of an association can be adorned with role names, ownership indicators, multiplicity, visibility, and other properties.
DEPARTMENT OF COMPUTER APPLICATION

17

DATA ENCRYPTION USING BRAIN SIGNALS

There are four different types of association: bi-directional, uni-directional, Aggregation (includes Composition aggregation) and Reflexive. Bi-directional and uni-directional associations are the most common one. For instance, a flight class is associated with a plane class bi-directionally. Association represents the static relationship shared among the objects of two classes. Example: "department offers courses", is an association relation.

Aggregation
Aggregation is a variant of the "has a" or association relationship; aggregation is more specific than association. It is an association that represents a part-whole or part-of relationship. As a type of association, an aggregation can be named and have the same adornments that an association can. However, an aggregation may not involve more than two classes. Aggregation can occur when a class is a collection or container of other classes, but where the contained classes do not have a strong life cycle dependency on the container essentially, if the container is destroyed, its contents are not. In UML, it is graphically represented as a hollow diamond shape on the containing class end of the tree with lines that connect contained classes to the containing class.

Composition (Aggregation)
Class diagram showing Composition between two classes at top and Aggregation between two classes at bottom Composition is a stronger variant of the "owns a" or association relationship; composition is more specific than aggregation. Composition usually has a strong life cycle dependency between instances of the container class and instances of the contained classes. If the container is destroyed, normally every instance that it contains is destroyed as well. The UML graphical representation of a composition relationship is a filled diamond shape on the containing class end of the tree of lines that connect contained classes to the containing class.

Differences between Composition and Aggregation


When attempting to represent real-world whole-part relationships, e.g., an engine is part of a car, the composition relationship is most appropriate. However, when representing a software or database relationship, e.g., car model engine ENG01 is part of a car model CM01, an aggregation relationship is best, as the engine, ENG01 may be also part of a different car model. Thus the aggregation relationship is often called "catalog" containment to
DEPARTMENT OF COMPUTER APPLICATION

18

DATA ENCRYPTION USING BRAIN SIGNALS

distinguish it from composition's "physical" containment. The whole of a composition must have a multiplicity of 0.1 or 1, indicating that a part must belong to only one whole; the part may have any multiplicity. For example, consider University and Department classes. A department belongs to only one university, so University has multiplicity 1 in the relationship. A university can have multiple departments, so Department has multiplicity

2.5.3 DATA FLOW DIAGRAM


A data flow diagram is a structured analysis and design tool that can be used for flow charting in place, or in association with, information oriented and process oriented system flowcharts. This network is constructed by using a set of symbols. They are symbols that represent data sources, data flows, data transformations and data storage. Data Flow Diagrams divided into two. 1. Logical DFD 2. Physical DFD Logical DFD is an implementation independent view of a system, focusing on the flow of data between process without regard for the specific devices, storage locations or people in the system. In logical DFD the physical characteristics will not be listedPhysical DFD is an implementation dependant view of the current system, showing what tasks are carried out and how they are performed. Physical characteristics include names of people form and document names or numbers, names of departments, master and transaction file locations and names of procedures. A good design must have the following characteristics 1. The design should exhibit hierarchical representation of data and procedure. 2. The design should be modular. 3. The design should contain distinct representation of data and procedure. 4. The design should have more modules exhibiting independent functional characteristics. 5. The design should minimize the complexity of interfaces. The Context Analysis Diagram (zero level DFD) is the top level the entire diagram. It represents the entire software elements as a single bubble with input and output,
DEPARTMENT OF COMPUTER APPLICATION

19

DATA ENCRYPTION USING BRAIN SIGNALS

data indicated by incoming and outgoing arrows. These are expanded level by level each explain its process in detail. Process is numbered for easy identification and is normally labeled in block letters. Each data flow is labeled for easy understanding.

DESIGN NOTATION
Data flow programming is a means of representing a system at any levels of details with a graphic network of symbols showing the data flow, data stores, data processes and source or destination. 1. Square: -This defines source of destination of data

2. Arrow: 3. Circle:

-Arrow which shows data flow -Which represents a process that transforms Incoming data into Outgoing flow.

4. Open Rectangle: -This shows data store or a temporary repository of data. DFDs can be hierarchically organized, which help in partioning and analysing large systems. As a first step, one DFD can depict an entire system, which gives the system overview. It is called Context Diagram of level 0 DFD. The Context diagram can be further expanded. The successive expansion of a DFD from the context diagram to those giving with an overview and then working out the details. The six rules for constructing data flow diagram: 1. Arrow should not cross each other. 2. Squares, circles and filters must bear names. 3. Decomposed data flow squares and circles can be have same names. 4. Choose meaning full names for data flows. 5. Draw all data flows around the outside of the diagram.

DEPARTMENT OF COMPUTER APPLICATION

20

DATA ENCRYPTION USING BRAIN SIGNALS

2.5.4 ENTITY-RELATIONSHIP DIAGRAM


Entity Relationship Diagram or E\R Diagram constitutes a technique for representing the logical structure of a database in a pictorial manner. As such, it provides a simple and readily understood means of communicating the salient features of the design of any given databases. This method was first introduced by Chen in 1976 and is now widely used E-R analysis uses three major abstractions to describe data, They are:

Entity Relationship Attribute Entities are distinct things in the enterprise, relationships are meaningful

interactions between the objects and attributes are the properties of the entities and relationship. The building blocks entities relationships and attributes. An entity may be defined as a thing which is recognized as being capable of an independent existence and which can be uniquely identified. An entity is an abstraction from the complexities of some domain. When we speak of an entity we normally speak of some aspect of the real world which can be distinguished from other aspects of the real world. An entity may be a physical object such as house or a car, an event such as a house sale or a car service, or a concept such as a customer transaction or order. Although the term entity is the one most commonly used. Following Chen should really distinguish between an entity and an entity-type. An entity-type is a category. An Entity strictly speaking, is an instance of a given entity-type. There is usually many instance of an entity-type. Because the term entity-type is somewhat cumbersome, most people tend to use the term entity as a synonym for this term. Entities can be thought of as nouns. Examples: a computer, an employee, a song, a mathematical theorem. A relationship captures how two or more entities are related to one another. Relationships can be thought of as verbs, li9nking two or more nouns. Examples relationship between a company and a computer, supervises relationship between an employee and department, performs relationship between an artist and a song, proved relationship between a mathematician and a theorem.
DEPARTMENT OF COMPUTER APPLICATION

21

DATA ENCRYPTION USING BRAIN SIGNALS

The models linguistic aspect described above is utilized in the declarative database query language ERROL, which mimics natural language, constructs. Entities and relationships can both have attributes. Example: an employee entity might have a Social Security Number (SSN) attributes the proved relationship may have a date attributes every entity (unless it is a weak entity) must have a minimal set of uniquely identifying attributes, which is called the entity primary key. Entity-relationship diagram dont show sing le entities or single instance of relations. Rather show entity sets and relationship Example a particular song is an entity .The collection of all songs in a database is an entity set. The eaten relationship between a child and her lunch is a single relationship. The sets of all such childlunch relationships in a database are a relationship set. In other words, a relationship set corresponds to a relation in mathematics, while a relationship corresponds to a member of the relation. Certain cardinality constraints on relationship sets may be indicated as well.

Diagramming conventions
Entity sets are drawn as rectangle, relationship sets as diamond. If an entity set participate in a relationship set, they are connected with a line.Attributes are drawn as oval and are connected with a line to exactly one entity or relationship set. Cardinality constraints are expressed as follows: 1. A double line indicates a participation constraint ,totality or subjectivity all entities in the entity set must participate in at least one relationship set; 2. An arrow from entity set to relationship set indicates a key constraints, entity of the entity set can participate in at most one relationship in the relationship set. 3. A thick line indicates both, i.e. objectivity each entity in the entity set is involved in exactly one relationship. 4. An underlined name of an attribute indicates that it is a key two different entities or relationship with this attribute always have different values for this attribute. Attributes are often omitted as they can clutter up a diagram other diagram techniques often list.

DEPARTMENT OF COMPUTER APPLICATION

22

DATA ENCRYPTION USING BRAIN SIGNALS

Symbol Entities

Meaning

Relationship

Attributes

Connections

2.5.5 TRANSITION DIAGRAM


State transition diagrams are used to model the dynamic (how the system runs) behaviour of an object or system It shows the flow of control using states and transitions A state is a condition or situation in the life of an object during which it satisfies some condition, performs some actions or waits for some events. At any given time, the object is said to be in a certain state. It remains in this state until an event occurs that causes it to change state. A transition is a relationship between 2 states indicating that an object in the first state (the source state) will perform certain actions and enter the second state (the destination state) when a specified event occurs and certain conditions are satisfied. A transition represents a change of state in response to an event.

Graphical Notations
States are shown as round cornered rectangles, with the name enclosed Transitions are shown as links from the source state to the target state Transitions can be labelled as [Event-List] [Guard] [/Action]

STATE

DEPARTMENT OF COMPUTER APPLICATION

23

DATA ENCRYPTION USING BRAIN SIGNALS

An event is an occurrence of a stimulus that can trigger a state transition. If there are multiple events, each is separated by a vertical bar A guard is a Boolean condition that must evaluate to true for the transition to take place The action specifies the action to be carried out when the transition is madeAn initial state is shown as a filled circle.

A final state is shown as a ring around a filled circle.

Each state may also have an entry action (entry/Action) and an exit action (exit/Action)Basically, when an event occurs that matches one of the events specified in the label of the transition and all the guards specified in the label of the transition evaluate to true, the transition is triggered and the action specified in the label of the transition, if any, is performed and the object enters the destination state of the transition States can be nested (the nested state diagram is enclosed in a rectangle) For sequential nesting, a transition enters the initial state of the nested states and, at any point in time, an object can be in one of the nested statesFor concurrent nesting, a transition simultaneously enters the initial states of each concurrent state and, at any point in time, an object can be in one of the nested states in each concurrent path.

DEPARTMENT OF COMPUTER APPLICATION

24

DATA ENCRYPTION USING BRAIN SIGNALS

SYSTEM SPECIFICATION

DEPARTMENT OF COMPUTER APPLICATION

25

DATA ENCRYPTION USING BRAIN SIGNALS

2.6 SYSTEM SPECIFICATION


A system requirements specification is a document where the requirements of a system is planned to be developed are listed. Requirement analysis is a software engineering task that brings the gap between the system and software designs. Requirement analysis enables the system engineer to specify software functional performance indicates softwares interface with other system elements and establishes constraints that the software must meet. Finally requirement specification provides the developer and the customer with the means to assess quality once the software is built. Requirement specification places a great deal of responsibility on the system analyst, because the point shows up later in the characteristics of the new system. Requirements analysis is critical to the success of a project.

2.6.1 HARDWARE AND SOFTWARE SPECIFICATION HARDWARE REQUIREMENTS


Processor Main Memory Pentium III or Above 512 MB RAM

Hard Disk Capacity 80 GB or Above. EEG Device Mother board EEG Waveform Recorder Intel 945

DEPARTMENT OF COMPUTER APPLICATION

26

DATA ENCRYPTION USING BRAIN SIGNALS

SOFTWARE REQUIREMENTS
Tools Back End Operating System Language Web Server Visual Studio 2005 My SQL Server 2008 Windows 7
C#

IIS 5.0

2.6.2 SOFTWARE OVERVIEW Visual Studio 2005


Microsoft Visual Studio is the main Integrated Development Environment (IDE) from Microsoft. It can be used to develop console and graphical user interface applications along with Windows Forms applications, web sites, web applications, and web services in both native codes together with managed code for all platforms supported by Microsoft Windows, Windows Mobile, .NET Framework, and .NET Compact Framework. Visual Studio includes a code editor supporting IntelliSense as well as code refactoring. The integrated debugger works both as a source-level debugger and a machine-level debugger. Other built-in tools include a forms designer for building GUI applications, web designer, class designer, and database schema designer. Built-in languages include C/C++ (via Visual C++), VB.NET (via Visual Basic .NET), and C# (via Visual C#). It also supports XML, HTML, JavaScript and CSS. Languages specific versions of Visual Studio also exist which provide more limited language services to the user. These individual packages are called Microsoft Visual Basic, Visual J#, Visual C#, and Visual C++. Visual Studio 2008, codenamed Orcas, was released to MSDN subscribers on 19 November 2007 alongside .NET Framework 3.5. Visual Studio 2008 is focused on development of Windows Vista, 2007 Office system, and Web applications. For visual design, a new Windows Presentation Foundation visual designer and a new HTML/CSS editor influenced by Microsoft Expression Web are included. Visual Studio 2008 requires
DEPARTMENT OF COMPUTER APPLICATION

27

DATA ENCRYPTION USING BRAIN SIGNALS

.NET Framework 3.5 and by default configures compiled assemblies to run on .NET Framework 3.5. For Visual C++, Visual Studio adds a new version of Microsoft Foundation Classes (MFC 9.0) that adds support for the visual styles and UI controls introduced with Windows 7.

Net Framework 4.0


The major theme for C# 4.0 is dynamic programming. Increasingly, objects are dynamic in the sense that their structure and behaviour is not captured by a static type, or at least not one that the compiler knows about when compiling your program. Some examples include

objects from dynamic programming languages, such as Python or Ruby COM objects accessed through I Dispatch ordinary .NET types accessed through reflection objects with changing structure, such as HTML DOM script objects data readers and other user defined dynamic objects

While C# remains a statically typed language, we aim to vastly improve the interaction with such objects. A secondary theme is co-evolution with Visual Basic. Going forward we will aim to maintain the individual character of each language, but at the same time important new features should be introduced in both languages at the same time. They should be differentiated more by style and feel than by feature set. The new features in C# 4.0 are,

Dynamic Support
Visual C# 2010 provides support for late binding to dynamic types by introducing a new type, dynamic. This addition enables many new scenarios, including simplified access to COM APIs such as the Office Automation APIs, to dynamic APIs such as Iron Python libraries, and to the HTML Document Object Model (DOM).

Office Programmability
Access to COM interfaces, including the Office Automation APIs, is greatly enhanced by the addition of named and optional arguments, the dynamic type, indexed properties, and optional ref modifiers.

DEPARTMENT OF COMPUTER APPLICATION

28

DATA ENCRYPTION USING BRAIN SIGNALS

Type Equivalence Support


You can now deploy an application that has embedded type information instead of type information that is imported from a Primary Interop Assembly (PIA). With embedded type information, your application can use types from an assembly without requiring a reference to the runtime assembly or Primary Interop Assembly (PIA). If various versions of the runtime assembly are published, the application that contains the embedded type information can work with the different versions without having to be recompiled.

Covariance and Contravariance


Covariance enables you to use a more derived type than that specified by the generic parameter, whereas contravariance enables you to use a less derived type. This allows for implicit conversion of classes that implement variant interfaces and provides more flexibility for matching method signatures with variant delegate types. Variant interfaces and delegates can be created by using the new in and out language keywords. The .NET Framework also introduces variance support for several existing generic interfaces and delegates, including the I Enumerable (Of T) interface and the Fun (Of TResult) and Action (Of T) delegates.

C# LANGUAGE
C# is a new language created by a team of people at Microsoft. C# is a powerful and flexible programming language. Like all programming languages, it can be used to create a variety of applications. C# was created as an object-oriented programming (OOP) language. C# removes much of the complexity and trouble caused by pointers. In C#, automatic garbage collection and type safety are an integral part of the language. C# enables programmers in quickly building solution for Microsoft.net platform. It was announced in July 2000 and is built on the shoulders of not only C++, but also on Java. Perhaps the most important aspect of java that comes over C# is the emphasis on security, particularly on the use of pointers. C# type systems automate memory management thereby freeing developers from time consuming, by prone memory management. The C# type system is unified everything is an object, Microsoft says that C# brings the power of C# with ease of VB. C# is a modern language, features such as exception handling, garbage collection extensible data types, code

DEPARTMENT OF COMPUTER APPLICATION

29

DATA ENCRYPTION USING BRAIN SIGNALS

security are features that are expected in a modern language. C# supports modular programming, helps to develop GUI application and also having the power of .NET platform.

ASP.NET
ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites, web applications and web services. It was first released in January 2002 with version 1.0 of the .NET Framework, and is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime (CLR), allowing programmers to write ASP.NET code using any supported .NET language.

ASP.NET ARCHITECTURE

DEPARTMENT OF COMPUTER APPLICATION

30

DATA ENCRYPTION USING BRAIN SIGNALS

ADO.NET

ADO.NET provides consistent access to data sources such as Microsoft SQL Server, as well as data sources exposed via OLE DB and XML. Data-sharing consumer applications can use ADO.NET to connect to these data sources and retrieve, manipulate, and update data.ADO.NET cleanly factors data access from data manipulation into discrete components that can be used separately or in tandem. ADO.NET includes .NET data providers for connecting to a database, executing commands, and retrieving results. Those results are either processed directly, or placed in an ADO.NET Dataset object in order to be exposed to the user in an ad-hoc manner, combined with data from multiple sources, or remote between tiers. The ADO.NET Dataset object can also be used independently of a .NET data provider to
DEPARTMENT OF COMPUTER APPLICATION

31

DATA ENCRYPTION USING BRAIN SIGNALS

manage data local to the application or sourced from XML.The ADO.NET components have been designed to factor data access from data manipulation. There are two central components of ADO.NET that accomplish this: the Dataset, and the .NET data provider, which is a set of components including the Connection, Command, Data Reader, and Data Adapter objects. The ADO.NET Dataset is the core component of the disconnected architecture of ADO.NET. The Dataset is explicitly designed for data access independent of any data source. As a result it can be used with multiple and differing data sources, used with XML data, or used to manage data local to the application. The other core element of the ADO.NET architecture is the.NET data provider, whose components are explicitly designed for data manipulation and fast, forward-only, read-only access to data. The Connection object provides connectivity to a data source. The Command objects enables access to database commands to return data, modify data, run stored procedures, and sends or retrieve parameter information. The Data Reader provides a high-performance stream of data from the data source. Finally, the Data Adapter provides the bridge between the Dataset object and the data source.

Database
To develop ASP.NET database applications you need to install SQL Server 2005. Use of SQL Server with ASP.NET is recommended as it's said that SQL Connections are 70% faster than OLEDB Connections. Also, performance improves dramatically when you use SQL Server with ASP.NET.

ASP.NET Features
ASP.NET is not just a simple upgrade or the latest version of ASP. ASP.NET combines unprecedented developer productivity with performance, reliability, and deployment. ASP.NET redesigns the whole process. It's still easy to grasp for new comers but it provides many new ways of managing projects. Below are the features of ASP.NET. 1. 1. 1.Flexible Language Options ASP.NET lets you leverage your current programming language skills. Unlike classic ASP, this supports only interpreted Error. And Script, ASP.NET now supports more than 40 .NET languages (built-in support for VB.NET, C#, and JScript.NET), giving you unprecedented flexibility in your choice of language.
DEPARTMENT OF COMPUTER APPLICATION

32

DATA ENCRYPTION USING BRAIN SIGNALS

2.Great Tool Support


You can harness the full power of ASP.NET using any text editor, even Notepad. But Visual Studio .NET adds the productivity of Error! Hyperlink reference not valid.-style development to the Web. Now you can visually design ASP.NET Web Forms using familiar drag-drop-double-click techniques, and enjoy full-fledged code support including statement completion and color-coding. VS.NET also provides integrated support for debugging and deploying ASP.NET Web applications. The Enterprise versions of Visual Studio .NET deliver life-cycle features to help organizations plan, analyze, design, build, test, and coordinate teams that develop ASP.NET Web applications. These include UML class modeling, Error Hyperlink reference not valid. Modeling (conceptual, logical, and physical models), testing tools (functional, performance and scalability), and enterprise frameworks and templates, all available within the integrated Visual Studio .NET environment.

3.Rich Class Framework


Application features that used to be hard to implement, or required a 3rd-party component, can now be added in just a few lines of code using the .NET Framework. The .NET Framework offers over 4500 classes that encapsulate rich functionality like XML, data access, file upload, regular expressions, image generation, performance monitoring and logging, transactions, message queuing, SMTP mail, and much more. With Improved Performance and Scalability ASP.NET lets you use serve more users with the same hardware. 4.XML Web Services XML Web services allow applications to communicate and share data over the Internet, regardless of Error! Hyperlink reference not valid or programming language. ASP.NET makes exposing and calling XML Web Services simple. Any class can be converted into an XML Web Service with just a few lines of code, and can be called by any SOAP client. Likewise, ASP.NET makes it incredibly easy to call XML Web Services from your application. No knowledge of networking, XML, or SOAP is required.

DEPARTMENT OF COMPUTER APPLICATION

33

DATA ENCRYPTION USING BRAIN SIGNALS

5.Mobile Web Device Support


ASP.NET Mobile Controls let you easily target cell phones, Error! Hyperlink reference not valid. And over 80 mobile Web devices.

Powerful tools

Power and Flexibility:


Because ASP.NET is based on the common language runtime, the power and flexibility of that entire platform is available to Web application developers. The .NET Framework class library, Messaging, and Data Access solutions are all seamlessly accessible from the Web. ASP.NET is also language-independent, so you can choose the language that best applies to your application or partition your application across many languages.

Simplicity:
ASP.NET makes it easy to perform common tasks, from simple form submission and client authentication to deployment and site configuration. For example, the ASP.NET page framework allows you to build user interfaces that cleanly separate application logic from presentation code and to handle events in a simple, Visual Basic - like forms processing model. Additionally, the common language runtime simplifies development, with managed code services such as automatic reference counting and garbage collection

Manageability:
ASP.NET employs a text-based, hierarchical configuration system, which simplifies applying settings to your server environment and Web applications. Because configuration information is stored as plain text, new settings may be applied without the aid of local administration tools. This "zero local administration" philosophy extends to deploying ASP.NET Framework applications as well. An ASP.NET Framework application is deployed to a server simply by copying the

DEPARTMENT OF COMPUTER APPLICATION

34

DATA ENCRYPTION USING BRAIN SIGNALS

necessary files to the server. No server restart is required, even to deploy or replace running compile code.

Scalability and Availability:


ASP.NET has been designed with scalability in mind, with features specifically tailored to improve performance in clustered and multiprocessor environments. Further, processes are closely monitored and managed by the ASP.NET runtime, so that if one misbehaves (leaks, deadlocks), a new process can be created in its place, which helps keep your application constantly available to handle requests.

Customizability and Extensibility:


ASP.NET delivers a well-factored architecture that allows developers to "plug-in" their code at the appropriate level. In fact, it is possible to extend or replace any subcomponent of the ASP.NET runtime with your own custom-written component. Implementing custom authentication or state services has never been easier.

Security:
With built in Windows authentication and per-application configuration, you can be assured of security.

Database
SQL Server 2008

The next version of SQL Server, SQL Server 2008, was released (RTM) on August 6, 2008[11]and aims to make data management self-tuning, self organizing, and self maintaining with the development of SQL Server Always On technologies, to provide nearzero downtime. SQL Server 2008 also includes support for structured and semi-structured data, including digital media formats for pictures, audio, video and other multimedia data. In current versions, such multimedia data can be stored as BLOBs (binary large objects), but they are generic bit streams. Intrinsic awareness of multimedia data will allow specialized
DEPARTMENT OF COMPUTER APPLICATION

35

DATA ENCRYPTION USING BRAIN SIGNALS

functions to be performed on them. According to Paul Flessner, senior Vice President, Server Applications, Microsoft Corp., SQL Server 2008 can be a data storage backend for different varieties of data: XML, email, time/calendar, file, document, spatial, etc as well as perform search, query, analysis, sharing, and synchronization across all data types. Other new data types include specialized date and time types and a Spatial data type for location-dependent data. Better support for unstructured and semi-structured data is provided using the new data type, which can be used to reference any file stored on the file system. Structured data and metadata about the file is stored in SQL Server database, whereas the unstructured component is stored in the file system. Such files can be accessed both via Win32 file handling APIs as well as via SQL Server using T-SQL; doing the latter accesses the file data as a BLOB. Backing up and restoring the database backs up or restores the referenced files as well. SQL Server 2008 also natively supports hierarchical data, and includes T-SQL constructs to directly deal with them, without using recursive queries. The Full-text search functionality has been integrated with the database engine. According to a Microsoft technical article, this simplifies management and improves performance. Spatial data will be stored in two types. A "Flat Earth" (GEOMETRY or planar) data type represents geospatial data which has been projected from its native, spherical, coordinate system into a plane. A "Round Earth" data type (GEOGRAPHY) uses an ellipsoidal model in which the Earth is defined as a single continuous entity which does not suffer from the singularities such as the international dateline, poles, or map projection zone "edges". Approximately 70 methods are available to represent spatial operations for the Open Geospatial Consortium Simple Features for SQL, Version 1.1.

SQL Server 2008 R2


SQL Server 2008 R2 (formerly codenamed SQL Server "Kilimanjaro") was announced at TechEd 2009, and was released to manufacturing on April 21, 2010.[23] SQL Server 2008 R2 adds certain features to SQL Server 2008 including a master data management system branded as Master Data Services, a central management of master data entities and hierarchies. Also Multi Server Management, a centralized console to manage multiple SQL

DEPARTMENT OF COMPUTER APPLICATION

36

DATA ENCRYPTION USING BRAIN SIGNALS

Server 2008 instances and services including relational databases, Reporting Services, Analysis Services & Integration Services. SQL Server 2008 R2 includes a number of new services,[25] including Power Pivot for Excel and Share Point, Master Data Services, Stream Insight, Report Builder 3.0, Reporting Services Add-in for Share Point, a Data-tier function in Visual Studio that enables packaging of tiered databases as part of an application, and a SQL Server Utility named UC (Utility Control Point), part of AMSM (Application and Multi-Server Management) that is used to manage multiple SQL Servers. The first SQL Server 2008 R2 service pack (Service Pack 1) was released on July 11, 2011.

Platform Windows 7
Windows 7 is the latest release of Microsoft Windows, a series of operating systems produced by Microsoft for use on personal computers, including home and business desktops, laptops net books, tablet PCs, and media centre PCs. Windows 7 was released to manufacturing on July 22, 2009, and reached general retail availability on October 22, 2009. Windows 7's server counterpart, Windows Server 2008 R2, was released at the same time. Unlike Windows Vista, which introduced a large number of new features, Windows 7 was intended to be a more focused, incremental upgrade to the Windows line, with the goal of being compatible with applications and hardware with which Windows Vista was already compatible. Presentations given by Microsoft in 2008 focused on multi-touch support, a redesigned Windows shell with a new taskbar, referred to as the Super bar, a home networking system called Home Group, and performance improvements. Some standard applications that have been included with prior releases of Microsoft Windows, including Windows Calendar, Windows Mail, Windows Movie Maker, and Windows Photo Gallery, are not included in Windows 7; most are instead offered separately at no charge as part of the Windows Live Essentials suite. Windows now runs much faster than the other operating system (Such as Vista) while consuming lesser amount of resources. It reduces the background activities just by triggering start of important services when they actually required. So Network Discovery service will only start when you actually connect your computer to a network, rather than
DEPARTMENT OF COMPUTER APPLICATION

37

DATA ENCRYPTION USING BRAIN SIGNALS

going this process over and over in background. Thus services will run only when they are required and stopping them will release all the resources that it was utilizing. Windows 7 includes new features and capabilities that you can use in your applications to improve the user experience.

DEPARTMENT OF COMPUTER APPLICATION

38

DATA ENCRYPTION USING BRAIN SIGNALS

SOFTWARE ENGINEERING PARADIGM APPLIED

DEPARTMENT OF COMPUTER APPLICATION

39

DATA ENCRYPTION USING BRAIN SIGNALS

2.7 SOFTWARE ENGINEERING PARADIGM APPLIED


Software process model
A process model for a software engineering is chosen based on the nature of the project and application, the methods and tools to be used, and the controls and deliverables that are required. All software can be characterized as a problem solving loop in which four distinct stages are encountered.

Status quo Problem definition Technical development Solution integration Status quo represents the current state of affairs. Problem definition identifies

the specific problem to be solved. Technical definition solves the problem though the application of some technology and solution integration delivers to those who requested the result in the first place.

Problem definition

Status quo

Technical development

Solution Integration

DEPARTMENT OF COMPUTER APPLICATION

40

DATA ENCRYPTION USING BRAIN SIGNALS

Linear Sequential Model


Linear Sequential Model is the oldest and most widely used paradigm for software engineer. It suggests a systematic, sequential approach to software development that begins at the system level and progresses through analysis, design, coding, testing and support

System/Information Engineering
System engineering and analysis encompass requirements gathering at the system level with a small amount of top level design and analysis.

Analysis
The requirements gathering process intensified and focused specially on software. Requirements for both system and software are documented and viewed with the customer.

Design
Software design is actually multi step process that focuses on four distinct attributes of a program data structure, software architecture, interface representations and procedural detail. The design process translates requirements into representational software that can be assessed for quality before coding begins.

Coding
The design must be translated into machine readable code. The code generation step performs this task.
DEPARTMENT OF COMPUTER APPLICATION

41

DATA ENCRYPTION USING BRAIN SIGNALS

Testing
Once code has been generated, program testing begins. The testing process focus on the logical internals of the software, ensuring that all statements have been tested, and on the functional externals, i.e. Conducting tests to uncover errors and ensures that defined input will produce actual; results that agree with required results.

Installation
This step occurs once the product has been tested and certified as a fit for use, and involves preparing the system or product for installation and use at customer site. Delivery may take place via the internet or physical media, and the deliverable is typically tagged with the formal revision number to facilitate updates at a later date.

Maintenance
This step occurs after installation, and involves making modification to the system or an individual component to alter attributes or improve performance. These modifications arise either due to change requests initiated by the customer, or defects uncovered during live use of system. Typically, every change made to the product during the maintenance cycle is recorded and a new product release (called a maintenance release and exhibiting a updated version number) is performed to enable the customer to gain the benefit of the update.

DEPARTMENT OF COMPUTER APPLICATION

42

DATA ENCRYPTION USING BRAIN SIGNALS

SYSTEM DESIGN

DEPARTMENT OF COMPUTER APPLICATION

43

DATA ENCRYPTION USING BRAIN SIGNALS

3.SYSTEM DESIGN
3.1 INTRODUCTION
Design phase is the phase in which the detailed design of the system, selected in the study phase is accomplished. The main activities performed during this phase include allocation of functions between the computer programs, equipped and manual operation, the design of the database used, specification of the requirements for input, processing and output, and the defining of the system and computer program test requirements. The normal procedure is required, from the system based on the user requirements. Once this is defined in details the input is worked back and appropriate codes are designed for easily handling of various types of files. Design goes to logical and physical system of development. Logical design reviews present system prepared input and output specification, makes edit security and control specification and details of the implementation and specified a new hardware and software. SYSTEM DESIGN: As mentioned before system design is the process of identifying the main component of the system without going to the internal details. Each component is considered to be a black box, meaning that for given input, a specific output is produced, but details of the input is being processed is not known. Each component in the phase is called a module. This phase also emphasis the interactions between the modules. In this phase the design selected in the study phase is accomplished. The main activities performed during phase include the following: The allocation of functions between the programs. Selection of equipment and manual operation. The design of the database used.
DEPARTMENT OF COMPUTER APPLICATION

44

DATA ENCRYPTION USING BRAIN SIGNALS

Specification of the requirement for input, processing and outputs Defining of system and computer program test requirements

3.2 INPUT DESIGN


Inaccurate input data are the most common cause of error in the data processing. Errors entered by the data entry operators can be controlled by the input design. Input design is the process of converting user-originated input to a computer-based format. Input data are collected and organized into groups of similar data. Appropriate input media are selected for processing. The goal of designing the input data is to make entry as easy, logical and free from errors. The objectives of input design are: To produce a cost-effective method of input To make the input forms understandable to the user To ensure the validation of data input To achieve the highest possible level of accuracy

The various activities to be performed for the overall input processors are: Data recording at the source Data transfer to input form Data conversion to computer acceptable mode Data validation Data flow control Data correction if necessary

DEPARTMENT OF COMPUTER APPLICATION

45

DATA ENCRYPTION USING BRAIN SIGNALS

3.3 OUTPUT DESIGN

Computer input is most important and directs source of information to the user. Efficient intelligible output design should improve systems relationships with the user and help in decisions making. Printouts should be designed around the output requirements of the user. Outputs also provide a mean of storage by copying the results for later reference in consultation. There is chance that some of the end-users will not actually operate the input data or information system through workstations, but will use the output from the system. Two phases of the output design are: Output definition Output specification Output definition takes into account the type of output contents, its frequency and its volume. The appropriate output media is determined for outputs. Once the output media is chosen, the detail specifications of the output documents are carried out. The nature of output required from the proposed system is determined during the logical design stage itself. The physical design stage takes the outline from the logical design and produces the output as specified during the logical design phase.The types of outputs are

3.3.1 EXTERNAL OUTPUTS


These are the type of outputs, whose destination will be outside the organization and which require special attention as they project the image of organization.

3.3.2 INTERNAL OUTPUTS


These are the type of outputs, whose destination is within the organization. It is to be carefully designed, as they are users main interface with the system.

DEPARTMENT OF COMPUTER APPLICATION

46

DATA ENCRYPTION USING BRAIN SIGNALS

3.3.3 INTERACTIVE OUTPUTS


These are the type of outputs, which the user uses in communicating directly with the user.

3.4 DATABASE DESIGN


Database design is an integrated approach to file design. The general theme is to handle information as an integrated whole, with a minimum of redundancy and improved performance. Software languages are used to manipulate, describe and manage data. Regardless of the type of data structure used, the objectives the database are: Accuracy and integrity Successful recovery from failure Privacy and security data Good overall performance In a database environment common data are available and used by several users. Instead of each program managing its own data, authorized users data across application with the database software managing the data as an entity. The objectives of the databases are: 1. Controlled redundancy: Data is stored only once avoiding the conflicting information and thus improving performance. 2. Ease of learning and use: With use of proposed system, databases can be modified without interfering with the established ways of using data. 3. Data dependency: The database should be able to improve its performance without rewriting of applications programs, for changing hardware and storage procedures. 4. More information at low rate: programming and software enhancements should be kept simple and ease to update.

DEPARTMENT OF COMPUTER APPLICATION

47

DATA ENCRYPTION USING BRAIN SIGNALS

5. Accuracy and integrity: Data quality and content remain constant. Integrity controls detects the data inaccuracies. 6. Recovery from failure: The system must recover quickly after it is down with no loss of transactions. 7. Privacy and security: security measure must be taken to prevent unauthorized access and destruction from natural calamities. 8. Performance: It depends on the nature of the user database dialog.

3.4.1 TABLE STRUCTURE

1. Login
Primary key: User_ID Field Name User_ID Username Password Address Email Phone Data type int nvarchar(50) nvarchar(50) nvarchar(250) nvarchar(50) numeric(15,0) Constraints Primary Key Not null Not null Not null Not null Not null Description User id Name of user Password Users Address Email Address Phone number

2. EEG Sample
Primary Key: EEGSample_ID ForienKey: User_ID Field Name EEGSample_ID User_ID EEG_Sample_Type Sample_Name Age Description EEG_Sample Analysis_Report Data type Int nvarchar(20) nvarchar(225) nvarchar(225) Int Ntext Image Ntext Constraints Primary Key Forienkey Not null Not null Not null Not null Not null Not null Description Sample id Users id Type of sample Name of sample Age Description of sample Sample Report

DEPARTMENT OF COMPUTER APPLICATION

48

DATA ENCRYPTION USING BRAIN SIGNALS

3. Huffman Tree
PrimaryKey: Tree_ID ForienKey: User_ID Field Name Tree_ID User_ID Sample_ID Tree Name Tree Description Huffman Tree Data type int int int nvarchar(255) ntext image Constraints Primary Key ForienKey Not null Not null Not null Not null Description Tree id Users id Samples id Name of tree Description of tree Image of tree

4.Keys
PrimaryKey: Key_ID ForienKey: User_ID Field Name Key_ID User_ID Sample_ID Key_Name Reference_Key Referenced_Key Data type int int int nvarchar(255) ntext Ntext Constraints Primary Key Forien key Not null Not null Not null Not null Description Key id Users id Samples id Name of key Reference key Referenced Key

3.5 MODULE DESCRIPTION


EEG Sample Module Huffman Encoding Module Encryption and decryption Module User Interface Module.

3.5.1 EEG Sample Module


The EEG Analysis Module gets samples of EEG Signals as EDF file. Also, the user information along the sample is entered thereby an edf file with the EEG wave form is obtained. It also contains the fields which contains frequency and size of the biometric signal.
DEPARTMENT OF COMPUTER APPLICATION

49

DATA ENCRYPTION USING BRAIN SIGNALS

3.5.1.1 Inputs
Here the input is EEG Signals which helps for secure encoding of data.

3.5.1.2 Processing
Here the EEG which is of EDF extension is converted to text files which is considered as the sample for the system and its information such as name, description age is given along with the sample.

3.5.1.3 Outputs
This module provides the text file of EDF file along with its description as output.

3.5.2 Huffman Encoding Module


The module creates Huffman nodes using the sample. When a node is created its size should not exceed the total size of the nodes. Then, the Huffman nodes are shuffled. Thus, the nodes are randomly rearranged. Then the Huffman tree is saved. This information would be stored in the database.

3.5.2.1 Inputs
The input is the sample which is a text file.

3.5.2.2 Processing
Here the nodes are created with its size should less than the total size of the nodes. Then, the Huffman nodes are shuffled. Thus, the nodes are randomly rearranged and the Huffman tree is saved. This information would be stored in the database.

3.5.2.3 Outputs
The module provides a Huffman tree as the final outcome.

DEPARTMENT OF COMPUTER APPLICATION

50

DATA ENCRYPTION USING BRAIN SIGNALS

3.5.3 Encryption and decryption Module


The sample is given as input and it is hex encoded. Thus, the referenced key is obtained. Then the reference key is generated using key generator. Now, the referenced key is identified using the reference key. Then the referenced key is shuffled using Huffman tree and allowed to shrink using shrinking algorithm and the key is generated. Using this key, the file is encrypted. The reverse process happens in decryption.

3.5.3.1 Inputs
Here the input is the data to be encrypted or decrypted, EEG sample and the Huffman tree information.

3.5.3.2 Processing
The sample is given as input and it is hex encoded. Thus, the referenced key is obtained. Then the reference key is generated using key generator. Now, the referenced key is identified using the reference key. Then the referenced key is shuffled using Huffman tree and allowed to shrink using shrinking algorithm and the key is generated. Using this key, the file is encrypted. The reverse process happens in decryption.

3.5.3.3 Outputs
Encrypted or decrypted data as required is given as the output of the system.

3.5.4 User Interface Module.


The User Interface module contains the user interface forms and dialogs for data analysis, encryption, encoding, and manipulation of data stored as images and data. This application contains lots of forms used for user interface. It is mainly used for browsing the signal, creating Huffman tree, encryption and decryption. Without these main forms, application also contains sub forms.

DEPARTMENT OF COMPUTER APPLICATION

51

DATA ENCRYPTION USING BRAIN SIGNALS

3.5.4.1 Inputs
The user has to provide his/her login name and password to enter the system as input.

3.5.4.2 Processing
The system checks for the user name and password and if its valid then the user can enter the system or else he/she is not allowed to enter the system .The system also checks for new users to register in to the system.

3.5.4.3 Outputs
The system allows the authorized user to login and an unauthorized user is denied to enter the system .It also allows a new user to register on to the system.

DEPARTMENT OF COMPUTER APPLICATION

52

DATA ENCRYPTION USING BRAIN SIGNALS

ARCHITECTURAL DIAGRAM OF DATA ENCRYPTION USING BRAIN SIGNALS

DATA ENCRYPTION

USER LOGIN

INPUT SAMPLE

GENERAL HUFFMAN TREE

SHUFFLE HUFFMAN TREE

BROWSE THE SAMPLE

ENCRYPTION SELECT SAMPLE

BROWSE FILE

DECRYPTION

ENTER THE TEXT TO ENCRYPT

SELECT THE HUFFMAN TREE

SELECT THE HUFFMAN TREE

DECRYPT

ENCRYPT

DEPARTMENT OF COMPUTER APPLICATION

53

DATA ENCRYPTION USING BRAIN SIGNALS

SYSTEM TESTING AND IMPLIMENTATION

DEPARTMENT OF COMPUTER APPLICATION

54

DATA ENCRYPTION USING BRAIN SIGNALS

4.SYSTEM TESTING AND IMPLIMENTATION


4.1 INTRODUCTION
Testing is the process of executing a program with the intent of finding any errors. Testing is vital to the success of the system. Without proper testing, hide errors will surface after sometime of use and perhaps irreversible damage has been done to valuable data. A series of tests like responsiveness, its value, stress and security are performed before the system is ready for user acceptance testing. System testing follows the logical conclusion that is all the part of the system are tested and found to be working properly under all kinds of situations, and then the system is achieving its goal of processing the data perfectly according to user rules and requirements. System testing is aimed at ensuring the system works accurately before live operation commences. Testing is vital to the system. System testing makes a logical assumption that if all parts of the system are correct. The gaol will be successfully achieved. The candidate system is subjected to verity tests: Online Response, Volume, and Stress

Testing techniques Black Box Testing


Knowing the specified function that a product has been designed to perform, test can be conducted that each function is fully operational. Black box test are carried out to test that input to a function is properly accepted and output is correctly produced. A black box test examine some aspect of the system , some aspect of a system with little regards for the internal structure of the software errors categories are found through black box testing, Incorrect or missing function Interface errors Errors in data base structure /external database access Performance errors Initialization and termination errors in the following

DEPARTMENT OF COMPUTER APPLICATION

55

DATA ENCRYPTION USING BRAIN SIGNALS

White Box Testing White box testing of software is predicted on close examination of procedural details. The status of project may be tested at various points to determine whether the expected or asserted status is corresponding to the actual status. Using this , the following test cases can be arrived: Exercise all logical conditions on there true and false side Execute all loops within there boundaries and their operation bounds Exercise internal data structure to ensure there validity

Testing Methods
System testing is the stage of implementation, which is aimed at ensuring that, these system works efficiently before the real operation commences. The system testing is intended to find out errors in the system .However this is virtually impossible since no programs will be free and clear of errors. Therefore useful and practical approach to tracing the errors should be employed. System testing is the critical aspect of software quality assurance and represents the ultimate review of specification, design and coding. Testing is the process of executing the program with the explicit intention of finding errors that makes the program fails. Testing is vital to the success of the system. During testing the system is used experimentally to ensure that the software does not fail. That is, it will run according to its specifications and in the way user expects too. The system is tested with special test data and the results are examined for their validity. Test cases are devised with these purposes in mind. It is a series of data that the system will process as a normal input. The software units developed in the system are modules and routines that are assembled and integrated to perform the required function of the system.

Types of Testing
Testing represents an interesting anomaly for the software. During earlier definition and development phases, it was attempted to build software from abstract concepts to tangible implementation. The testing is responsible to ensure that the product that has built performs the way that the detailed design documentation specifies.

DEPARTMENT OF COMPUTER APPLICATION

56

DATA ENCRYPTION USING BRAIN SIGNALS

There are different types of system testing methods and some of them are:

UNIT TESTING
In unit testing different modules are tested against the specification produced during the design of modules. Unit testing is essential for verification during the coding phase. The aim is to test the internal logic of the modules. The tests are carried out during the programming stage itself. Manage sample form gives the input sample .Huffman tree form allows to create the Huffman tree using the sample information. Encryption& decryption form shows the encrypted form and decrypted form respectively.

INTEGRATION TESTING
In unit testing different modules are tested against the specification produced during the design of modules. Unit testing is essential for verification during the coding phase. The aim is to test the internal logic of the modules. The tests are carried out during the programming stage itself. Each module like key generation and encoding of data have to be tested under this project to uncover the errors associated with interface of the modules.

VALIDATION TESTING
At the culmination of integration testing, software is completely assembled as a package; interfacing errors have been recovered and corrected and a final series of a software tests-validation tests begin. Validation testing can be defined in many ways but a simple definition is that validation succeeds when the software functions in a manner that can be reasonably expected by the customer. Data encryption using brain signals offers that the encryption is robust to fraudulent attacks as compared to other encryption systems.

OUTPUT TESTING
Output testing is useful to know the valid output of the current application system. Here we gives the input text file to do the encryption process. We have two separate forms for encrypting and decrypting the input data. After performing validation test, the next phase is output test of the system, since no system could be useful if it does not produce desired output in the desired format .Here we gives encrypted file as input to the decrypting form.

DEPARTMENT OF COMPUTER APPLICATION

57

DATA ENCRYPTION USING BRAIN SIGNALS

4.2

System Implementation
Implementation is the stage of the project where the theoretical design is

turned into working system, in this stage the installation of the package in the real environment, to the satisfaction of the intended user and the operation of the system. Implementation includes all those activities that take place to convert from the old system to new one. The new system may be totally new, replacing an existing system manual or automate system or it may be a major modification to an existing system. Proper implementation is essential to provide a reliable system to meet organization requirements. Successful implementation may not guarantee improvement in the organization using the new system, but improper installation will prevent it. The process of putting the developed system in actual use is called system implementation. This include all those activities that take place convert from the old system to new system can be implemented only after through testing is done and if it is found to be working according to the specification. The system personnel check the feasibility of the system. The most crucial stage is achieving a new system for the user that will work efficiently. It involves careful planning, investigation of the current system and its constraints on implementation, design of methods of achieve the changeover. The more complex the system being implemented, the more involved will be the system analysis and the design required effort required just for implementation. The implementation stage involves following tasks: 1. Careful planning. 2. Investigating of system and constraint. 3. Design of methods to achieve the changeover. 4. Training of staff in the change over phase. 5. Evaluation of the changeover method.

Training
After providing the necessary basic training on the computer awareness the users will have to be trained on the new system such as screen such as screen flow, screen design, type of help on the screen, type of errors while entering the data the corresponding validation check at each entry and the ways to correct the data entered.
DEPARTMENT OF COMPUTER APPLICATION

58

DATA ENCRYPTION USING BRAIN SIGNALS

It should then cover information needed by the specific user/group to use the system while imparting the training of the program on the application.

Conversion
It is the process of performing all of the operation that result directly in the turnover of the new system to the user. Conversion has two parts: The creation of the conversion plan at the start of the development phase and the implementation of the plan throughout the development phase The creation of a system change over plan at the end of the development phase and the implementation of the plan at the beginning of the operation phase.

Post Implementation Review


The post implementation review in the implementation process as a whole is conducted after the implementation of the actual software in the site. It is conducted using the review document. This may contain the answers to the following question. 1. What was the purpose of the project? 2. What would you like about the implementation process? 3. What things would you change if you had to do it again tomorrow? 4. Was communication effective throughout the process?

4.3 DEBUGGING
Once the software is fully developed and implemented, the company starts to use the software. The company also goes and more division can be attached to the company, or the database of the company can grow in size. So after some time the software, which has been installed, needs some modification. If the software need modification all the steps needed to develop new software has to be executed. The need has to be studied, the design has to be made and coding has to be done. Then the new module has to be connected to the existing software modules. Once the software is working perfect also we have to do routine testing and any new bug is found out, immediately it has to be fixed. No software ever developed will be bug free forever. When a new situation arises, the software cans creat an error, but if it is found out and repaired the software will not be causing more problems. Always
DEPARTMENT OF COMPUTER APPLICATION

59

DATA ENCRYPTION USING BRAIN SIGNALS

maintenance has to be done on the software, for to make the software work perfectly without any errors. Maintenance of the software is one of major step in the computer animation. Software which is developed by the engineer, should undergo maintenance process in regular interval of time goes on new problems arise and it must be corrected accordingly. Maintenance and enhancement are a long term process. In this project, the maintenance is carried over by the staff concern. Since they are the key person to develop this project they know clearly about the project and coding structure. So, they will change the coding whenever required. Regarding the project maintenance, the changes will occur then and there according to the conditions. Various types of maintenance that can be made are: Corrective maintenance Adaptive maintenance Prefecture maintenance Reverse engineering Re engineering The staff in the concern are parted each and every level of the project. So they dont need any training of software. During the development process they sit and entered each and every entry to test the project, they themselves used this is an opportunities to take training in the software so extra training is not needed for the user.

4.4

SYSTEM SECURITY
Any system developed should be secured and protected against possible hazards. Security measures are provided to prevent unauthorized access of the database at various levels. Only the authorized user should be allowed to operate the system. To ensure job seekers. They have options to change there password after the successful login. The username and password mechanism is to be provides at the administrator and the user level to ensure security. The software restricts the administrator, recruiter and job seeker to enter the system only through login utility and exit using logout utility in the proposed project. Form level checks can be given to control the data access. An uninterrupted power supply should be provided so that the power failure or voltage
DEPARTMENT OF COMPUTER APPLICATION

60

DATA ENCRYPTION USING BRAIN SIGNALS

fluctuation will not erase the data. The login details are kept confidential and cannot be used by others. Input data is also validated before they are posted to the database. This can be achieved by using validation controls available with ASP.Net, which has built in security, features which hides the business logic from end users. User Recognition When a user is entered his identity is recognised by the system using username and password retrieval. Menu Access Menu access is given to each category of employee according to their role in the organization. Each user will get separate menu for he has given access is the system. User Session A user is created when user enters to the system he can access the services of the system till he logged out of the system.

4.5

SCOPE FOR FUTUR ENHANCEMENTS


The software is developed in ASP.net which makes the system

more reliable and compatible with the other environments. The application proves better extensibility and flexibility for future enhancements. Any further requirement application is possible with the same features guaranteed. The design of this software is in such a way that the addition of any new module if necessary is possible without affecting the integrity of the present system. The existing system can be modified in such a way that it can be used by other firms with similar requirements. This software is more compatible for future. Due to the high growth of the hacking technology almost all security systems are becoming not useful. Here hackers cant do more with it.

DEPARTMENT OF COMPUTER APPLICATION

61

DATA ENCRYPTION USING BRAIN SIGNALS

CONCLUSION

DEPARTMENT OF COMPUTER APPLICATION

62

DATA ENCRYPTION USING BRAIN SIGNALS

CONCLUSION
A novel method of data encryption using event-related EEG has been proposed. EEG from gamma band spectral range from specific channels was used to generate the biometric encryption key. This key was then used to shuffle leaf nodes in the Huffman tree generated from the data with Huffman coding, thereby changing the code words that would be necessary during decoding. The complete key generation process takes slightly more than one second (therefore comparable to any other bio-encryption method) and combined with the simple but effective Huffman tree shuffling/de-shuffling, the whole procedure is fast enough for system implementation. Experimental study with biometric encryption key generated by 10 subjects gave good TP rates over 40 trials conducted at different times. Though the TN rates are somewhat high for system implementation, this is a pilot study and we believe that further work will improve the situation. The possible sources of error are that the subject does not concentrate on looking at the picture and due to noise in recording the EEG data. With this lower error rate, the proposed data encryption using EEG is especially advantageous over other biometrics because of its robustness to withstand fraudulent attacks. Further, data is not only encrypted but compressed as well. The only major disadvantage of the method lies in the cumbersome EEG data recording using wet electrodes but the current significant advances in dry electrode design would allow EEG to be recorded using a simple cap/hat. We hope that this study will stimulate and encourage further exploration on this rather neglected but promising biometric cryptosystem.

DEPARTMENT OF COMPUTER APPLICATION

63

DATA ENCRYPTION USING BRAIN SIGNALS

APPENDICES
A.DIAGRAMS

DEPARTMENT OF COMPUTER APPLICATION

64

DATA ENCRYPTION USING BRAIN SIGNALS

1 USECASE DIAGRAM

Login Process

Sample creation

Huffman code creation

Data Encryption

Data Decryption

DEPARTMENT OF COMPUTER APPLICATION

65

DATA ENCRYPTION USING BRAIN SIGNALS

2. CLASS DIAGRAM

Login Register() Submit()

Register UserId Password Username Address Email Phone Add()

Manage Sample

HuffmanNode Nodename SampleIndex SampleName HuffmanNode Dialog()

Util Key Create Key() Encrypt() Decrypt()

Currentsample SampleInfo SampleType Next() Previous() Add() HuffmanTree EEG Sample SampleIndex SampleName Load() Save() Shuffle()

Encrypt CurrentkeyName SampleId Referencekey DataEncrypt()

Decrypt Referencekey SampleId CurrentkeyName DataDecrypt()

DEPARTMENT OF COMPUTER APPLICATION

66

DATA ENCRYPTION USING BRAIN SIGNALS

3. DATA FLOW DIAGRAM


0th level

1st Level

DEPARTMENT OF COMPUTER APPLICATION

67

DATA ENCRYPTION USING BRAIN SIGNALS

2nd LEVEL DFD FOR HUFFMAN TREE GENERATION

DEPARTMENT OF COMPUTER APPLICATION

68

DATA ENCRYPTION USING BRAIN SIGNALS

2 LEVEL DFD FOR ENCRYPTION

2 LEVEL DFD FOR DECRYPTION

DEPARTMENT OF COMPUTER APPLICATION

69

DATA ENCRYPTION USING BRAIN SIGNALS

Key generation flow chart

DEPARTMENT OF COMPUTER APPLICATION

70

DATA ENCRYPTION USING BRAIN SIGNALS

4. ENTITY-RELATIONSHIP DIAGRAM

DEPARTMENT OF COMPUTER APPLICATION

71

DATA ENCRYPTION USING BRAIN SIGNALS

USERID

USERNAME PASSWORD

EEGSampleID

EEGSampleType EEGSamplename

status

HuffmanTreeID USER ADD EEGSamples

sampleID

HuffmantreeN huffmanTreeD ame escription

COMPRESS

HuffmanTree

KeyID

sampleID

KeyName ReferenceKey Referencedkey

Keys

KeyGeneration

DEPARTMENT OF COMPUTER APPLICATION

72

DATA ENCRYPTION USING BRAIN SIGNALS

B .CODE SNIPPET

DEPARTMENT OF COMPUTER APPLICATION

73

DATA ENCRYPTION USING BRAIN SIGNALS

CODING DESCRIPTION
Connection class
In this class we uses c# .net as front end and MS Access as back end. data encryption_db.mdb is the data base used in the system. Here it provides OLEDB connection to connect with MS Access. OleDb connection creates the connection with the tables in the data encryption_db.mdb. Login user method reads the user name and password for login process. Get Sample for User method for reading the browsed samples. It stores in an array object[][], Add New User, Add New Key, Add new EEG sample,Add New Huffman Tree methods are used for specific functions. All these methods are defined in the DBUtils connection.

Key Creation
Encryption Decryption Key Creator Form class contains the methods for creating key.create key button shows the key creator form .it contains one textbox for giving the key name. Create key button creates the key. One message box displays showing key added and 128 key is displayed.

Connection class
public static class DBUtils { private static String ConnectionString = "Provider=SQLOLEDB;Data Source=USER-PC;Persist Security Info=True;OLE DB Services=-1;Integrated Security=SSPI;Initial Catalog=DataEncryption"; private static OleDbConnection connection; private static bool ShowThreadExceptions = false; public static int LoggedInUserId; public static bool Initialize(bool showThreadExceptions) { MessageBox.Show(Application.StartupPath); try { DBUtils.ShowThreadExceptions = showThreadExceptions;

DEPARTMENT OF COMPUTER APPLICATION

74

DATA ENCRYPTION USING BRAIN SIGNALS

DBUtils.connection = new OleDbConnection(DBUtils.ConnectionString); MessageBox.Show(DBUtils.connection.DataSource); DBUtils.connection.Open(); } catch (Exception e) { if (DBUtils.ShowThreadExceptions) { ThreadExceptionDialog exceptionDialog = new ThreadExceptionDialog(e); exceptionDialog.ShowDialog(); } return false; } return true; } public static bool UnLoad() { try { DBUtils.connection.Close(); } catch (Exception e) { if (DBUtils.ShowThreadExceptions) { ThreadExceptionDialog exceptionDialog = new ThreadExceptionDialog(e); exceptionDialog.ShowDialog(); } return false; } return true; } public static object[] LoginUser(String userName, String password) { try { OleDbCommand command = new OleDbCommand("SELECT * FROM db_Users WHERE USERNAME='" + userName+ "' AND PASSWORD='"+password+"'",DBUtils.connection); OleDbDataReader dataReader = command.ExecuteReader(); if (dataReader.HasRows) { object[] values = new object[dataReader.FieldCount]; dataReader.Read(); dataReader.GetValues(values);

DEPARTMENT OF COMPUTER APPLICATION

75

DATA ENCRYPTION USING BRAIN SIGNALS

DBUtils.LoggedInUserId = Int32.Parse(values[0].ToString()); dataReader.Close(); return values; } else { dataReader.Close(); return null; } } catch (Exception e) { if (DBUtils.ShowThreadExceptions) { ThreadExceptionDialog exceptionDialog = new ThreadExceptionDialog(e); exceptionDialog.ShowDialog(); } return null; } //return null; } public static object[][] GetKeysForUser(int userID) { try { OleDbCommand command = new OleDbCommand("SELECT * FROM db_Keys WHERE USERID="+userID,DBUtils.connection); OleDbDataReader dataReader = command.ExecuteReader(); ArrayList rows = new ArrayList(); if (dataReader.HasRows) { while (dataReader.Read()) { object[] values = new object[dataReader.FieldCount]; dataReader.GetValues(values); rows.Add(values); } dataReader.Close(); object[] keyRows = rows.ToArray(); object[][] keys = new object[keyRows.Length][]; int index = 0; foreach (object key in keyRows)

DEPARTMENT OF COMPUTER APPLICATION

76
{

DATA ENCRYPTION USING BRAIN SIGNALS


object[] keyRow = (object[])key; keys[index++] = keyRow; } return keys; } else { dataReader.Close(); return null; }

} catch (Exception e) { if (DBUtils.ShowThreadExceptions) { ThreadExceptionDialog exceptionDialog = new ThreadExceptionDialog(e); exceptionDialog.ShowDialog(); } return null; } } public static object[][] GetSamplesForUser(int userID) { try { OleDbCommand command = new OleDbCommand("SELECT * FROM db_EEGSamples WHERE USERID=" + userID,DBUtils.connection); OleDbDataReader dataReader = command.ExecuteReader(); ArrayList rows = new ArrayList(); if (dataReader.HasRows) { while (dataReader.Read()) { object[] values = new object[dataReader.FieldCount]; dataReader.GetValues(values); rows.Add(values); } dataReader.Close(); object[] sampleRows = rows.ToArray(); object[][] samples = new object[sampleRows.Length][]; int index = 0; foreach (object sample in sampleRows)

DEPARTMENT OF COMPUTER APPLICATION

77
{

DATA ENCRYPTION USING BRAIN SIGNALS


object[] sampleRow = (object[])sample; samples[index++] = sampleRow; } return samples; } else { dataReader.Close(); return null; }

} catch (Exception e) { if (DBUtils.ShowThreadExceptions) { ThreadExceptionDialog exceptionDialog = new ThreadExceptionDialog(e); exceptionDialog.ShowDialog(); } return null; } } public static object[] GetKeyForKeyName(String keyName) { try { OleDbCommand command = new OleDbCommand("SELECT * FROM db_Keys WHERE KEYNAME='" + keyName + "'",DBUtils.connection); OleDbDataReader dataReader = command.ExecuteReader(); if (dataReader.HasRows) { dataReader.Read(); object[] values = new object[dataReader.FieldCount]; dataReader.GetValues(values); dataReader.Close(); return values; } else { dataReader.Close(); return null; } } catch (Exception ee) { if (DBUtils.ShowThreadExceptions) {

DEPARTMENT OF COMPUTER APPLICATION

78

DATA ENCRYPTION USING BRAIN SIGNALS

ThreadExceptionDialog exceptionDialog = new ThreadExceptionDialog(ee); exceptionDialog.ShowDialog(); } return null; } } public static object[][] GetKeysForSamples(int sampleID) { try { OleDbCommand command = new OleDbCommand("SELECT * FROM db_Keys WHERE SAMPLEID=" + sampleID,DBUtils.connection); OleDbDataReader dataReader = command.ExecuteReader(); ArrayList rows = new ArrayList(); if (dataReader.HasRows) { while (dataReader.Read()) { object[] values = new object[dataReader.FieldCount]; dataReader.GetValues(values); rows.Add(values); } dataReader.Close(); object[] keyRows = rows.ToArray(); object[][] keys = new object[keyRows.Length][]; int index = 0; foreach (object key in keyRows) { object[] keyRow = (object[])key; keys[index++] = keyRow; } return keys; } else { dataReader.Close(); return null; } } catch (Exception e) { if (DBUtils.ShowThreadExceptions) { ThreadExceptionDialog exceptionDialog = new ThreadExceptionDialog(e);

DEPARTMENT OF COMPUTER APPLICATION

79
} return null; } }

DATA ENCRYPTION USING BRAIN SIGNALS


exceptionDialog.ShowDialog();

public static object[] GetSamplesForSampleID(int sampleID) { try { OleDbCommand command = new OleDbCommand("SELECT * FROM db_EEGSamples WHERE EEGSAMPLEID=" + sampleID, DBUtils.connection); OleDbDataReader dataReader = command.ExecuteReader(); if (dataReader.HasRows) { dataReader.Read(); object[] values = new object[dataReader.FieldCount]; dataReader.GetValues(values); dataReader.Close(); return values; } else { dataReader.Close(); return null; } } catch (Exception ee) { if (DBUtils.ShowThreadExceptions) { ThreadExceptionDialog exceptionDialog = new ThreadExceptionDialog(ee); exceptionDialog.ShowDialog(); } return null; } } public static object[][] GetHuffmanTreesForSampleID(int userID,int sampleID) { try { String sql = "SELECT * FROM db_HuffmanTrees WHERE SAMPLEID=" + sampleID + " AND USERID="+userID; if(sampleID==-1) sql = "SELECT * FROM db_HuffmanTrees WHERE USERID="+userID;

DEPARTMENT OF COMPUTER APPLICATION

80
DBUtils.connection);

DATA ENCRYPTION USING BRAIN SIGNALS


OleDbCommand command = new OleDbCommand(sql, OleDbDataReader dataReader = command.ExecuteReader(); ArrayList rows = new ArrayList();

if (dataReader.HasRows) { while (dataReader.Read()) { object[] values = new object[dataReader.FieldCount]; dataReader.GetValues(values); rows.Add(values); } dataReader.Close(); object[] huffmanTreeRows = rows.ToArray(); object[][] huffmanTrees = new object[huffmanTreeRows.Length][]; int index = 0; foreach (object huffmanTree in huffmanTreeRows) { object[] huffmanTreeRow = (object[])huffmanTree; huffmanTrees[index++] = huffmanTreeRow; } return huffmanTrees; } else { dataReader.Close(); return null; } } catch (Exception e) { if (DBUtils.ShowThreadExceptions) { ThreadExceptionDialog exceptionDialog = new ThreadExceptionDialog(e); exceptionDialog.ShowDialog(); } return null; } } public static bool AddNewUser(String userName, String password, String address, String email, String phone) { try

DEPARTMENT OF COMPUTER APPLICATION

81
{

DATA ENCRYPTION USING BRAIN SIGNALS

OleDbCommand command = new OleDbCommand("SELECT * FROM db_Users", DBUtils.connection); OleDbDataAdapter adapter = new OleDbDataAdapter(command.CommandText, DBUtils.connection); DataSet dataSetUsers = new DataSet("db_Users"); OleDbCommandBuilder cmdBuilder = new OleDbCommandBuilder(adapter); adapter.Fill(dataSetUsers, "db_Users"); DataRow newUser = dataSetUsers.Tables["db_Users"].NewRow(); newUser["USERID"] = (dataSetUsers.Tables["db_Users"].Rows.Count == 0 ? ((int)dataSetUsers.Tables["db_Users"].Rows[dataSetUsers.Tables["db_Users"]. Rows.Count - 1]["USERID"]) + 1 : 1); newUser["USERNAME"] = userName; newUser["PASSWORD"] = password; newUser["ADDRESS"] = address; newUser["EMAIL"] = email; newUser["PHONE"] = phone; dataSetUsers.Tables["db_Users"].Rows.Add(newUser); adapter.Update(dataSetUsers, "db_Users"); adapter.Dispose(); dataSetUsers.Dispose(); command.Dispose(); return true; } catch (Exception e) { if (DBUtils.ShowThreadExceptions) { ThreadExceptionDialog exceptionDialog = new ThreadExceptionDialog(e); exceptionDialog.ShowDialog(); } return false; } } public static bool AddNewKey(int userID, int sampleID, String keyname, object reference_key, object referenced_key) { try { OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT * FROM db_Keys", DBUtils.connection); adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;

DEPARTMENT OF COMPUTER APPLICATION

82

DATA ENCRYPTION USING BRAIN SIGNALS


DataSet dataSetKeys = new DataSet("db_Keys");

OleDbCommandBuilder cmdBuilder = new OleDbCommandBuilder(adapter); adapter.Fill(dataSetKeys, "db_Keys"); DataRow newKey = dataSetKeys.Tables["db_Keys"].NewRow(); newKey["KEYID"] = (dataSetKeys.Tables["db_Keys"].Rows.Count != 0 ? (((int) dataSetKeys.Tables["db_Keys"].Rows[dataSetKeys.Tables["db_Keys"].Rows.Count - 1]["KEYID"])+1) : 1); newKey["USERID"] = userID; newKey["SAMPLEID"] = sampleID; newKey["KEYNAME"] = keyname; newKey["REFERENCE_KEY"] = Hexer.Bytes2Text(Hex.Encode((byte[])reference_key)); newKey["REFERENCED_KEY"] = Hexer.Bytes2Text(Hex.Encode((byte[])referenced_key)); dataSetKeys.Tables["db_Keys"].Rows.Add(newKey); adapter.Update(dataSetKeys, "db_Keys"); adapter.Dispose(); return true; } catch (Exception e) { if (DBUtils.ShowThreadExceptions) { ThreadExceptionDialog exceptionDialog = new ThreadExceptionDialog(e); exceptionDialog.ShowDialog(); } return false; } } public static bool AddNewEEGSample(int userID, object eegSample,String eegSampleType,String sampleName,String age,String description) { try { OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT * FROM db_EEGSamples", DBUtils.connection); adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey; DataSet dataSetSamples = new DataSet("db_EEGSamples");

OleDbCommandBuilder cmdBuilder = new OleDbCommandBuilder(adapter); adapter.Fill(dataSetSamples, "db_EEGSamples");

DEPARTMENT OF COMPUTER APPLICATION

83

DATA ENCRYPTION USING BRAIN SIGNALS

DataRow newSample = dataSetSamples.Tables["db_EEGSamples"].NewRow(); newSample["EEGSAMPLEID"] = (dataSetSamples.Tables["db_EEGSamples"].Rows.Count != 0 ? ((int)dataSetSamples.Tables["db_EEGSamples"].Rows[dataSetSamples.Tables["db _EEGSamples"].Rows.Count - 1]["EEGSampleID"]) + 1 : 1); newSample["USERID"] = userID; newSample["EEGSAMPLETYPE"] = eegSampleType; newSample["EEGSAMPLENAME"] = sampleName; newSample["AGE"] = age; newSample["DESCRIPTION"] = description; newSample["EEGSAMPLE"] = eegSample; newSample["ANALYSISREPORT"] = ""; dataSetSamples.Tables["db_EEGSamples"].Rows.Add(newSample); adapter.Update(dataSetSamples, "db_EEGSamples"); adapter.Dispose(); return true; } catch (Exception e) { if (DBUtils.ShowThreadExceptions) { ThreadExceptionDialog exceptionDialog = new ThreadExceptionDialog(e); exceptionDialog.ShowDialog(); } return false; } } public static bool AddNewHuffmanTree(int userID, int sampleID, String huffmanTreeName, String description, object huffmanTree) { try { OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT * FROM db_HuffmanTrees", DBUtils.connection); adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey; DataSet dataSetHuffmanTrees = new DataSet("db_HuffmanTrees"); OleDbCommandBuilder cmdBuilder = new OleDbCommandBuilder(adapter); adapter.Fill(dataSetHuffmanTrees, "db_HuffmanTrees"); DataRow newHuffmanTree = dataSetHuffmanTrees.Tables["db_HuffmanTrees"].NewRow(); newHuffmanTree["HUFFMANTREEID"] = (dataSetHuffmanTrees.Tables["db_HuffmanTrees"].Rows.Count != 0 ?

DEPARTMENT OF COMPUTER APPLICATION

84

DATA ENCRYPTION USING BRAIN SIGNALS

((int)dataSetHuffmanTrees.Tables["db_HuffmanTrees"].Rows[dataSetHuffmanTree s.Tables["db_HuffmanTrees"].Rows.Count - 1]["HUFFMANTREEID"]) + 1 : 1); newHuffmanTree["USERID"] = userID; newHuffmanTree["SAMPLEID"] = sampleID; newHuffmanTree["HUFFMANTREENAME"] = huffmanTreeName; newHuffmanTree["HUFFMANTREEDESCRIPTION"] = description; newHuffmanTree["HUFFMANTREE"] = (byte[]) huffmanTree; dataSetHuffmanTrees.Tables["db_HuffmanTrees"].Rows.Add(newHuffmanTree); adapter.Update(dataSetHuffmanTrees, "db_HuffmanTrees"); adapter.Dispose(); return true; } catch (Exception e) { if (DBUtils.ShowThreadExceptions) { ThreadExceptionDialog exceptionDialog = new ThreadExceptionDialog(e); exceptionDialog.ShowDialog(); } return false; } } } } }

DEPARTMENT OF COMPUTER APPLICATION

85

DATA ENCRYPTION USING BRAIN SIGNALS

C.SAMPLE INPUT AND OUTPUT LAYOUTS

DEPARTMENT OF COMPUTER APPLICATION

86

DATA ENCRYPTION USING BRAIN SIGNALS

FORM DESCRIPTION
The user can login using one username and password. Main form contains many menu strip controls for specific functions such as uploading the EEG .edf file, Huffman tree creation, encryption, decryption; etc.Here the user can browse only the ASCII file of corresponding .edf file. User can brose more than one file and also having an option for giving the details of file to a data base.EEG database contains the fields such as name, age and description. Next is to create the Huffman tree using the size of the signal. Huffman tree form displays the tree details including the size of the signal using a subform.The user can create the tree by using the size of the signal in the determined space in the Huffman tree form. BY shifting the tree value user gets the tree value that is to be used for encryption decryption processes. It displays in a message box. The tree name, description, size, etc are stored in a database. Next is the process for encryption and decryption. It contains as submenu strip controls under the data analysis main menu strip control item.Encryptio form contain browse button control for browsing the input data file to be encrypted. When create key button control loads, key creator form displays. Here we select the specified sample and create a key by giving one name for it. Encrypt button control encrypts the input data file. Decryption process is almost same as it done in encryption form. Here the user decrypts the encrypted file by using another key .The biometric key generated here is 128-bit key. Here we use Rijindale single key algorithm for encryption and decryption process.

1. Data Encryption Main Page


In this main page we include all the functions included in the Data Encryption. It is given all the controls in the data strip menu items. Menu strip Data Encryption contains Huffman tree process, Wave form analyser, login like controls. Data analysis menu strip controls makes path to encryption, decryption processes. It represents a control that allows the user to select a single item from a list of controls. The registered user can only make the process after login to the application. Here we use Database utilities for lookup and data manipulation written in c#. This will facilitate and speed up the repetitive tasks. We have a try, catch block for exception handling

DEPARTMENT OF COMPUTER APPLICATION

87

DATA ENCRYPTION USING BRAIN SIGNALS

2. Login page:
The registered users only can have makes the process contained in the main page menu strip controls. The registered user details are stored in a data base. Data accessed from the database using SQL data adapter.

DEPARTMENT OF COMPUTER APPLICATION

88

DATA ENCRYPTION USING BRAIN SIGNALS

DEPARTMENT OF COMPUTER APPLICATION

89

DATA ENCRYPTION USING BRAIN SIGNALS

3.
DEPARTMENT OF COMPUTER APPLICATION

90

DATA ENCRYPTION USING BRAIN SIGNALS

MANAGE SAMPLES
In this application we imports the input signal of EEG signal in the form of EDF (European Data Format) corresponding to each signals. Here the submenu strip item EEG sample contains two items, ie, manage samples and analyse wave form. In manage sample item, user adds the sample into directory. The second one gives yhe analysis report for the corresponding signal. The analysis report contains the size and frequencies of that signals.

DEPARTMENT OF COMPUTER APPLICATION

91

DATA ENCRYPTION USING BRAIN SIGNALS

4. CREATING TREES AND SHUFFLED TREES


Huffman tree would be generated based on the data from the EDF file and then the data would be encrypted by using the biometric key generated from the .edf file. Huffman tree submenu strip control item creates the Huffman tree values. Also here the users have an option for creating the shuffled tree value by using another windows form workings inside that Huffman tree submenu strip item

DEPARTMENT OF COMPUTER APPLICATION

92

DATA ENCRYPTION USING BRAIN SIGNALS

DEPARTMENT OF COMPUTER APPLICATION

93

DATA ENCRYPTION USING BRAIN SIGNALS

5. ENCRYPTION AND KEY CREATION


The Data analysis menu strip control item makes the process both encryption and decryption. There is a create key button control in encryption form for creating biometric key used for encryption. Create key button control opens the path for creating Huffman tree and shuffled tree values. Then here displays one message box to show the key added.

DEPARTMENT OF COMPUTER APPLICATION

94

DATA ENCRYPTION USING BRAIN SIGNALS

DEPARTMENT OF COMPUTER APPLICATION

95

DATA ENCRYPTION USING BRAIN SIGNALS

6.DECRYPTION

DEPARTMENT OF COMPUTER APPLICATION

96

DATA ENCRYPTION USING BRAIN SIGNALS

BIBLIOGRAPHY

DEPARTMENT OF COMPUTER APPLICATION

97

DATA ENCRYPTION USING BRAIN SIGNALS

BIBLIOGRAPHY
Referred books 1. Applied cryptography. Bruce Schneider. 2. Cryptography engineering. Niles Ferguson. Websites: 1. www.computer.org 2.mitpress.mit.edu

DEPARTMENT OF COMPUTER APPLICATION

Das könnte Ihnen auch gefallen