implementation of some selected soft computing

0 downloads 0 Views 9MB Size Report
Storing Mix Color Activity data on machine MCA30 and requesting data across port 7000. Expected Output-. MixColor Activity form should be displayed.
Harshwardhan Publication Pvt. Ltd.

18

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

A DISSERATATION OF RESERCH WORK SUBMITTED TO CHHATRAPATI SHAHU INSTITUTE OF BUSINESS EDUCATION AND RESEARCH, KOLHAPUR. IN PARTIAL FULFILLMENT OF REQUIREMENT FOR THE AWARD OF THE DEGREE OF

MASTER OF PHILOSOPHY IN COMMERCE AND MANAGEMENT SUBMITTED BY Mr. MORE PANDURANG MOHAN (M.C.A.) UNDER THE GUIDANCE OF Dr. Mrs. P. G. NAIK (M.Sc (Phy), M.Sc (Math), MCA, P.G.D.C.A., Ph.D, NET)

THROUGH THE DIRECTOR, CHHATRAPATI SHAHU INSTITUTE OF BUSINESS EDUCATION AND RESEARCH, KOLHAPUR. (AN AUTONOMOUS INSTITUTE) ACADEMIC YEAR: 2015-2016

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT © Mr. MORE PANDURANG MOHAN (M.C.A.)

 Publisher : Harshwardhan Publication Pvt.Ltd. Limbaganesh, Dist. Beed (Maharashtra) Pin-431126, [email protected]  Printed by : Harshwardhan Publication Pvt.Ltd. Limbaganesh, Dist. Beed, Pin-431126

Page design & Cover : Shaikh Jahurodden Edition: June 2018

ISBN 978-93-87990-01-2

 Price : 399/ -

CERTIFICATE

This is to certify that dissertation entitled ―Implementation of Some Selected Soft Computing Techniques for an Activity Based Authentication in a Distributed

om

Environment‖, being submitted herewith for the award of degree of Master of Philosophy in Commerce and Management of Chhatrapati Shahu Institute of Business Education and

ar ta .c

Research, Kolhapur is the result of original research work completed by Mr.Pandurang Mohan More under my supervision and guidance.

To the best of my knowledge and belief, this work has not been submitted for the

w

Pu bl ic

.v id y

at io n

aw

award of any Degree or Diploma of this university or any other University or Institute.

w

PLACE: -

lin e on

w

DATE: -

ii

Prof. Dr. P. G. Naik (Research Guide)

om

DECLARATION

I, undersigned hereby declare that the dissertation titled ―Implementation of Some

ar ta .c

Selected Soft Computing Techniques for an Activity Based Authentication in a Distributed Environment‖, being submitted for the award of degree of Master of Philosophy in Commerce and Management by me to Chhatrapati Shahu Institute of Business Education and Research, Kolhapur is the result of independent research work carried out by me under the guidance of

at io n

data collected by me.

aw

Dr. Mrs. P. G. NAIK, reveals my original work and conclusions drawn therein are based on the

.v id y

Further I declare that, this dissertation has not been submitted to this or any other

DATE: -

lin e

PLACE: -

(Mr. Pandurang Mohan More)

on

w

w

w

Pu bl ic

University or Institution for the award of any degree.

(Research Student)

iii

ACKNOWLEDGEMENT

I take this opportunity to express my sincere thanks and gratitude to all, who have been

om

instrumental in assisting me, in one or other way, in completing the task of M.Phil. research. My novice knowledge of practical world would have not got me for finalizing my

ar ta .c

report, had it not been under the direction of nonetheless than Dr. P. G. Naik who really consented to be my research guide. I also thank the faculty members and staff of CSIBER, Kolhapur for their encouragement support as well as affection.

at io n

aw

I have been uniquely fortunate in receiving encouragement from various honorable, but I must mention our Secretary and Management Trustee, Dr. R. A. Shinde as well as our Director,

.v id y

Dr. M. M. Ali and M.Phil. Programme Chairman Dr. U. M. Deshmukh.

Pu bl ic

I would also like to thank the all staff members of Chhatrapati Shahu Institute of Business Education and Research, Kolhapur. Lastly, I convey my reverential salutation to

PLACE:

lin e on

w

w

w

almighty for enabling me to take up and complete this task.

DATE: -

(Mr.Pandurang Mohan More)

iv

ABSTRACT

In the current information age, security has achieved a tremendous importance in ecommerce applications involving financial transactions. Non-repudiation, data integrity, data confidentiality and authenticity, have become an integral part of information security. There is a

om

tremendous risk involved in the communication of a plain text over Internet. The Internet is invaluable resource provider which at the same time increases the

ar ta .c

vulnerability of information systems and networks so that they can be used to facilitate attacks by criminals, unauthorized users and hackers. So, in order to overcome that problem the current research focuses on providing a solution in the form of some activity based authentication in distributed environment of an organization by suggesting and implementing few soft computing

at io n

aw

techniques.

The activity based authentication in distributed environment of any organization

.v id y

definitely provides advanced solution by using few soft computing techniques. The author

Pu bl ic

hypothesizes that frequently-changing secret questions will be hard for attackers to guess. Activity based authentication can be achieved by genetic algorithm, neural networks, fuzzy logic

w

etc. This security tool authenticates users at the operating system level in multi-user operating

w

systems. It supports system administrators in limiting the ability of unauthorized users to disrupt

w

system operations using a Genetic Algorithm and set of rules to track usage patterns, color code

lin e

change, time based activity and object transition activity on the system.

In the current research, the author has generated an activity based distributed 3D

on

password incorporating various activities where the authentication information is distributed over geographically separated multiple authentication servers. The key pair is generated using RSA algorithm which is encrypted using single-point cross over and mutation of bits at the extreme position. This further adds another level of security and renders the key unbreakable by an unintended user. In order to render the solution generic, the configuration information pertaining to the distributed environment can be stored in XML file which can be parsed using Microsoft's XML Parser and the activity related information can be stored in different servers which can be v

encrypted using RSA algorithm. The technique employed combines RSA algorithm with Genetic Algorithm to offer a robust hybrid security framework in a distributed environment which is

lin e on

w

w

w

Pu bl ic

.v id y

at io n

aw

ar ta .c

om

difficult to guess for an unintended user.

vi

LIST OF TABLES

Table Title

om

Table No.

Page No.

Contents of Activities table.

4.2

Contents of TimeActivity table.

4.3

Contents of ImageActivity table.

104

4.4

Contents of PatternActivity table.

108

4.5

Contents of MixColorActivity table.

113

lin e on

w

w

w

Pu bl ic

.v id y

at io n

aw

ar ta .c

4.1

vii

96 96

LIST OF FIGURES

Page No.

Figure Title

om

Figure No.

Approximate Reasoning Model.

1.2

Working of Neural Network.

9

1.3

Supervised Learning Mechanism.

10

1.4

Block Diagram of Symmetric Key Encryption.

11

1.5

Asymmetric Key Encryption.

12

1.6

Block Diagram of Asymmetric Key Encryption.

13

3.1

Application Architecture without Cryptography.

51

at io n

aw

Pu bl ic

Application Architecture with Cryptography.

52

Activity Based Authentication Levels.

w

3.3

.v id y

3.2

4

ar ta .c

1.1

52 52

Consolidated Application Architecture for Activity Based Authentication.

65

3.5

Framework for storing the activity-based information in a MSAccess database.

66

3.6

Type-I Authentication Process Model

67

3.7

Type-II Authentication Process Model.

67

lin e

on

w

w

3.4

Sequence of Steps during Application‘s Execution.

68

Key Generation and Encryption using Genetic Algorithm.

68

3.10

Parsing XML File containing Distributed Server Configuration Information.

69

3.11

Storing Activity based information in a Distributed Authentication Serve.

69

3.8 3.9

viii

Activity-Based Authentication Process.

70

3.13

Transformation Process for Mapping Grid Address for Single Digit Number.

74

3.14

Module Dependency Graph in Presentation Tier.

76

3.15

Module Dependency Graph in Business Logic Tier.

77

3.16

Computation of Complexity of Image Activity.

79

3.17

Computation of Complexity of Mix Color Activity.

80

4.1

84

4.2

Structure of Database for Storing Activity-based Authentication Information. Encrypted Key Pair Stored in Key Store Database.

4.3

Sample Encrypted Activity Based Information Stored in MS-Access Database.

85

4.4

Adding Reference to Microsoft Winsock Control 6.0

86

4.5

GUI for Startup Application Screen.

4.6

GUI for Connecting to Remote Server using Winsock Control.

90

GUI for Activity-Based Authentication Process.

92

Pu bl ic

at io n

ar ta .c

aw

.v id y

lin e on

w

w

w

4.7

om

3.12

ix

84

89

om

TABLE OF CONTENTS

Name of Topic

Declaration

Abstract

aw

Acknowledgements

List of Tables

.v id y

List of Figures

I

2

1.2

Statement of the Problem

14

1.3

Significance of the Study

15

1.4

Purpose of the Study

15

1.5

Objectives of the Study

16

1.6

Scope of Study

17

1.7

Research Methodology

17

on

lin e

w

Introduction

w w

1

1.1

1.8 II

Pu bl ic

Introduction and Research Design

at io n

Certificate

Page No.

ar ta .c

Chapter No.

Tools and Techniques Employed for Implementation of Model

18 19

Literature Review 2.1 Research Review Findings 2.2 Research Gaps

III

Theoretical Framework

48

IV

Results and Discussions

82 x

Conclusions, Scope for future work and Suggestions

150

References

156

Appendix

161

lin e on

w

w

w

Pu bl ic

.v id y

at io n

aw

ar ta .c

om

V

xi

om

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

ar ta .c

CHAPTER-I

AND

at io n

.v id y

aw

INTRODUCTION

lin e on

w

w

w

Pu bl ic

RESEARCH DESIGN

1

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

CHAPTER-I INTRODUCTION AND RESEARCH DESIGN

om

Abstract:-

This chapter gives introduction of tools and techniques that are employed and the

ar ta .c

methodology adopted in the implementation of some selected Soft Computing Techniques for

.v id y

1/ INTRODUCTION AND RESEARCH DESIGN:-

at io n

aw

an Activity Based Authentication in a Distributed Environment for conducting this research.

In the current information age, security has achieved a tremendous importance in e-

Pu bl ic

commerce applications involving financial transactions. Non-repudiation, data integrity, data

w

confidentiality and authenticity, have become an integral part of information security. There is a tremendous risk involved in the communication of a plain text over Internet. Cryptography offers

w

a solution for this type of risk which is referred to as a technique of encrypting and decrypting

w

messages in such a way that they cannot be interpreted by anybody with the exception of a

lin e

sender and an intended recipient. In majority of the e-commerce based applications where security is considered to be of prime importance, a single encryption algorithm is adopted for

on

encrypting a password and the authentication information is stored on a single database server which becomes open to risks against different computer hacks. A novel solution for this problem is to generate an individual‘s personal and dynamic activities which will be hard for the attackers to guess. Further, this can be combined with distributed technology where the authentication information is distributed over geographically separated multiple servers. In the current research, the researcher has generated an activity based distributed 3D password incorporating various activities where the authentication information is distributed over geographically separated 2

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

multiple authentication servers. The key pair is generated using RSA algorithm which is encrypted using single-point cross over and mutation of bits at the extreme position. This further adds another level of security and renders the key unbreakable by an unintended user. In order to

om

render the solution generic, the configuration information pertaining to the distributed environment can be stored in XML file which can be parsed using Microsoft's XML Parser and

ar ta .c

the activity related information is stored in different servers which can be encrypted using RSA algorithm. The technique employed combines RSA algorithm with Genetic Algorithm to offer a robust hybrid security framework in a distributed environment which is difficult to guess for an

aw

unintended user.

at io n

In any organization it is an essential task to protect the data from unauthorized users. Information Systems hardware, software, networks, and data resources need to be protected and

.v id y

secured to ensure quality, performance, and integrity. Security management deals with the

Pu bl ic

accuracy, integrity, and safety of information resources. When effective security measures are in place, they can reduce errors, fraud, and losses. The Internet is invaluable resource provider

w

which at the same time increases the vulnerability of information systems and networks so that

w

they can be used to facilitate attacks by criminals, unauthorized users and hackers. So, in order to

w

overcome that problem the current research focuses on providing a solution in the form of some

lin e

activity based authentication in distributed environments organization by suggesting and implementing few soft computing techniques.

on

In traditional organizations the manual systems enable access to the organizations private data by unauthorized users, hackers and crackers. The traditional system has many disadvantages since it is associated with high administrative responsibilities that has high possibilities of misuse of organizations important data with very low data security.

The activity based authentication in distributed environment of any organization definitely provides advanced solution by using few soft computing techniques. The approach is 3

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

authentication through the use of an individual's personal and dynamic Internet activities. The researcher hypothesizes that frequently-changing secret questions will be hard for attackers to guess. Activity based authentication can be achieved by genetic algorithm, neural networks,

om

fuzzy logic etc. This security tool authenticates users at the operating system level in multi-user operating systems. It supports system administrators in limiting the ability of unauthorized users

ar ta .c

to disrupt system operations using Genetic Algorithm and set of rules to track usage patterns, color code change, time based activity and object transition activity on the system.

aw

INTRODUCTION TO SOFT COMPUTING-

at io n

Soft computing deals with approximate models and gives solution to complex problems. It is based around human behavior model. It is aimed at exploiting the tolerance for imprecision,

.v id y

uncertainty and partial truth to achieve tractability and robustness, low solution cost and better

Pu bl ic

report with reality. Ultimate goal is to incorporate the human reasoning abilities. Soft computing uses a combination of genetic algorithms, neural networks and fuzzy logic.

A typical

lin e on

w

w

w

generalized approximation model is depicted in Figure 1.1.

Figure 1.1. Approximate Reasoning Model

In effect, the role of soft computing is the human mind. Hard computing methods are predominantly based on mathematical approaches, therefore demand a high degree of precision and accuracy in their requirements. But in most engineering problems, the input parameters cannot be determined with high degree of precision. Therefore the best estimates of the parameters are used for obtaining solution to problems. This has restricted the use of 4

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

mathematical approaches for the solution of inverse problems when compared to forward problems.

om

Fuzzy logic offers an organized method for dealing with imprecise data. It deals with processing data by allowing partial set membership and overlapped membership rather than crisp

ar ta .c

set membership or non-membership. It is highly applicable in situations where it is not possible to get the accurate data and involves processing imprecise inputs. The outcome of fuzzy logic is the ability to handle natural language queries and is more like human thinking and is based on degrees of truth.

at io n

aw

NEED FOR SOFT COMPUTING-

To the uncertainties and increasingly competitive and volatile nature of Business environment.

Pu bl ic



.v id y

The Mathematical Model fails to conform –

To rapid changes in the organizational objectives and functional requirements.



To repetitive task demanded by supervised training model.



To address computationally complex tasks and explore entire search space in case of

w

w



w

optimization problems.

In such cases crisp model becomes obsolete, inefficient.

lin e



on

Soft Computing exactly addresses this issue.

5

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

HARD COMPUTING V/S SOFT COMPUTINGHard Computing

Soft Computing

Hard computing is a conventional computing

Soft computing is tolerant to imprecision,

om

uncertainty, partial truth, and approximation. In effect, the role model for soft computing is

ar ta .c

the human mind.

Hard computing is based on binary logic, Soft computing is based on fuzzy logic, crisp systems, numerical analysis and crisp neural nets, genetic algorithm and probabilistic reasoning. Soft

computing

the

tolerance

for

imprecision and uncertainty is exploited to achieve tractability, lower cost, high Machine

.v id y

precision and categoricity.

aw

Hard computing has the characteristics of In

at io n

software.

Pu bl ic

Intelligence Quotient (MIQ) and economy of communication

w

written

w

Hard computing requires programs to be Soft computing can evolve its own programs

Soft computing can use multi-valued or fuzzy logic

lin e

w

Hard computing uses two-valued logic

Soft computing incorporates stochasticity

on

Hard computing is deterministic

Hard computing requires exact input data

Soft computing can deal with ambiguous and noisy data

Hard computing is strictly sequential

Soft computing allows parallel computations

Hard computing produces precise answers

Soft

computing

answers

6

can

yield

approximate

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

Some of the soft computing techniques employed in the implementation of security tools are as follows-

GENETIC ALGORITHMS (GA)-

om

1)

Genetic algorithms are adaptive heuristic search algorithms based on the evolutionary ideas

ar ta .c

of natural selection and genetics. They are based on the principle of natural genetics and Darwinian idea of survival of the fittest. The primary steps involved in the implementation of GA are:  Selection

at io n

 Mutation

aw

 Crossover

.v id y

The first step consists of searching individuals for reproduction. In the current work the author has generated a genetic pool consisting of 50 twelve digit numbers representing the

Pu bl ic

chromosomes which are randomly generated and from which a single random number with the

w

highest fitness value as dictated by the fitness function is selected.

w

Cross-over is the process of taking two parents and producing from them a child. In an

w

optimization problem, crossover operator is applied to the mating pool with the hope that it

lin e

creates a better offspring. For the problem under consideration, crossover is taken as one of the steps in producing a decrypted vector. The author has employed single-point and two-point

on

crossover methods. In the case of optimization problem, selecting more than four crossover points will result in the disruption of building blocks whereas in the case of encryption larger the disruption better is the algorithm which makes it robust and difficult to break.

After crossover, the vectors are subject to mutation. In optimization problem, mutation prevents the algorithm from being trapped in a local minimum. Mutation plays an important role in the recovery of the lost genetic matter as well for randomly distributing the genetic information. In encryption problem, mutation is employed for inducing disorder into the vector. 7

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

It introduces a new genetic structure in the population by randomly modifying some of the building blocks and maintains diversity into the population. Flipping method is employed, in which for a character 1 in mutation chromosome, the corresponding character b in the parent

om

chromosome is flipped from b to (9-b) and corresponding child chromosome is produced. In the following example 1 occurs at two random places of mutation chromosome, the corresponding

Mutation Chromosome

b1

b2

b3

b4

b5

b6

b7

1

0

0

0

0

0

0

1

9-b0

b1

b2

b3

b4

b5

b6

9-b7

ARTIFICIAL NEURAL NETWORK (ANN)-

Pu bl ic

2)

.v id y

aw

Child Chromosome

b0

at io n

Parent Chromosome

ar ta .c

characters in parent chromosomes are flipped and the child chromosomes are generated.

Artificial neural network (ANN) is an efficient processing system which resembles in

w

characteristics to a biological neural network. ANNs possess large number of highly

w

interconnected processing elements called nodes or neurons operating in parallel and are

w

configured in regular architectures. Each neuron is connected by other neurons by a connection

lin e

link associated with weights containing information about the input signal. This information is used by a neural network to solve a particular problem. ANN's collective behavior is

on

characterized by their ability to learn, recall and generalize training patterns or data similar to that of human brain. Neurons are thus the ANN processing elements. ANNs perform various tasks such as pattern matching and classification, optimization functions, vector quantizations and data clustering. Each neuron has its own internal state which is called the activation or activity level of neuron, which is the function of input the neuron receives. This activation signal is transmitted to other neurons. A neuron can send only one signal at a time which can be transmitted to several other neurons. To understand basic operation of a neural network consider 8

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

a set of neurons X1, X2,. . . . . ,Xn, transmitting signals to another neuron. Let Y be the output neuron which receives signals. Input neurons Xi( 1


om



ar ta .c



In the above XML file the machine name for storing authenticity data pertaining to all the four

at io n

aw

activities is same (localhost) and requests are sent across the ports 5000, 6000, 7000 and 8000. However in a more secure environment the data can be distributed over two or more servers for

.v id y

achieving higher level of security by changing localhost with either machine name or IP address of the machine connected to the network.

and without Cryptography.

Pu bl ic

Phase 2: Designing Application Architecture for Authentication in 2-tier and 3-tier model with

w

The layered application architecture employed in the implementation of the security

w

model with and without encryption and decryption techniques is depicted in Figure 3.1 and

3.3.

lin e

w

Figure 3.2, respectively with the corresponding activity authentication levels shown in Figure

on

Without Cryptography - 2-Tier Architecture-

Figure 3.1. Application Architecture without Cryptography. With Cryptography – 3- Tier Architecture51

ar ta .c

om

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

Figure 3.2. Application Architecture with Cryptography.

Pu bl ic

w

.v id y

at io n

aw

Activity Authentication Levels-

Figure 3.3. Activity Based Authentication Levels.

w

Phase 3: Designing Encryption/Decryption Algorithms Employing Genetic Algorithm

lin e

w

Proposed Cryptographic Algorithm Employing Genetic AlgorithmEncryption of a Text Phrase-

Step 1: Extract two 8-byte blocks from the text phrase to be encrypted.

b0

b1

on

Let the two blocks be represented by b2

b3

b4

b5

b6

b7

c0

c1

c2

c3

c4

c5

c6

c7

where each bi and ci is a character in a textual phrase. Step 2: Perform crossover operation. 52

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

Generate two random numbers in the range [ 0-7]. Let the two random numbers generated be 1 and 6. Hence, Crossover Point1 = 1

om

Crossover Point2 = 6

b2

b3

c0

c1

c2

c3

b4

b5

b6

b7

c4

c5

c6

c7

c0

c1

c2

c3

b2

b3

w

Step 3: Perform mutation operation.

c4

c5

c6

Pu bl ic

b1

w

b0

.v id y

The blocks after performing crossover operation are

at io n

b1

aw

b0

ar ta .c

Perform the crossover between two crossover points generated above.

b4

b5

b6

b7

c7

generated be 3 and 4.

lin e

w

Generate two random numbers in the range 0 to 7. Let the two random numbers

Hence, Mutation Point1 = 3

on

Mutation Point2 = 4

Perform mutation operation on two blocks obtained in Step 2.

b0

b1

c2

128-c3

128-c4

c5

c6

b7

c0

c1

b2

128-b3

128-b4

b5

b6

c7

53

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

Step 4: Generate a random key based on crossover points, mutation points and crossover factor generated above.

6

3

4

ar ta .c

1

om

Hence the symmetric key in an octal form is

Each octal digit in a symmetric key can be represented using 3 bits. Hence a symmetric key in a binary format is given by 3 * (c + m) In the above example, c = m = 2.

aw

Hence Key Length = 12.

at io n

In the case of 2 cross over points and 3 mutation points the length of the key is 15 bits which depends on the number of crossover points and mutation points. The length of the symmetric key

.v id y

can be computed using a general formula

Pu bl ic

3 * (c + m)

w

w

Encryption of Graphical Password-

w

Step 1:

lin e

Let (xi, yi) denote the x and y coordinates of the end points of a pattern generated by the user. Generate two vectors consisting of x-coordinates and y-coordinates of all the points on the

on

pattern as shown below:

These vectors become the parent chromosomes.

x1

x2

x3

x4

x5

.............

xi

y1

y2

y3

y4

y5

.............

yi

54

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

Step 2: Select midpoint as a single cross over point.

x2

x3

x4

....

xi/2

y1

y2

y3

y4

....

yi/2

....

om

x1

yi

ar ta .c

....

Xi

Step 3:

y2

x4

y3

y4

....

xi/2

....

yi/2

at io n

10-y1

x3

....

10-xi

....

10-yi

Pu bl ic

x2

.v id y

10-x1

aw

Perform mutation operation at the two extreme points.

The entire procedure is illustrated in the following example. Let the pattern generated be

w

as follows.

12

13

14

lin e

w

w

11

on

23

32

41

42

43

44

55

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

Step 1: Generate two parent chromosomes from the given pattern comprising of x and y coordinates of connected points as shown below.

1

1

1

1

2

3

4

2

3

4

4

4

4

2

3

4

ar ta .c

om

1

3

2

1

3

4

3

1

1

w

3

4

4

Pu bl ic

1

w

1

at io n

2

.v id y

1

aw

Step 2: Perform cross over operation at the midpoint to obtain new chromosomes.

2

2

1

4

2

4

3

4

lin e

9

1

1

9

2

on

w

Step 3: Perform mutation operation at the two extreme points to yield the final chromosomes.

3

1

4

2

3

4

4

4

6

3

2

1

2

3

6

These two transformed chromosomes are stored in a database on a remote server. The decoding procedure to generate the above pattern is depicted below: 56

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

Step 1: Perform reverse mutation operation at the extreme points to yield the following chromosomes.

2

3

4

1

1

1

1

3

3

4

4

4

4

2

3

4

ar ta .c

om

1

2

2

1

1

2

1

1

3

3

2

4

4

4

4

1

2

3

4

Pu bl ic

4

w

3

2

at io n

1

.v id y

1

aw

Step 2: Perform crossover at a single crossover point to yield the original chromosomes.

w

The x and y coordinates of the points on the pattern are given by(1, 1), (1, 2), (1, 3), (1,4), (2,3),

lin e

w

(3,2), (4,1), (4,2), (4,3), (4,4), which restores the original pattern.

on

Pseudo Code for Encryption of Graphical Data.

C-style pseudo code for encryption of graphical data is depicted below: function encryptGraphicalData() { /* Read x and y coordinates of points on the patter */ for (int i=0;iDecrypt option from the main menu.

Expected output-

The form displaying options for decrypting to data along with a link for viewing decrypted data should be displayed.

144

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

Pu bl ic

.v id y

at io n

aw

ar ta .c

om

Actual Output-

Test Case 31.a-

w

Select ―Time Activity‖ checkbox, enter username and click on ―Decrypt‖ button

w

Expected output-

The executable batch file storing the commands for encrypting selected activities should be

on

Actual Output-

lin e

w

created and the message ―Batch File Created..‖ should be displayed.

145

.v id y

at io n

aw

ar ta .c

om

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

Pu bl ic

Test Case 31.b-

Click on ―View Decrypted Data‖ link.

w

Expected output-

w

Decrypted data should be displayed in a FlexGrid control.

lin e on

w

Actual Output-

146

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

Test Case 32Place a check mark next to all activities and click on ―Decrypt‖ button. Expected output-

om

Batch file ―run.bat‖ should be dynamically generated containing the commands for retrieving data from enactivity.accdb access database and decrypting the data using RSA/GA decryption

ar ta .c

algorithm and batch file should be executed on clicking ―OK‖ button.

on

Test Case 33-

lin e

w

w

w

Pu bl ic

.v id y

at io n

aw

Actual Output-

Place a check mark next to all activities and click on ―View Decrypted Data‖ link. Expected output Different forms with MS-Flexgrid control containing decrypted data should be displayed.

147

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

lin e on

w

w

w

Pu bl ic

.v id y

at io n

aw

ar ta .c

om

Actual Output-

148

lin e on

w

w

w

Pu bl ic

.v id y

at io n

aw

ar ta .c

om

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

149

om

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

ar ta .c

CHAPTER-V

lin e on

w

w

w

Pu bl ic

.v id y

at io n

aw

CONCLUSIONS, SCOPE FOR FUTURE WORK AND SUGGESTIONS

150

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

CHAPTER-V

om

CONCLUSIONS, SCOPE FOR FUTURE WORK AND SUGGESTIONS Abstract: -

ar ta .c

This chapter presents conclusions drawn from the research work and further extension of the work to meet the new demands constantly generating in the organization. The chapter concludes with the suggestions.

at io n

aw

This chapter summarizes phase-wise conclusions drawn from research work carried out pertaining to activity based authentication, design and implementation phases. Research

.v id y

objectives of each phase are mapped to corresponding research outcome. Chapter concludes with

Pu bl ic

scope of future work and suggestions.

w

In the current work, the author has made an attempt to generate an activity based

w

distributed 3D password incorporating various activities where the authentication data is stored

w

over multiple distributed authentication servers. The public key/ private key is generated and

lin e

encrypted using single-point cross-over and mutation operations of Genetic Algorithm and stored in a key store database. The client uses winsock control for communication with the server.

on

The model is designed and implemented in two different application architectures. The first model is based on plain textual authentication model which employs two-tier architecture where the end user interacts with the presentation tier which employs data tier for data persistence. The second model employs cryptography for data protection and employs three-tier architecture by separating out the application‘s business logic in a middle tier. The logical tiers are mapped to the corresponding physical tiers on one-to-one basis. Both the models are implemented employing Visual Basic in presentation tier, Java in middle tier and MS-Access in 151

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

data tier. The algorithm is implemented in Java and applied for the encryption and decryption of an activity-based password of employees in a hypothetical organization. Based on security needs

om

of the organization the user can select between 1 to 4 different levels of authentication.

Research Objective

Research Outcome

To manage dynamic security

organization

w

To maintain security of

organizations distributed database

4

machine

information

pertaining to IP Address/Domain Name and port number.

ii. Time and action dependent activities for authentication

The model for storing a data in an encrypted form where the encrypted are

stored

on

different

geographically distributed authentication

lin e

w

servers

To give access to only

Design and implementation of two-tier

authorized persons and

application architecture for storing the

prohibited from unauthorized

authentication information persistently in

persons.

back end database management system.

To give high level of security

Design and implementation of three-tier

by using few soft computing

application architecture for implementing

techniques

cryptography in a middle tier and storing

on

3

with

activities

w

2

along

Pu bl ic

.v id y

1

(DTD) for storing activity information

aw

environment in an

i. XML file with Document Type Definition

at io n

Phase

ar ta .c

Table 5.1 summarizes research objective of each phase and associated research outcome.

152

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

the authentication information persistently in back end database management system. To implement a tool which

Tools Developed: a. Key Generation tool in Java for

om

can be employed by any

generating public key/private

security level desirable by the

pair.

key

ar ta .c

organization based on the

organization

b. Encryption/Decryption tool in Java

5

based on RSA algorithm and GA.

c. Hybrid Activity based Authentication

aw

Tool is developed which operates in

i.

Without cryptography With cryptographic Solution

Pu bl ic

.v id y

ii.

at io n

two scenarios:

w

Table 5.1 Mapping of Research Objective to Research Outcome.

w

Scope for Future Work and Suggestions-

w

Scope for Future Work-

lin e

Currently, four different activities are considered, however the activity set can be

extended further as new activities are coined and added to the set constantly. In future plans to adopt two different architectures using Remote Method Invocation (RMI) and encryption using

on

Neural Network employing two-tier architecture and a three-tier architecture. In a two-tier architecture, RMI server and RMI client reside on two different physical as well as logical tiers. RMI server is tightly integrated with the data tier. The application can be designed to be more manageable by switching to 3-tier application architecture by separating out database server from the RMI server and further using RMI security manager for enabling remote connection. Based on the level of security required and infrastructure availability in the organization, the end user can make a selection between 1 to 4 different levels of security and authentication methods to be 153

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

employed. What will be common to all these methods is that all of them will adopt Genetic Algorithm as a common technique for encryption and decryption of the key pair employed for encryption of password components wherein the pseudo randomness involved in crossover and

om

mutation operations can be exploited for generating an asymmetric key pair for the encryption and the decryption of a password. The number of mutation points and number of crossover

ar ta .c

points together state the length of the secret key and hence measure the strength of the algorithm employed the authentication data can be encrypted on the client side and such encrypted data can be transmitted over the network which can then be compared with the encrypted information stored on respective authentication servers. Both during transmission of data and its storage, data

aw

can be encrypted in order to incorporate the data confidentiality tightly in to the application. The

at io n

randomness along with the permutation process makes the algorithm robust and also hard to

.v id y

break. Further, the fitness function of GA can be designed to measure the strength of security.

Pu bl ic

In the current work the design configuration information is stored in XML format which was also employed for data exchange. However, recently Java Script Object Notation (JSON) is

w

emerging as the most promising technology for storing and exchanging data in the form of

w

name/value pair in a platform independent and file system neutral manner which is slowly

w

replacing XML and is an output for choice for most of the web services and RESTful services.

lin e

The tool implemented in current research can be rendered widely accessible by converting them into web services which can be deployed on organization‘s private cloud interfacing with each

Suggestions -

on

other employing JSON as a mechanism for data interchange.

1) The model can be further improved by dividing authentication keys into different subkeys and storing each sub key on a different server in a distributed environment. 2) The scope of the tool can be increased further by providing browser based solution and making application responsive by targeting devices of varying display size. 154

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

3) Other soft computing techniques such as fuzzy logic, artificial neural network can be explored incorporating fuzziness in the model and neural network can be trained for RSA authentication.

om

4) The discrete time activity model can be change into continuous time activity model using gradient descent algorithm where color is dictated by the time offset in which case two

lin e on

w

w

w

Pu bl ic

.v id y

at io n

aw

as in the current model.

ar ta .c

different colors will be needed for authentication of an end user instead of a single color

155

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

REFERENCES

om

[1] Rudolf Maarten Bolle, Sharon Louise Nunes, Sharathchandra Pankanti, Nalini Kanta Ratha, Barton Allen Smith, Thomas Guthrie Zimmerman, Weniger, " Method for biometricbased authentication in wireless communication for access control , US6819219 B1,

ar ta .c

International Business Machines Corporation, BiBTeX, EndNote, RefMan, 16 Nov 2004. [2] Sandeep Kumar, Eugene H. Spafford, " A Pattern Matching Model for Misuse Intrusion Detection‖,The COAST Project,Department of computer Sciences,Purdue University,West Lafayette-47907-1398, CSD·TR-94-071, October 1994

at io n

aw

[3] Asaf Shabtai,Uri Kanonov,Yuval Elovici,‖Intrusion detection for mobile devices using the knowledge-based, temporal abstraction method.‖ Journal of Systems and Software, Volume 83

.v id y

Issue 8, August, 2010, Pages 1524-1537

Pu bl ic

[4] F.Rojas, H.Pomares,‖ Soft-computing techniques for time series forecasting‖, ESANN'2004 proceedings - European Symposium on Artificial Neural Networks, Bruges (Belgium), 28-30

w

April 2004, d-side publi., ISBN 2-930307-04-8, pp. 93-102

w

[5] Chirag Modi , Dhiren Patel , Bhavesh Borisaniya , Hiren Patel , Avi Patel , Muttukrishnan Rajarajan,‖ A survey of intrusion detection techniques in Cloud‖, Journal of Network and

lin e

w

Computer Applications 36 (2013) 42–57

[6] Gerado W. Flintsch,Chen Chen,‖ Soft Computing Applications in Infrastructure Management‖, June 7th 2007,Blacksburg-Virginia

on

[7] Pei-Chann Chang *, Chen-Hao Liu,‖ A TSK type fuzzy rule based system for stock price prediction‖, Expert Systems with Applications 34 (2008) 135–144 [8] Adel Nadjaran,Mohsen Kahani,‖A new approach to intrusion detection based on an evolutionary soft computing model neuro-fuzzy using classifiers‖,Computer Communications, Volume 30 Issue 10, July, 2007,Pages 2201-2212

156

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

[9] E. Frias-Martineza , G. Magoulasb , S. Chena,*, R. Macrediea,‖ Modeling human behavior in user-adaptive systems: Recent advances using soft computing techniques‖, Expert Systems with Applications 29 (2005) 320–329

om

[10] Amit Choudhary,‖A Review of Various Soft Computing Techniques in the Domain of Handwriting Recognition‖, International Journal of Information & Computation Technology,

ar ta .c

ISSN 0974-2239 Volume 4, Number 6 (2014), pp. 601-606

[11] Odetunji A. Odejobi,Lasisi E. Umoru,‖Applications of soft computing techniques in materials engineering: A review‖, African Journal of Mathematics and Computer Science Research Vol. 2(7), pp. 104-131, August, 2009

aw

[12] Hung T Nguyen,Nadipuram R Prasad ,Vladik Kreinovich ,Habib Gassoumi Depar,‖ Some

Intelligence pp 273-307

at io n

Practical Applications of Soft Computing and Data Mining‖,Data Mining and Computational

.v id y

[13] Witaya Siripanwattana,Surat Srinoy,‖ Information Security based on Soft Computing

Pu bl ic

Techniques‖, Proceedings of the International MultiConference of Engineers and Computer Scientists 2008 Vol I IMECS 2008, 19-21 March, 2008, Hong Kong

w

[14] Dr.R.S.Wahidbano,‖ Introduction Soft Computing Systems for Software Security

w

Management‖,ISSN: 1512-1232

w

1 5 ] Dinesh Kumar Saini ,Vikas Singh,‖ Soft Computing Techniques in Cyber Defense,International

lin e

Journal of Computer Applications,© 2012 by IJCA Journal,Volume 50 - Number 20 [16] Yuriy P. Kondratenko, V. Kozlov,Leonid P. Klymenko,Galyna V. Kondratenko,‖ Synthesis and Research of Neuro-Fuzzy Model of Ecopyrogenesis Multi-circuit Circulatory

on

System‖,Studies in Fuzziness and Soft Computing book series (STUDFUZZ, volume 312) [17] Abdul Rahman,M. M. Sufyan Beg,‖ Investigation of OWA Operator Weights for Estimating Fuzzy Validity of Geometric Shapes‖,Studies in Fuzziness and Soft Computing book series (STUDFUZZ, volume 312) [18] Daniel G. Schwartz,‖ A Logic for Qualified Syllogisms‖,Studies in Fuzziness and Soft Computing book series (STUDFUZZ, volume 312) 157

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

[19] Jianhai Su,Timothy C. Havens,‖ A Generalized Fuzzy T-norm Formulation of Fuzzy Modularity for Community Detection in Social Networks‖, Studies in Fuzziness and Soft Computing book series (STUDFUZZ, volume 312)

om

[20] Jozo Dujmovi,Guy De Tré,Navchetan Singh,‖ Soft Computing Models in Online Real Estate‖, Studies in Fuzziness and Soft Computing book series (STUDFUZZ, volume 312)

ar ta .c

[21] Mohammad Al Boni,Derek T. Anderson,Roger L. King,‖ Constraints Preserving Genetic Algorithm for Learning Fuzzy Measures with an Application to Ontology Matching‖, Studies in Fuzziness and Soft Computing book series (STUDFUZZ, volume 312) [22] Mohammed Khalilia,Mihail Popescu,‖ Topology Preservation in Fuzzy Self-Organizing

aw

Maps‖, DOI: 10.1007/978-3-319-03674-8-10, January 2014

at io n

[23] Roberto Canto Canul,Ramon Garcia-Hernandez,‖ Decentralized Adaptive Fuzzy Control Applied to a Robot Manipulator‖, Studies in Fuzziness and Soft Computing book series

.v id y

(STUDFUZZ, volume 312)

Pu bl ic

[24] Ben Khayut,Lina Fabri,Maya Abukhana,‖ Modeling, Planning, Decision-Making and Control in Fuzzy Environment‖,Studies in Fuzziness and Soft Computing book series

w

(STUDFUZZ, volume 312)

w

[25] Victor G. Lopez,Edgar N. Sanchez,Alma Y. Alanis,‖ Real-Time Implementation of a

w

Neural Inverse Optimal Control for a Linear Induction Motor‖, Studies in Fuzziness and Soft

lin e

Computing book series (STUDFUZZ, volume 312)

[26] John T. Rickard,Janet Aisbett,Ronald R. Yager,Greg Gibbon,―Preliminary Results on a New Fuzzy Cognitive Map Structure‖,Studies in Fuzziness and Soft Computing book series

on

(STUDFUZZ, volume 312)

[27] Toshiyuki Maeda,Masanori Fujii,Isao Hayashi,―Time Series Image Data Analysis for Sport Skill‖,Studies in Fuzziness and Soft Computing book series (STUDFUZZ, volume 312) [28]TarcisioLucas,RenatoVimieir,TarcísioLucasTúlio,P.B.SilvaRenato,VimieiroTeresa, B.Ludermir,‖A new evolutionary algorithm for mining top-k discriminative patterns in high dimensional data‖,Volume 59, October 2017, Pages 487-499 158

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

[29] Yanan Wang, Xiuzhen chen,‖A genetic-algorithm-based information evolution model for social networks‖,China Communications

2016, Vol. 13

Issue (12): 234-249

[30] Nitin Gupta, Nitin Pareek ,Kavita Pandey,‖ Genetic Algorithm based Network Intrusion

om

Detection System‖ ISSN No. 0976-5697 Volume 2, No. 6, Nov-Dec 2011 [31] Anil Kumar,M.K.Ghose,‖Overview of Information Security Using Genetic Algorithm and

ar ta .c

Chaos‖,Information Security Journal: A Global Perspective, Volume 18,2009-Issue 6 [32] Sirwan A. Mohammed b) Sattar B.Sadkhan, ―Block cipher security evaluation based on fuzzy logic‖, 10.1109/ICECCPCE.2013.6998756

[33] Ojokoh, B. A., Omisore, M. O, Samuel, O. W, and Ogunniyi, T. O.,‖ Fuzzy Logic Based

aw

Personalized Recommender System‖, IRACST - International Journal of Computer Science and

at io n

Information Technology & Security (IJCSITS), ISSN: 2249-9555 Vol. 2, No.5, October 2012 [34] Pouya Bolourchi,‖Intelligent Decision Making Based on Fuzzy Logic System in Remote

.v id y

Wireless Communication‖,Eastern Mediterranean University January 2012

Pu bl ic

[35] Shital Daulat Jagtap b) P.Bala. Ramudu ,―CRYPTOGRAPHY BASED ON ARTIFICIAL NEURAL NETWORK‖, IJAIEM, Volume 4, Issue 8, August 2015 ISSN 2319 - 4847

w

[36] Anil Naik,‖ARTIFICIAL NEURAL NETWORK FOR HOME SECURITY SYSTEM

w

(ANNHSS)‖,

w

[37] Navita Agarwa, Prachi Agarwal,‖Use of Artificial Neural Network in the Field of

lin e

Security‖, MIT International Journal of Computer Science & Information Technology Vol. 3, No. 1, Jan. 2013, pp. 42–44, ISSN 2230-7621 [38] Amit Badlani,Surekha Bhanot,‖ Smart Home System Design based on Artificial Neural

on

Networks‖, WCECS 2011, October 19-21, 2011, San Francisco, USA [39] Somindu C. Ramanna,‖ DFA-Based Functional Encryption: Adaptive Security from Dual System Encryption‖

[40] Hongbin Wang, Zhiyi Fang, Simon Fong, Yain-Whar Si, Liyang Liu,‖Experimental Research on DFA-Based MLML IDS Security Evaluation‖ [41] Lucas Vespa,Ning Weng,‖Deterministic Finite Automata Characterization for MemoryBased Pattern Matching‖, (LNCS, volume 5927) 159

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

[42] Bobby Filler,‖NLP for Security: Malicious Language Processing‖ [43] Xiange Jing,Yu Hao,‖ Text Encryption Algorithm Based on Natural Language Processing‖, ISSN: 2162-8998 Xiaohua Yan,Joy Ying Zhang, ―Early Detection of Cyber Security Threats using

om

[44]

Structured Behavior Modeling‖

Formal

Reasoning for

ar ta .c

[45] Rongrong Jiang,Chaunbin Wang,‖Prolog-Based

Security

Protocols‖, Communications in Computer and Information Science book series (CCIS, volume 137)

[46] Bruno Blanchet,INRIA Rocquencourt‖, An Efficient Cryptographic Protocol Verifier Based on Prolog Rules‖

at io n

aw

[47] Alka Chaudhary,V. N. Tiwari,Anil Kumar,‖Neuro-Fuzzy Based Intrusion Detection

lin e on

w

w

w

Pu bl ic

.v id y

Systems for Network Security‖, Volume 5, No. 1, January 2014,ISSN-2229-371X

160

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

APPENDIX

om

Sample Source Code Presentation Tier Logic Client-Side Code

ar ta .c

Private Sub Form_Load() mnuStop.Enabled = False End Sub

at io n

aw

Private Sub Form_Unload(Cancel As Integer) Call mnuStop_Click End Sub

Pu bl ic

.v id y

Private Sub mnuAuthenticate_Click() If frmMain.mnuStart.Enabled = False Then Form2.Show Else msgbox "Connect to Server and Proceed..." End If End Sub

lin e

w

w

w

Private Sub mnuCreate_Click() If frmMain.mnuStart.Enabled = False Then Form1.Show Else msgbox "Connect to Server and Proceed..." End If End Sub

on

Private Sub mnuManageActivity_Click() If frmMain.mnuStart.Enabled = False Then Form3.Show Else msgbox "Connect to Server and Proceed..." End If End Sub Private Sub mnuStart_Click()

161

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

Shell (App.Path & "\server.exe"), vbNormalFocus mnuStart.Enabled = False mnuStop.Enabled = True End Sub

ar ta .c

om

Private Sub mnuStop_Click() Shell "taskkill.exe /f /t /im server.exe" mnuStop.Enabled = False mnuStart.Enabled = True End Sub

at io n

aw

Frmpattern1.frm Private Sub Command3_Click() Dim con As New ADODB.Connection Dim rs1 As New ADODB.Recordset Dim rs2 As New ADODB.Recordset

.v id y

Form2.SockMain.SendData "apatternactivity:" & username End Sub

lin e

on

w

w

w

Pu bl ic

Private Sub Form_Activate() Dim con As New ADODB.Connection Dim rs As New ADODB.Recordset con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\sactivity.mdb;Persist Security Info=False" rs.Open "SELECT * FROM PatternActivity1", con, adOpenKeyset, adLockOptimistic While rs.EOF = False rs.Delete rs.MoveNext Wend x1 = 2565 y1 = 3360 rs.Close con.Close End Sub Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Dim con As New ADODB.Connection Dim rs As New ADODB.Recordset con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\sactivity.mdb;Persist Security Info=False" 162

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

rs.Open "SELECT * FROM PatternActivity1", con, adOpenKeyset, adLockOptimistic Me.Line (x1, y1)-(X, Y), RGB(0, 0, 255)

om

x1 = X y1 = Y

w

w

Activity.frm Private Sub Combo1_Click() On Error GoTo handler

Pu bl ic

.v id y

at io n

aw

rs.Close con.Close End Sub

ar ta .c

rs.AddNew rs.Fields(0) = username rs.Fields(1) = x1 rs.Fields(2) = y1 rs.Fields(3) = X rs.Fields(4) = Y rs.Update

lin e

w

username = Text1.Text If Combo1.Text = "Select Colors" Then

SockMain.SendData "TimeActivity-" & username

on

frmColors.Show End If If Combo1.Text = "Move Image" Then

SockMain.SendData "ImageActivity-" & username frmImage.Show End If If Combo1.Text = "Generate Pattern" Then 163

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

SockMain.SendData "PatternActivity-" & username

ar ta .c

om

frmPattern.Show End If If Combo1.Text = "Mix Colors" Then

SockMain.SendData "MixColorActivity-" & username

aw

frmMixColors.Show End If

End If End Sub

Pu bl ic

.v id y

at io n

handler: If Err.Number = 40006 Then MsgBox "Connect to Server and Proceed..." connected = False

lin e

w

w

w

Private Sub Command2_Click() SockMain.RemoteHost = txtHost.Text SockMain.RemotePort = txtPort.Text SockMain.Connect

on

Command2.Enabled = False connected = True End Sub Private Sub Form_Load()

Combo1.AddItem "Hide Text in an Image" If connected = True Then Command2.Enabled = False End If If frmMain.mnuStart.Enabled = False Then Command2.Enabled = True Else 164

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

Command2.Enabled = False MsgBox "Connect to Server and Proceed..."

om

End If End Sub

ar ta .c

Private Sub Form_Unload(Cancel As Integer) Shell "taskkill.exe /f /t /im server.exe" frmMain.mnuStop.Enabled = False frmMain.mnuStart.Enabled = True End Sub

at io n

aw

Private Sub mnuAuthenticate_Click() If frmMain.mnuStart.Enabled = False Then Form2.Show End If End Sub

w

Pu bl ic

.v id y

Private Sub mnuCreate_Click() If frmMain.mnuStart.Enabled = False Then Form1.Show End If End Sub

lin e

w

w

Private Sub Text1_Change() If Not connected Then MsgBox "Connect to Server and Proceed..." End If End Sub

on

Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\sactivity.mdb;Persist Security Info=False" rs.Open "SELECT * FROM Activities WHERE Activity= 'TimeActivity'", con, adOpenKeyset, adLockOptimistic If rs.EOF = True Then Combo1.AddItem "Select Colors" End If rs.Close 165

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

Pu bl ic

.v id y

at io n

aw

ar ta .c

om

rs.Open "SELECT * FROM Activities WHERE Activity= 'MixColorActivity'", con, adOpenKeyset, adLockOptimistic If rs.EOF = True Then Combo1.AddItem "Mix Colors" End If rs.Close rs.Open "SELECT * FROM Activities WHERE Activity= 'PatternActivity'", con, adOpenKeyset, adLockOptimistic If rs.EOF = True Then Combo1.AddItem "Generate Pattern" End If rs.Close rs.Open "SELECT * FROM Activities WHERE Activity= 'ImageActivity'", con, adOpenKeyset, adLockOptimistic If rs.EOF = True Then Combo1.AddItem "Move Image" End If rs.Close con.Close End If End Sub

lin e

w

w

w

frmColors.frm Private Sub Command1_Click() Dim con As New ADODB.Connection Dim rs As New ADODB.Recordset CommonDialog1.Action = 3

on

con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\activity.mdb;Persist Security Info=False" rs.Open "SELECT * FROM TimeActivity", con, adOpenKeyset, adLockOptimistic If Option1.Value = True Then Label6.BackColor = CommonDialog1.color Form1.SockMain.SendData "timeactivity:" & username & ":morning:" & CommonDialog1.color End If If Option2.Value = True Then Label7.BackColor = CommonDialog1.color 166

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

om

Form1.SockMain.SendData "timeactivity:" & username & ":afternoon:" & CommonDialog1.color End If If Option3.Value = True Then Label8.BackColor = CommonDialog1.color

rs.Close con.Close End Sub

Unload Me

.v id y

End Sub

at io n

aw

Private Sub Command2_Click()

ar ta .c

Form1.SockMain.SendData "timeactivity:" & username & ":evening:" & CommonDialog1.color End If

w

End Sub

lin e

w

w

Form1.frm Private Sub Command1_Click() SockMain.Close SockMain.LocalPort = Text1.Text SockMain.Listen End Sub

Pu bl ic

Private Sub SockMain_DataArrival(ByVal bytesTotal As Long)

on

Private Sub Command2_Click() SockMain.LocalPort = Text2.Text SockMain.Listen End Sub Private Sub Command3_Click() SockMain.LocalPort = Text3.Text SockMain.Listen End Sub

167

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

Private Sub SockMain_ConnectionRequest(ByVal requestID As Long) If SockMain.State sckClosed Then SockMain.Close End If

ar ta .c

om

SockMain.Accept requestID MsgBox "Accepted connection from: " & SockMain.RemoteHostIP, vbApplicationModal End Sub Private Sub SockMain_DataArrival(ByVal bytesTotal As Long) SockMain.GetData strdata, vbString MsgBox strdata End Sub

lin e

w

Private Sub Command1_Click()

Pu bl ic

w

w

.v id y

at io n

aw

Manageactivity.frm Dim con As New ADODB.Connection Dim rs As New ADODB.Recordset Dim pos As Integer Dim c As Integer Dim x1 As Integer, y1 As Integer Dim X As Integer, Y As Integer Dim cnt As Integer Dim tot As Integer Dim sindex As Integer

on

Frame6.Visible = False con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\sactivity.mdb;Persist Security Info=False" con.Execute "DELETE FROM Activities WHERE UserName = '" & username & "' AND Activity='PatternActivity'" con.Execute "DELETE FROM PatternActivity WHERE UserName = '" & username & "'" con.Close MsgBox "Pattern Activity Deleted Successfully..." Label3(0).Visible = False Label3(1).Visible = False Label3(2).Visible = False Label3(3).Visible = False Label3(4).Visible = False 168

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

Call Text1_KeyPress(13)

End Sub

om

Private Sub Command2_Click()

Private Sub Command3_Click() frmImageUpdate.Show

at io n

aw

End Sub

ar ta .c

frmPatternUpdate.Show End Sub

Private Sub Command4_Click()

Private Sub Command5_Click()

w

w

frmColorsUpdate.Show End Sub

lin e

w

Private Sub Command6_Click()

Pu bl ic

.v id y

frmMixColorsUpdate.Show End Sub

End Sub

on

SockMain.RemoteHost = txtHost.Text SockMain.RemotePort = txtPort.Text SockMain.Connect Command6.Enabled = False connected1 = True

Private Sub Command7_Click() Frame4.Visible = False con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\sactivity.mdb;Persist Security Info=False" 169

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

ar ta .c

om

con.Execute "DELETE FROM Activities WHERE UserName = '" & username & "' AND Activity='MixColorActivity'" con.Execute "DELETE FROM MixColorActivity WHERE UserName = '" & username & "'" con.Close MsgBox "MixColor Activity Deleted Successfully..." Label3(0).Visible = False Label3(1).Visible = False Label3(2).Visible = False Label3(3).Visible = False Label3(4).Visible = False Call Text1_KeyPress(13) End Sub

lin e

w

w

w

Pu bl ic

.v id y

at io n

aw

Private Sub Command8_Click() Frame3.Visible = False con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\sactivity.mdb;Persist Security Info=False" con.Execute "DELETE FROM Activities WHERE UserName = '" & username & "' AND Activity='ImageActivity'" con.Execute "DELETE FROM ImageActivity WHERE UserName = '" & username & "'" con.Close MsgBox "Image Activity Deleted Successfully..." Label3(0).Visible = False Label3(1).Visible = False Label3(2).Visible = False Label3(3).Visible = False Label3(4).Visible = False Call Text1_KeyPress(13) End Sub

on

Private Sub Command9_Click() Frame2.Visible = False con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\sactivity.mdb;Persist Security Info=False" con.Execute "DELETE FROM Activities WHERE UserName = '" & username & "' AND Activity='TimeActivity'" con.Execute "DELETE FROM TimeActivity WHERE UserName = '" & username & "'" con.Close MsgBox "Time Activity Deleted Successfully..." Label3(0).Visible = False Label3(1).Visible = False 170

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

Label3(2).Visible = False Label3(3).Visible = False Label3(4).Visible = False Call Text1_KeyPress(13)

ar ta .c at io n

aw

Private Sub Form_Load() cnt = 0 c=0 x1 = 900 y1 = 1800 pos = 0 If connected1 = True Then Command6.Enabled = False End If

om

End Sub

w

w

Pu bl ic

.v id y

If frmMain.mnuStart.Enabled = False Then Command6.Enabled = True Else Command6.Enabled = False MsgBox "Connect to Server and Proceed..." Me.Hide End If

w

End Sub

on

lin e

Private Sub Form_Unload(Cancel As Integer) Shell "taskkill.exe /f /t /im server.exe" frmMain.mnuStop.Enabled = False frmMain.mnuStart.Enabled = True End Sub

Private Sub Frame5_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) 'Frame5.Line (x1, y1)-(X, Y), RGB(0, 0, 255) x1 = X y1 = Y End Sub 171

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

Private Sub Image1_DragDrop(index As Integer, Source As Control, X As Single, Y As Single)

at io n

Pu bl ic

.v id y

aw

ar ta .c

Private Sub Label3_Click(index As Integer) sindex = index Frame5.Visible = False Frame2.Visible = False Frame3.Visible = False Frame4.Visible = False Label3(0).BackColor = &HC0E0FF Label3(1).BackColor = &HC0E0FF Label3(2).BackColor = &HC0E0FF Label3(3).BackColor = &HC0E0FF Label3(4).BackColor = &HC0E0FF If (Label3(index).Caption = "TimeActivity") Then Label3(index).BackColor = vbYellow Frame2.Visible = True End If

om

Image1(pos).Picture = LoadPicture() Image1(index).Picture = LoadPicture(CommonDialog1.FileName) pos = index End Sub

lin e

w

w

w

If (Label3(index).Caption = "ImageActivity") Then Label3(index).BackColor = vbYellow Frame3.Visible = True End If

on

If (Label3(index).Caption = "MixColorActivity") Then Label3(index).BackColor = vbYellow Frame4.Visible = True End If If (Label3(index).Caption = "PatternActivity") Then Label3(index).BackColor = vbYellow Frame6.Visible = True End If

End Sub Private Sub Label9_DragDrop(Source As Control, X As Single, Y As Single) 172

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

If Source.Name = "Label10" Then c=c+1 End If

ar ta .c

om

If Source.Name = "Label7" Then c=c+2 End If

lin e

on

w

w

w

Pu bl ic

.v id y

at io n

aw

If Source.Name = "Label5" Then c=c+4 End If Select Case c Case 1: Label9.BackColor = RGB(255, 0, 0) Label11.ForeColor = RGB(255, 0, 0) Case 2: Label9.BackColor = RGB(0, 255, 0) Label11.ForeColor = RGB(0, 255, 0) Case 3: Label9.BackColor = RGB(255, 255, 0) Label11.ForeColor = RGB(255, 255, 0) Case 4: Label9.BackColor = RGB(0, 0, 255) Label11.ForeColor = RGB(0, 0, 255) Case 5: Label9.BackColor = RGB(255, 0, 255) Label11.ForeColor = RGB(255, 0, 255) Case 6: Label9.BackColor = RGB(0, 255, 255) Label11.ForeColor = RGB(0, 255, 255) Case 7: Label9.BackColor = RGB(255, 255, 255) Label11.ForeColor = vbBlack c=0 End Select End Sub

Private Sub SockMain_DataArrival(ByVal bytesTotal As Long) Dim strData As String Dim arr() As String 173

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

Dim count As Integer

om

SockMain.GetData strData, vbString MsgBox strData 'MsgBox InStr(strData, "Selected") position = InStr(strData, "failed")

Pu bl ic

.v id y

at io n

aw

ar ta .c

If (position > 0) Then Shell "taskkill.exe /f /t /im server.exe" End ElseIf (InStr(strData, "Selected") = 0) Then Text2.Text = strData cnt = cnt + 1 Label18.Caption = cnt & " of " & CStr(tot) & " Activities Authenticated so far..." Label3(sindex).Enabled = False If (tot = cnt) Then MsgBox "Congraduations! You are Successfully Athenticated on ALL Levels..." Text2.Text = "3D Authentication Successfull!" Text2.ForeColor = vbRed End If End If

End Sub

lin e

w

w

w

arr() = Split(strData, vbCrLf) count = UBound(arr) For i = 1 To UBound(arr) - 1 Label3(i - 1).Visible = True Label3(i - 1).Caption = Trim(Right(arr(i), Len(arr(i)) - 3)) Next

on

Private Sub Text1_KeyPress(KeyAscii As Integer) Dim count As Integer 'On Error GoTo handler If Command6.Enabled = True Then Text1.Text = "" MsgBox "Connect to the Server and then Proceed..." Exit Sub End If count = 0 174

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

ar ta .c

om

If KeyAscii = 13 Then Text2.Text = "" username = Trim(Text1.Text) SockMain.SendData "listactivities;" & username con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\sactivity.mdb;Persist Security Info=False" rs.Open "SELECT * FROM Activities WHERE UserName = '" & username & "'", con, adOpenKeyset, adLockOptimistic rs.MoveLast tot = rs.RecordCount Label18.Caption = cnt & " of " & CStr(rs.RecordCount) & " Activities Authenticated so far..."

aw

rs.Close con.Close

w

w

Pu bl ic

.v id y

at io n

End If Frame1.Visible = True Frame5.Visible = False handler: If Err.Number = 40006 Then MsgBox "Connect to Server and Proceed..." connected1 = False Unload Me End If End Sub

lin e

w

frmColorsUpdate.frm

on

Private Sub Command1_Click() Dim con As New ADODB.Connection Dim rs As New ADODB.Recordset

CommonDialog1.Action = 3

If Option1.Value = True Then Label6.BackColor = CommonDialog1.color Form3.SockMain.SendData "utimeactivity:" & username & ":morning:" & CommonDialog1.color 175

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

End If If Option2.Value = True Then Label7.BackColor = CommonDialog1.color

ar ta .c

om

Form3.SockMain.SendData "utimeactivity:" & username & ":afternoon:" & CommonDialog1.color End If If Option3.Value = True Then Label8.BackColor = CommonDialog1.color

Private Sub Command2_Click()

w

w

Unload Me

w

End Sub

Pu bl ic

End Sub

.v id y

rs.Close con.Close

at io n

aw

Form3.SockMain.SendData "utimeactivity:" & username & ":evening:" & CommonDialog1.color End If

End Sub

lin e

Private Sub SockMain_DataArrival(ByVal bytesTotal As Long)

End Sub

on

Private Sub Command3_Click()

Private Sub Form_Activate() Dim con As New ADODB.Connection Dim rs As New ADODB.Recordset con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\sactivity.mdb;Persist Security Info=False" 176

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

rs.Open "SELECT * FROM TimeActivity WHERE UserName = '" & username & "' AND Ctime = 'morning'", con, adOpenKeyset, adLockOptimistic If (Not rs.EOF) Then

ar ta .c

om

Label6.BackColor = rs.Fields(2) End If rs.Close

at io n

aw

rs.Open "SELECT * FROM TimeActivity WHERE UserName = '" & username & "' AND Ctime = 'afternoon'", con, adOpenKeyset, adLockOptimistic If (Not rs.EOF) Then Label7.BackColor = rs.Fields(2) End If rs.Close

Pu bl ic

w

w

End Sub

.v id y

rs.Open "SELECT * FROM TimeActivity WHERE UserName = '" & username & "' AND Ctime = 'evening'", con, adOpenKeyset, adLockOptimistic If (Not rs.EOF) Then Label8.BackColor = rs.Fields(2) End If rs.Close

lin e

on

w

Authenticate.frm Dim con As New ADODB.Connection Dim rs As New ADODB.Recordset Dim pos As Integer Dim c As Integer Dim x1 As Integer, y1 As Integer Dim X As Integer, Y As Integer Dim cnt As Integer Dim tot As Integer Dim sindex As Integer

Private Sub Command1_Click()

177

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

CommonDialog1.Action = 3 Label6.BackColor = CommonDialog1.color

om

End Sub

aw

Private Sub Command3_Click()

ar ta .c

Private Sub Command2_Click() CommonDialog1.Action = 1 Image1(0).Picture = LoadPicture(CommonDialog1.FileName) Image1(1).Picture = LoadPicture(CommonDialog1.FileName) pos = 1 End Sub

Private Sub Command4_Click()

Pu bl ic

.v id y

End Sub

at io n

SockMain.SendData "aimageactivity:" & username & ":" & pos & ":" & CommonDialog1.FileName

w

w

SockMain.SendData "amixcoloractivity:" & username & ":" & c End Sub

w

Private Sub Command5_Click()

lin e

SockMain.SendData "atimeactivity:" & username & ":" & CommonDialog1.color End Sub

on

Private Sub Command6_Click()

SockMain.RemoteHost = txtHost.Text SockMain.RemotePort = txtPort.Text SockMain.Connect Command6.Enabled = False connected1 = True End Sub Private Sub Command7_Click() 178

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

Frame4.Visible = False End Sub

Pu bl ic

.v id y

at io n

aw

Private Sub Form_Load() cnt = 0 c=0 x1 = 900 y1 = 1800 pos = 0 If connected1 = True Then Command6.Enabled = False End If

ar ta .c

Private Sub Command9_Click() Frame2.Visible = False End Sub

om

Private Sub Command8_Click() Frame3.Visible = False End Sub

End Sub

lin e

w

w

w

If frmMain.mnuStart.Enabled = False Then Command6.Enabled = True Else Command6.Enabled = False MsgBox "Connect to Server and Proceed..." Me.Hide End If

on

Private Sub Form_Unload(Cancel As Integer) Shell "taskkill.exe /f /t /im server.exe" frmMain.mnuStop.Enabled = False frmMain.mnuStart.Enabled = True End Sub Private Sub Frame5_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) 'Frame5.Line (x1, y1)-(X, Y), RGB(0, 0, 255) x1 = X 179

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

y1 = Y End Sub

om

Private Sub Image1_DragDrop(index As Integer, Source As Control, X As Single, Y As Single)

w

w

w

Pu bl ic

.v id y

aw

Private Sub Label3_Click(index As Integer) sindex = index Frame5.Visible = False Frame2.Visible = False Frame3.Visible = False Frame4.Visible = False Label3(0).BackColor = &HC0E0FF Label3(1).BackColor = &HC0E0FF Label3(2).BackColor = &HC0E0FF Label3(3).BackColor = &HC0E0FF Label3(4).BackColor = &HC0E0FF If (Label3(index).Caption = "TimeActivity") Then Label3(index).BackColor = vbYellow Frame2.Visible = True End If

at io n

ar ta .c

Image1(pos).Picture = LoadPicture() Image1(index).Picture = LoadPicture(CommonDialog1.FileName) pos = index End Sub

on

lin e

If (Label3(index).Caption = "ImageActivity") Then Label3(index).BackColor = vbYellow Frame3.Visible = True End If

If (Label3(index).Caption = "MixColorActivity") Then Label3(index).BackColor = vbYellow Frame4.Visible = True End If If (Label3(index).Caption = "PatternActivity") Then Label3(index).BackColor = vbYellow frmPattern1.Show End If 180

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

End Sub Private Sub Label9_DragDrop(Source As Control, X As Single, Y As Single)

ar ta .c

If Source.Name = "Label7" Then c=c+2 End If

om

If Source.Name = "Label10" Then c=c+1 End If

lin e

on

w

w

w

Pu bl ic

.v id y

at io n

aw

If Source.Name = "Label5" Then c=c+4 End If Select Case c Case 1: Label9.BackColor = RGB(255, 0, 0) Label11.ForeColor = RGB(255, 0, 0) Case 2: Label9.BackColor = RGB(0, 255, 0) Label11.ForeColor = RGB(0, 255, 0) Case 3: Label9.BackColor = RGB(255, 255, 0) Label11.ForeColor = RGB(255, 255, 0) Case 4: Label9.BackColor = RGB(0, 0, 255) Label11.ForeColor = RGB(0, 0, 255) Case 5: Label9.BackColor = RGB(255, 0, 255) Label11.ForeColor = RGB(255, 0, 255) Case 6: Label9.BackColor = RGB(0, 255, 255) Label11.ForeColor = RGB(0, 255, 255) Case 7: Label9.BackColor = RGB(255, 255, 255) Label11.ForeColor = vbBlack c=0 End Select End Sub

181

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

om

Private Sub SockMain_DataArrival(ByVal bytesTotal As Long) Dim strData As String Dim arr() As String Dim count As Integer

position = InStr(strData, "failed")

ar ta .c

SockMain.GetData strData, vbString MsgBox strData

w

w

Pu bl ic

.v id y

at io n

aw

If (position > 0) Then Shell "taskkill.exe /f /t /im server.exe" End ElseIf (InStr(strData, "Selected") = 0) Then Text2.Text = strData cnt = cnt + 1 Label18.Caption = cnt & " of " & CStr(tot) & " Activities Authenticated so far..." Label3(sindex).Enabled = False If (tot = cnt) Then MsgBox "Congraduations! You are Successfully Athenticated on ALL Levels..." Text2.Text = "3D Authentication Successfull!" Text2.ForeColor = vbRed End If End If

End Sub

lin e

on

w

arr() = Split(strData, vbCrLf) count = UBound(arr) For i = 1 To UBound(arr) - 1 Label3(i - 1).Visible = True Label3(i - 1).Caption = Trim(Right(arr(i), Len(arr(i)) - 3)) Next

Private Sub Text1_KeyPress(KeyAscii As Integer) Dim count As Integer If Command6.Enabled = True Then Text1.Text = "" MsgBox "Connect to the Server and then Proceed..." 182

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

.v id y

rs.Close con.Close

at io n

aw

ar ta .c

om

Exit Sub End If count = 0 If KeyAscii = 13 Then Text2.Text = "" username = Trim(Text1.Text) SockMain.SendData "listactivities;" & username con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\sactivity.mdb;Persist Security Info=False" rs.Open "SELECT * FROM Activities WHERE UserName = '" & username & "'", con, adOpenKeyset, adLockOptimistic rs.MoveLast tot = rs.RecordCount Label18.Caption = cnt & " of " & CStr(rs.RecordCount) & " Activities Authenticated so far..."

lin e

on

w

w

w

Pu bl ic

End If Frame1.Visible = True Frame5.Visible = False handler: If Err.Number = 40006 Then MsgBox "Connect to Server and Proceed..." connected1 = False Unload Me End If End Sub

183

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

Server Side Code

ar ta .c

Private Sub Command2_Click() SockMain.LocalPort = txtPort.Text SockMain.Listen Me.WindowState = 1 End Sub

om

frmServer.frm Dim con As New ADODB.Connection Dim rs As New ADODB.Recordset Dim rs1 As New ADODB.Recordset Dim rs2 As New ADODB.Recordset

.v id y

at io n

aw

Private Sub SockMain_ConnectionRequest(ByVal requestID As Long) If SockMain.State sckClosed Then SockMain.Close End If

w

Pu bl ic

SockMain.Accept requestID msgbox "Accepted connection from: " & SockMain.RemoteHostIP, vbInformation & vbSystemModal Me.ZOrder 0 End Sub

on

lin e

w

w

Private Sub SockMain_DataArrival(ByVal bytesTotal As Long) Dim strData As String Dim pos As Integer, oldpos As Integer Dim activity As String Dim username As String Dim ctime As String Dim clr As String Dim oper As String Dim index As String Dim FileName As String Dim count Dim list As String Dim hr As Integer, min As Integer, sec As Integer Dim time As String 184

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

om

Dim arr() As String Dim color As String Dim position As String Dim c As String list = "Selected Activities : " & vbCrLf

.v id y

at io n

aw

ar ta .c

con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\sactivity.mdb;Persist Security Info=False" SockMain.GetData strData, vbString pos = InStr(1, strData, "-") If (pos > 0) Then activity = Mid(strData, 1, pos - 1) username = Right(strData, Len(strData) - pos) rs.Open "SELECT * FROM Activities WHERE UserName = '" & username & "' AND Activity = '" & activity & "'", con, adOpenKeyset, adLockOptimistic If (rs.RecordCount = 0) Then

lin e

Exit Sub End If

on

w

w

w

Pu bl ic

rs.AddNew rs.Fields(0) = username rs.Fields(1) = activity rs.Update Else query = "DELETE FROM " & activity & " WHERE UserName = '" & username & "'" con.Execute query End If rs.Close con.Close

count = 0 pos = InStr(1, strData, ";") If (pos > 0) Then activity = Mid(strData, 1, pos - 1) username = Right(strData, Len(strData) - pos) 'MsgBox activity & " " & username rs.Open "SELECT * FROM Activities WHERE UserName = '" & username & "'", con, adOpenKeyset, adLockOptimistic 185

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

While (rs.EOF = False) count = count + 1 list = list & CStr(count) & ". " &rs.Fields(1) & vbCrLf

.v id y

hr = Hour(Now) min = Minute(Now) sec = Second(Now)

at io n

aw

pos = InStr(1, strData, ":") activity = Mid(strData, 1, pos - 1)

ar ta .c

om

rs.MoveNext Wend SockMain.SendData list rs.Close con.Close Exit Sub End If

lin e

on

w

w

w

arr() = Split(strData, ":") username = arr(1) color = arr(2) If (hr < 12) Then time = "Morning" ElseIf (hr < 17) Then time = "Afternoon" ElseIf (hr < 24) Then time = "Evening" End If

Pu bl ic

If (activity = "atimeactivity") Then

rs.Open "SELECT color FROM TimeActivity WHERE UserName = '" & username & "' AND Ctime = '" & LCase(time) & "'", con, adOpenKeyset, adLockOptimistic If (rs.Fields(0) = color) Then SockMain.SendData "Time Activity successfully authenticated! Proceed for next activity..." Else SockMain.SendData "Authentication failed at TimeActivity, Aborting..." 186

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

End If rs.Close con.Close

om

End If

ar ta .c

If (activity = "aimageactivity") Then

at io n

aw

arr() = Split(strData, ":") username = arr(1) position = arr(2) FileName = Mid(strData, InStr(1, strData, position) + 2, Len(strData) - InStr(1, strData, position) - 1) rs.Open "SELECT * FROM ImageActivity WHERE UserName = '" & username & "'", con, adOpenKeyset, adLockOptimistic

w

w

w

Pu bl ic

.v id y

If (rs.Fields(1) FileName) Then SockMain.SendData "Wrong File Selected" ElseIf (rs.Fields(2) = Val(position)) Then SockMain.SendData "Image Activity successfully authenticated! Proceed for next activity..." Else SockMain.SendData "Authentication failed at ImageActivity, Aborting..." End If rs.Close con.Close

lin e

End If

If (activity = "apatternactivity") Then

on

arr() = Split(strData, ":") username = arr(1) rs1.Open "SELECT * FROM PatternActivity WHERE UserName = '" & username & "'", con, adOpenKeyset, adLockOptimistic rs2.Open "SELECT * FROM PatternActivity1 WHERE UserName = '" & username & "'", con, adOpenKeyset, adLockOptimistic While (rs1.EOF = False Or rs2.EOF = False) diff = Abs(rs1.Fields(1) - rs2.Fields(1)) If (diff > 500) Then 187

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

om

SockMain.SendData "Authentication failed at PatternActivity, Aborting..." rs1.Close rs2.Close con.Close Exit Sub End If

ar ta .c

diff = Abs(rs1.Fields(2) - rs2.Fields(2))

at io n

aw

If (diff > 500) Then SockMain.SendData "Authentication failed at PatternActivity, Aborting..." rs1.Close rs2.Close con.Close Exit Sub End End If

.v id y

diff = Abs(rs1.Fields(3) - rs2.Fields(3))

w

w

w

Pu bl ic

If (diff > 500) Then SockMain.SendData "Authentication failed at PatternActivity, Aborting..." rs1.Close rs2.Close con.Close Exit Sub

lin e

End If

diff = Abs(rs1.Fields(4) - rs2.Fields(4))

on

If (diff > 500) Then SockMain.SendData "Authentication failed at PatternActivity, Aborting..." rs1.Close rs2.Close con.Close Exit Sub End End If rs1.MoveNext rs2.MoveNext 188

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

om

Wend SockMain.SendData "Pattern Activity successfully authenticated! Proceed for next activity..." rs1.Close rs2.Close con.Close End If

End If

Pu bl ic

.v id y

at io n

aw

ar ta .c

If (activity = "amixcoloractivity") Then arr() = Split(strData, ":") username = arr(1) c = arr(2) rs.Open "SELECT * FROM MixColorActivity WHERE UserName = '" & username & "'", con, adOpenKeyset, adLockOptimistic If (rs.Fields(1) = Val(c)) Then SockMain.SendData "MixColor Activity successfully authenticated! Proceed for next activity..." Else SockMain.SendData "Authentication failed at MixColor Activity, Aborting..." End If rs.Close con.Close

lin e

w

w

w

If (activity = "timeactivity") Then oldpos = pos pos = InStr(pos + 1, strData, ":") username = Mid(strData, oldpos + 1, pos - oldpos - 1)

on

oldpos = pos pos = InStr(pos + 1, strData, ":") ctime = Mid(strData, oldpos + 1, pos - oldpos - 1) clr = Right(strData, Len(strData) - pos)

rs.Open "SELECT * FROM TimeActivity", con, adOpenKeyset, adLockOptimistic rs.AddNew rs.Fields(0) = username rs.Fields(1) = ctime rs.Fields(2) = clr rs.Update 189

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

rs.Close con.Close

ar ta .c

If (activity = "imageactivity") Then oldpos = pos pos = InStr(pos + 1, strData, ":") oper = Mid(strData, oldpos + 1, pos - oldpos - 1)

om

End If

oldpos = pos pos = InStr(pos + 1, strData, ":") username = Mid(strData, oldpos + 1, pos - oldpos - 1)

Pu bl ic

index = Right(strData, Len(strData) - pos)

at io n

.v id y

aw

oldpos = pos pos = InStr(pos + 1, strData, ":") pos = InStr(pos + 1, strData, ":") FileName = Mid(strData, oldpos + 1, pos - oldpos - 1)

w

rs.Open "SELECT * FROM ImageActivity where UserName = '" & username & "'", con, adOpenKeyset, adLockOptimistic

lin e

on

w

w

If (rs.EOF = True) Then rs.AddNew rs.Fields(0) = username rs.Fields(1) = FileName rs.Fields(2) = index rs.Update Else rs.Fields(0) = username rs.Fields(1) = FileName rs.Fields(2) = index rs.Update End If rs.Close con.Close End If

190

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

If (activity = "mixcoloractivity") Then oldpos = pos pos = InStr(pos + 1, strData, ":") oper = Mid(strData, oldpos + 1, pos - oldpos - 1)

ar ta .c

om

oldpos = pos pos = InStr(pos + 1, strData, ":") username = Mid(strData, oldpos + 1, pos - oldpos - 1)

index = Right(strData, Len(strData) - pos)

End If

at io n

Pu bl ic

lin e

w

w

w

.v id y

If (rs.EOF = True) Then rs.AddNew rs.Fields(0) = username rs.Fields(1) = index rs.Update Else rs.Fields(0) = username rs.Fields(1) = index rs.Update End If rs.Close con.Close

aw

rs.Open "SELECT * FROM MixColorActivity where UserName = '" & username & "'", con, adOpenKeyset, adLockOptimistic

on

If (activity = "patternactivity") Then

oldpos = pos pos = InStr(pos + 1, strData, ":") username = Mid(strData, oldpos + 1, pos - oldpos - 1) oldpos = pos pos = InStr(pos + 1, strData, ":") x1 = Mid(strData, oldpos + 1, pos - oldpos - 1)

191

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

oldpos = pos pos = InStr(pos + 1, strData, ":") X = Mid(strData, oldpos + 1, pos - oldpos - 1)

ar ta .c

Y = Right(strData, Len(strData) - pos)

om

oldpos = pos pos = InStr(pos + 1, strData, ":") y1 = Mid(strData, oldpos + 1, pos - oldpos - 1)

on

lin e

End Sub

w

at io n

Pu bl ic

w

End If

w

rs.Close con.Close

.v id y

rs.AddNew rs.Fields(0) = username rs.Fields(1) = x1 rs.Fields(2) = y1 rs.Fields(3) = X rs.Fields(4) = Y rs.Update

aw

rs.Open "SELECT * FROM PatternActivity", con, adOpenKeyset, adLockOptimistic

192

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

Business Tier Logic Implementation of RSA Algorithm in Java using BigInteger class Generating Public Key / Private Key Pair

ar ta .c

om

GenerateKey.java import java.math.*; import java.util.*; import java.sql.*; import java.util.Scanner; public class GenerateKey{

at io n

aw

public static void main(String[] args) throws Exception {

w

Pu bl ic

.v id y

BigInteger p = BigInteger.probablePrime(5, new Random()); Scanner sc=new Scanner(System.in); System.out.print("Enter User Name : "); String username=sc.nextLine(); System.out.println(p); BigInteger q = BigInteger.probablePrime(5, new Random()); System.out.println(q);

w

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:key","","");

lin e

w

PreparedStatement ps=con.prepareStatement("DELETE FROM key WHERE UserName = ?"); ps.setString(1,username); ps.executeUpdate();

on

ps=con.prepareStatement("INSERT INTO key VALUES(?,?,?)"); ps.setString(1,username); ps.setInt(2,p.intValue()); ps.setInt(3,q.intValue()); ps.executeUpdate(); ps.close(); con.close(); BigInteger one=new BigInteger("1"); BigInteger n=p.multiply(q); 193

IMPLEMENTATION OF SOME SELECTED SOFT COMPUTING TECHNIQUES FOR AN ACTIVITY BASED AUTHENTICATION IN A DISTRIBUTED ENVIRONMENT

om

BigInteger p1=p.subtract(one); BigInteger q1=q.subtract(one); BigInteger pn=p1.multiply(q1);

ar ta .c

System.out.println("n : " + n); System.out.println("pn : " + pn);

at io n

int ipn=pn.intValue(); int i; boolean flag; int arr[]=new int[500]; int count=0;

aw

//Find prime numbers less than pn

} }

lin e

on

w

w

w

Pu bl ic

.v id y

for (i=3;i