You are on page 1of 60

Data Encryption Using Brain Signals

Project Report 2007 Admission

INTRODUCTION

Dept of CSE

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

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. STATEMENT ABOUT THE PROBLEM Data encryption is not implemented by ordinary cryptographic applications. We implement a more secured environment for cryptography & security. Here biometric cryptosystem utilize physiological & behavioral 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. 1.2. OBJECTIVE 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

Dept of CSE

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

faked and the user could easily avoid concavity on the picture during forced situations 1.3. METHODOLOGY An encryption key is generated from EEG sampled wave form by horizontally scanning the waveform. And key function EEG signals is used for encrypting and decrypting data .More secured encryption is offered. The procedure carried out for this project work is as given below. Detailed study of the existing system Collection of various types of data Study of various types of data flow of the system. Generation of encryption key Encryption of data Programmers development Modification and testing of the system. Preparation of reports

Dept of CSE

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

2. SYSTEM ANALYSIS
2.1. EXISTING SYSTEM 2.1.1. DATA ENCRYPTION USING OTHER TECHNIQUES: Existing encryption systems are very familiar encryption techniques using the signals from finger,eye,face or using any other complex text patterns. It 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.1.2. DRAWBACKS: 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. 5. False acceptance.

Dept of CSE

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

2.2. PROPOSED SYSTEM: 2.2.1. DATA ENCRYPTION USING ELECTROENCEPHALOGRAPHY (EEG): 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

Dept of CSE

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals shuffle the Huffman tree using an

Project Report 2007 Admission

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 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. 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

Dept of CSE

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

horizontally and the wave patterns are applied on the Huffman tree and encrypted. So in this way a better secured encryption is achieved. ADVANTAGES: 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.

2.3. REQUIREMENTS ELICITATION Requirements Elicitation or Requirements gathering focuses on the objectives of the system, what is to be accomplished, how the system or the product fits into the needs of the organization and finally how to use the system on a daily basis. One of the important steps in this stage is accessing the economic, technical and operational and business feasibility of the proposed system. 2.3.1. FEASIBILITY STUDY 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, behavioral and economic feasibility of developing the computer based systems.

Dept of CSE

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

This is done by investigating the existing system and generating the ideas about the new system.

2.3.1.1. 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.3.1.2. 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. 2.3.1.3. OPERATIONAL FEASIBILITY Operational feasibility is the consideration about the working of the system after installation. The system should be simple enough so that nonengineers 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. 2.4 MAIN MODULES

Dept of CSE

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals 2.4.1. EEG ANALYSIS MODULE

Project Report 2007 Admission

The EEG Analysis Module Gets Samples of EEG Signals Images and EDF file of the corresponding EEG signals. There produces some edf file with the EEG wave form. It contains more fields which gives the detailed description about the signal. It also contains the fields which contains frequency and size of the biometric signal. 2.4.2. HUFFMAN ENCODING MODULE The Huffman Encoding Module utilizes the Huffman tree for encoding data and images. Here in this module we creates the Huffman tree using the size of the signal. By shuffling the tree values and shrinking the shuffled tree value , we get the biometric key for encryption. 2.4.3. ENCRYPTION MODULE The Encryption Module encrypts data from key obtained from EEG Analysis Module and Encoding Scheme used by the Huffman Encoding Module. Here we have the option for selecting the file to be encrypted. Here encryption is done using Rigindael algorithm. Rigindael algorithm is mainly used for encryption by using single private key. The Data Analysis and Encryption combines the Huffman tree and Encryption keys and analyses data already encrypted and finds if there are any security risks. 2.4.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 lot of forms used for user interface. Mainly for browsing the signal,creating Huffman tree,encryption and decryption. Without these mainforms applicaton also contains subforms.

Dept of CSE

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

3. SYSTEM REQUIREMENT 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.
3.1. HARDWARE SPECIFICATIONS:

EEG DEVICE PROCESSOR RAM HDD MONITOR


Dept of CSE

: : : : :
10

EEG Waveform Recorder


PENTIUM IV 256 MB 80GB DISPLAY PANEL (1024*764)
Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals MOUSE FDD PRINTER CD-ROM : : : :

Project Report 2007 Admission

LOGITECH OPTICAL MOUSE 1.44 MB INKJET SAMSUNG

3.2. SOFTWARE SPECIFICATIONS

OPERATING SYSTEM FRONT END BACK END HOST PLATFORM WEB SERVER WEB CLIENT INTERNAL STANDARD

: : : : : : : :

WINDOWS 2007 C# MS ACCESS 2007 ASP.Net WINDOWS 2007 SERVER IIS 5.0 IE 6.0 HTTP

Dept of CSE

11

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

4. COST AND BENEFIT ANALYSIS


In developing cost estimate for the system, we consider the following elements. Hardware Cost Software Cost Personal Cost Facility Cost Operating Cost Hardware Cost It is related to new hardware like computer peripherals and network infrastructures, hardware cost for this system is the cost for the minimum requirement i.e. Pentium computer with 512 MB of RAM. Here it also needs an EEG device for getting input EEG data file. Its a high costly device. Software Cost It includes software required to run the system .It is considerably reduced because all software using by this system except Windows XP operating system are freeware. Personal Cost It requires human resource needed to operate the system. It includes the cost for training, salary etc. In the case of this system no training required for different users because it is easy to understand.
Dept of CSE 12 Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

5. SYSTEM DESIGN
5.1. DATA FLOW DIAGRAM

Data Flow Diagrams (DFD) is used to define the flow of the system and its resources such as information. Data Flow Diagrams are a way of expressing system requirements in a graphical manner. DFD represents one of the most ingenious tools used for structured analysis. A DFD is also known as a bubble chart. It has the purpose of clarifying system requirements and identifying major transformations that will become programs in system design. In the normal convention, logical DFD can be completed using only 4 notations, : Represents Source/destination data : Represents data flow : Represents a process that transforms incoming data into outgoing flow. : Represents data store.

Dept of CSE

13

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

The DFD at the simplest level is referred to as the Context Analysis Diagram. These are expanded by level, each explaining its process in detail. Processes are numbered for easy identification and are normally labeled in block letters. Each Data flow is labeled for easy understanding.

0th LEVEL

Fig D1: level 0

Dept of CSE

14

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

1ST LEVEL

Fig D2: level 1

2nd LEVEL

Dept of CSE

15

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

Fig D3: level 2

3rd LEVEL

Fig D4 : level 3

Dept of CSE

16

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

3rd LEVEL

Fig D5: level 3

Dept of CSE

17

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals 5.2. KEY GENERATION FLOW CHART

Project Report 2007 Admission

Fig .1

5.3: BIOMETIC KEY GENERATION The European Data Format(EDF) is a simple and flexible format for exchange and storage of multichannel and biological and physical signals.EDF file can also containinterrupted EDF can store recordings,annotations,stimuli any medical recordings such and as events.Therefore

Dept of CSE

18

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

EMG,EEG,Evoked potentials,ECG as well as automatic and manual analysis results such as deltaplots,QRS parameters and sleep stages. An EDF file contains header files with 20 fields. Each fields gives the information about EEG like details pof patient, frequency, size, time, etc. Here we extract two fields of frequency and size. Some fields containing in the edf file are: Description 1. File name 2. Channels per frame. 3. Frames per epoch. 4. Events. 5. Sampling rate (khz). 6. Epoch start (sec) 7. Epoch end (sec) 8. Reference. 9. Channel location. 10. ICA weight. 11. Data set. 12. labels of channels. Total header length is: {(N+1)*256} bytes, where N is number of channels (including the status channel). The last 10 fields are defined for each fields separately. Each channel can be different. Represent the total file in a structure form. Out of these 20 fields extract two fields,ie,frequency and size. Both fields have same length of N*8 bytes. Then create the Huffman tree with respect to the range of frequencies. The total size of nodes should be equal to the size of signal. The tree values are shuffled for creating the shuffled Huffman tree. The output of the shuffled Huffman tree may be of greater than the value 128bit.For making the 128-bit use Huffman shrinking algorithm or compression

Dept of CSE

19

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

algorithm. The key idea of Huffman compression algorithm is that the most frequent data is exchanged for the shortest code word. First the given test patterns are divided by fixed bit unit. A high frequency bit set is assigned to a short codeword which is no longer than original bit set. The algorithm methods ouputs a128-bi pattern. It will be used as biometric key. 5.4. DATABASE DESIGN The overall objective in the development of database technology has been to treat data as an organizational resource and as an integrated whole. Database Management System allows data to be protected and organized separately from other resources. Database is an integrated collection of data. The most significant form of data as seen by the programmers is data as stored on the direct access storage devices .This is the difference between logical and physical data. The organization of data in the database aims to achieve three major objectives: Data integration Data integrity Data independence The databases are implemented using a DBMS package. Each particular DBMS has unique characteristics and general techniques for database design. When we store data in SQL Server we store data in tables. Tables in turn are stored in databases.

Dept of CSE

20

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals Table 1: user Primary key: user_ id Field name User id User name Password Address Email id Phone Table 2: tree Primary key : node Field name Data type Huffman tree id Int User id Int Sample id Int Huffman tree Nvarchar name Huffman tree Nvarchar description Huffman tree Nvarchar Table 3:EEG sample Primary key :name Field name EEG sample id User id EEG sample type EEG sample name Age Description EEG sample Data type Int Int Varchar Nvarchar Int Nvarchar Varchar Length 4 4 4 25 50 50 Data type int nvarchar nvarchar nvarchar nvarchar Long int Length 4 25 15 50 25 10

Project Report 2007 Admission

Description User id User name Password Address Email Phone no

Description Tree id User id Sample id Tree name Tree description tree

Length 4 4 10 50 4 50 15

Description Sample id User id Sample type Sample name Age Sample description sample

6. CODING

Dept of CSE

21

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

6.1. 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=Microsoft.Jet.OLEDB.4.0;Data Source=\"dataencryption_db.mdb\""; private static OleDbConnection connection; private static bool ShowThreadExceptions = false;

Dept of CSE

22

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

public static int LoggedInUserId; public static bool Initialize(bool showThreadExceptions) { MessageBox.Show(Application.StartupPath); try { DBUtils.ShowThreadExceptions = showThreadExceptions; 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; }

Dept of CSE

23

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

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 {

Dept of CSE

24

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

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); DBUtils.LoggedInUserId = Int32.Parse(values[0].ToString()); dataReader.Close(); return values; } else { dataReader.Close(); return null; } } catch (Exception e) { if (DBUtils.ShowThreadExceptions)

Dept of CSE

25

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals {

Project Report 2007 Admission

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];

Dept of CSE

26

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals dataReader.GetValues(values); rows.Add(values); } dataReader.Close(); object[] keyRows = rows.ToArray();

Project Report 2007 Admission

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; }

Dept of CSE

27

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals } catch (Exception e) { if (DBUtils.ShowThreadExceptions) {

Project Report 2007 Admission

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()) {

Dept of CSE

28

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

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) { object[] sampleRow = (object[])sample; samples[index++] = sampleRow; } return samples; } else { dataReader.Close(); return null;

Dept of CSE

29

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals } } catch (Exception e) { if (DBUtils.ShowThreadExceptions) {

Project Report 2007 Admission

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];

Dept of CSE

30

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

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[][] GetKeysForSamples(int sampleID) {

Dept of CSE

31

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals try {

Project Report 2007 Admission

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)

Dept of CSE

32

Veda Vyasa Institute of Technology

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) {

Project Report 2007 Admission

ThreadExceptionDialog exceptionDialog = new ThreadExceptionDialog(e); exceptionDialog.ShowDialog(); } return null; } } public static object[] GetSamplesForSampleID(int sampleID)

Dept of CSE

33

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals { try {

Project Report 2007 Admission

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)

Dept of CSE

34

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals { if (DBUtils.ShowThreadExceptions) {

Project Report 2007 Admission

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; OleDbCommand command = new OleDbCommand(sql, DBUtils.connection); OleDbDataReader dataReader = command.ExecuteReader();

Dept of CSE

35

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

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; }

Dept of CSE

36

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

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 {

Dept of CSE

37

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

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"].R ows.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");

Dept of CSE

38

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals adapter.Dispose(); dataSetUsers.Dispose(); command.Dispose(); return true; } catch (Exception e) { if (DBUtils.ShowThreadExceptions) {

Project Report 2007 Admission

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);

Dept of CSE

39

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;

Project Report 2007 Admission

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.Co unt - 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();

Dept of CSE

40

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

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");

Dept of CSE

41

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

OleDbCommandBuilder cmdBuilder = new OleDbCommandBuilder(adapter); adapter.Fill(dataSetSamples, "db_EEGSamples"); DataRow newSample = dataSetSamples.Tables["db_EEGSamples"].NewRow(); newSample["EEGSAMPLEID"] = (dataSetSamples.Tables["db_EEGSamples"].Rows.Count != 0 ? ((int)dataSetSamples.Tables["db_EEGSamples"].Rows[dataSetSamples.Tables["d b_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; }

Dept of CSE

42

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals catch (Exception e) { if (DBUtils.ShowThreadExceptions) {

Project Report 2007 Admission

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);

Dept of CSE

43

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

adapter.Fill(dataSetHuffmanTrees, "db_HuffmanTrees"); DataRow newHuffmanTree = dataSetHuffmanTrees.Tables["db_HuffmanTrees"].NewRow(); newHuffmanTree["HUFFMANTREEID"] = (dataSetHuffmanTrees.Tables["db_HuffmanTrees"].Rows.Count != 0 ? ((int)dataSetHuffmanTrees.Tables["db_HuffmanTrees"].Rows[dataSetHuffmanTr ees.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(newH uffmanTree); adapter.Update(dataSetHuffmanTrees, "db_HuffmanTrees"); adapter.Dispose(); return true; } catch (Exception e) { if (DBUtils.ShowThreadExceptions)

Dept of CSE

44

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals {

Project Report 2007 Admission

ThreadExceptionDialog exceptionDialog = new ThreadExceptionDialog(e); exceptionDialog.ShowDialog(); } return false; } } } } }

7. SYSTEM TESTING AND IMPLEMENTATION


Dept of CSE 45 Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

6.1. SYSTEM TESTING System testing is the stage of implementation, which is aimed at ensuring that the system works accurately and efficiently before live operation commences. Testing is the process of executing the program with the intent of finding errors and missing operations and also a complete verification to determine whether the objectives are met and the user requirements are satisfied. The ultimate aim is quality assurance. Tests are carried out and the results are compared with the expected document. In the case of erroneous results, debugging is done. Using detailed testing strategies a test plan is carried out on each module. The tests occurred in this projects are unit testing, integration testing, validation testing and output testing. 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 raspectively. 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

Dept of CSE

46

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

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.

Dept of CSE

47

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

7. SCOPE OF THE FUTURE ENHANCEMENT


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.

Dept of CSE

48

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

8. 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 codewords 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.

Dept of CSE

49

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

9. APPENDICES
9.1: FORM DESCRIPTION The user can login using one username and password.Main form contains many menustrip 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 currresponding .edf file.User can brose more than one file and also having an option for giving the deatails 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 treee 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 huffmen 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 submenustrip controlls under the data analysis main menustrip 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 dycrypts the encryptd 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.

Dept of CSE

50

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

9.2: SCREEN SHOTS: DATA ENCRYPTION MAIN PAGE:

In this main page we includes 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 analyzer, login like controls. Data analysis menu strip controls makes path to encryption , decryption processes. It

Dept of CSE

51

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

represents a control that allows the user to select a single item from a list of controls. The registered user can only makes the process after login to the application. Here we uses 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 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.

Dept of CSE

52

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

REGISTRATION FORM FOR NEW USERS: New users have to register before login. This form has name, username, password, confirm password, address, email, phone no fields. The username and password are used for logging in.

Dept of CSE

53

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

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 submenustrip item EEG sample contains two items,ie,manage samples and analyze 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. SELECTING SAMPLE Selecting sample by browsing inside the files.

Dept of CSE

54

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

ADDING SAMPLE: Giving name and other descriptions to the selected sample.

Dept of CSE

55

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

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 user have an option for creating the shuffled tree value by using another windows form workings inside that Huffman tree submenu strip item

Dept of CSE

56

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

ENCRYPTION AND KEY CREATION: The Data analysis menustrip 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. createkey button control opens the path for creating Huffman tree and shuffled tree values.Then here displays one message box to show the key added.

Dept of CSE

57

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

DECRYPTION: This is the process of decrypting the encrypted file. Decrypting also need sample selection.

Dept of CSE

58

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

10. BIBLIOGRAPHY
REFERRED BOOKS: 1.Applied cryptography.

Dept of CSE

59

Veda Vyasa Institute of Technology

Data Encryption Using Brain Signals

Project Report 2007 Admission

Bruce schneier.
2.Cryptography engineering.

Niels ferguson. Websites:


1. www.computer.org 2. mitpress.mit.edu

Dept of CSE

60

Veda Vyasa Institute of Technology