0% found this document useful (0 votes)
9 views

Encryption-and-Decryption-Using-Genetic-Algorithm-Operations-and-Pseudorandom-Number

The paper presents a cryptographic method using genetic algorithms for data encryption and decryption, focusing on the integrity and confidentiality of data. It employs genetic operations such as crossover and mutation along with pseudorandom number generation to enhance security. The proposed algorithm has been tested on various data types, demonstrating its effectiveness in protecting sensitive information.

Uploaded by

kanupriya
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Encryption-and-Decryption-Using-Genetic-Algorithm-Operations-and-Pseudorandom-Number

The paper presents a cryptographic method using genetic algorithms for data encryption and decryption, focusing on the integrity and confidentiality of data. It employs genetic operations such as crossover and mutation along with pseudorandom number generation to enhance security. The proposed algorithm has been tested on various data types, demonstrating its effectiveness in protecting sensitive information.

Uploaded by

kanupriya
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

IJCSN - International Journal of Computer Science and Network, Volume 6, Issue 3, June 2017

ISSN (Online) : 2277-5420


www.IJCSN.org
Impact Factor: 1.5

Encryption and Decryption Using Genetic


Algorithm Operations and Pseudorandom Number
1
P Srikanth; 2Abhinav Mehta; 3 Neha Yadav; 4 Sahil Singh; 5 Shubham Singhal
1
Assistant Professor, School of Computer Science & Engineering,
University of Petroleum & Energy Studies
Dehradun, Uttarakhand-248007, India
2, 3, 4, 5
Student, Final year B. tech CSE-IT, School of Computer Science & Engineering,
University of Petroleum & Energy Studies
Dehradun, Uttarakhand-248007, India

Abstract- Data security is crucial for almost all businesses and home computer users. Client information, payment information,
personal files, bank account details etc. are very important and hard to replace. It is potentially dangerous and can grow into a threat if it
falls in the wrong hands; to protect the data encryption is one of the most widely used techniques. This paper deals with the integrity and
confidentiality of data, which is transmitted through different mediums. Genetic algorithms (GAs) have many functions, in this paper we
use the genetic algorithm operation such as crossover and mutation functions, genetic algorithm concepts with pseudorandom function
are being used to encrypt and decrypt data. The encryption process is applied over a binary file therefore the algorithm can be applied
over any type of data.

Keywords - Security, Integrity, Confidentiality, Crossover, Mutation, Pseudorandom Sequence

1. Introduction 1.1. Crossover:

n today’s world providing security to the data is one of The process in which two chromosomes or two attributes

I
the most concerned issue; there has been a huge loss are taken and a resultant chromosome(new) is formed by
of data through illegal access therefore, providing taking some part of first chromosome and the rest by
security is priority these days. To protect the second chromosome.
important information from hackers or against illegal
access and modifications, cryptographic schemes are There are three types of crossover operation in genetic
needed. Cryptographic schemes are of two types: algorithm.
symmetric and asymmetric cryptography. The symmetric
cryptographyis the one which uses the same key for A.Single point crossover:the selected chromosome is
encryption and decryption[1,2,3].In asymmetrical broken into half and the new chromosome is formed by
cryptography two keys are used, one for encryption(known interchanging or swapping the half of the selected two
as public key) and the other for decryption(known as the chromosomes.
private key). B. Two-point crossover: the selected chromosome is
divided into three parts by taking two pointsand then one
The genetic algorithm is a search algorithm which is based parts of each chromosomes are swapped to form new
on the mechanics of natural selection and natural genetics. chromosome.
The set of operators usually consists of mutation, C. Multi point crossover: the selected chromosome is
crossover and selection[3,4]. divided into ‘n’ number of parts and then the swapping is
done in order to form new or resultant chromosomes[6].
Genetic algorithms contain operations which are bio-
inspired operators such 1.2. Mutation
as mutation, crossover and selection. They are used to
optimize and search problems by generating high-quality Mutation is a genetic operation which is similar to
solutions. In this paper crossover and mutation operation biological mutation and is used to create genetic diversity
are used[5]. of its one generation from its successive generation.

455

Copyright (c) 2017 International Journal of Computer Science and Network. All Rights Reserved.
IJCSN - International Journal of Computer Science and Network, Volume 6, Issue 3, June 2017
ISSN (Online) : 2277-5420
www.IJCSN.org
Impact Factor: 1.5

Mutation allows the algorithm to prevent the population of unauthorized access to data. This method contains the use
chromosomes from becoming similar to each other. of the operations of genetic algorithm in order to encrypt
the data.
1.3. Pseudorandom Number:
Studies tell us that Genetic algorithm for cryptography is
There are various methods through which random better than typical algorithms for cryptography. Genetic
numbers can be generated, but the most commonly used algorithms contain process/operations which are bio-
method is multiplicative congruential generator also called inspired operators such
as power residue generator. The function used to generate as mutation, crossover and selection. They are used to
pseudo random number is optimize and search problems by generating high-quality
solutions. The method discussed below generate different
Xi+1=Xi.a (modulo m) key by pseudorandom function for each block of data
according to which the crossover is applied and in order to
Where Xi is the ithpseudo random number and Xi+1 is the provide more security mutation is also applied.
succeeding pseudo random number of Xi. Here a and m are
positive integer numbers, a will be constantly multiplied Since the proposed method is being applied to the binary
by Xi and the result i.e. Xi.a will be divided by m until the data therefore it can be used to encrypt different type of
remainder becomes less than m. The first number, also file.
called as seed(X0) is the number using which we start
calculating pseudo random numbers.

To produce the maximum number of random number i.e.,


to maximize the period after which the numbers will start
repeating, the value of a, Xi and m has to be taken such that:

1. The value of random number will always be less that m,


therefore the value of m should be largest number possible
i.e., 2,147,383,648.
2. The value of a and X0 should be relatively prime to m
and since m is in power of 2 therefore the any odd number
can be taken. But it is found that the best value for a is 216
+3= 65,539[7].
Fig.1 Encryption
2. Literature Review
In today’s world data loss through the illegal access is one
of the most concerned issues. Providing security is on the
priority list therefore a performance measure produces
between traditional cryptography algorithm and genetic
algorithm in order to validate genetic algorithm methods in
the field of cryptography has been done[5].

New cryptographic algorithm should be developed by


using genetic algorithm methods and should be tested on
various file’s as well as should be validated in order to
provide security better than old or traditional cryptography
algorithm as done[3].

3. Proposed Method
The proposed method is important as in today’s world
providing security to data is on everyone’s priority list
therefore cryptography schemes are needed for preventing Fig.2 Decryption

456

Copyright (c) 2017 International Journal of Computer Science and Network. All Rights Reserved.
IJCSN - International Journal of Computer Science and Network, Volume 6, Issue 3, June 2017
ISSN (Online) : 2277-5420
www.IJCSN.org
Impact Factor: 1.5

The methods used are pseudorandom number generation, 3.3. Mutation:


crossover method, binary conversion, Mutation and ASCII In the mutation process flipping of the bits is done i.e. if
conversion. the encountered bit is 1 then it is gets converted/flipped to
0.
3.1. Crossover
3.4. Key:
The three types of the crossover used are single point, two- The number which is being generated by the
point and multipoint crossover. pseudorandom number method is stored as a key and
The crossover is chosen by modulating the pseudorandom further operations are applied to it.
number by 3.
4. Implementation

4.1. Encryption method:


1. Transform the file into ASCII form then into
corresponding binary form.
Fig. 3Single point crossover
2. Divide the binary form into the sets/blocks of 8bits. 8
is also stored as a secret key.
N= number of blocks
N= Length of binary string/8
New binary blocks of 8 bits are denoted as S1, S2,
S3….Sn.
Fig. 4Two-point crossover 3. Generate pseudorandom number for every two
selected blocks. Which will act as a key and mod it
by 3 to choose crossover and store the key?

0 for single point crossover


1 for two-point crossover
Fig.5 Multipoint crossover 2 for multipoint crossover
3.2. Pseudorandom Number: 4.Apply the crossover method on selected chromosomes or
blocks. Blocks after crossover are denoted as
Pseudo random numbers are deterministically generated C1,C2,C3….Cn.
numbers which appears to be random. Various arithmetic 5.Now apply the mutation on selected block or
approaches are used to generating pseudo-random chromosomes, mutated blocks are denoted as M1, M2,
numbers have been suggested, considered, and used on M3…….Mn.
computers in the past thirty years or so. These approaches 6. Repeat from step3 till the end of the blocks.
are usually recurrence relation and new numbers are 7. Now convert binary form into ASCII then
generated from the earlier one by applying some simple corresponding file type.
scrambling operation. A fast, and the most commonly 8.Store the result in the file.
used method (or generator) is the so-called multiplicative
congruential generator (sometimes also called as the 4.2. Decryption Process:
power-residue generator).It consists of computing
X[i+1]=X[i].a(modulo m),where X[i] is the pseudo-
1.Transform the file into ASCII form and then to binary
random number, X[i+1] is the next pseudo-
form.
random number, a is constant multiplier and, modulo m
2.Divide the binary form into the sets or block of 8 bits.
means that the number(X[i].a) is divided by m repeatedly
3.Apply mutation process on the blocks i.e. M1, M2,
till the remainder is less than m. The remainder is then set
M3….Mn.
equal to the next number X[i+1]. The process is started
4.Now mod the key of the selected blocks by 3 to apply
with an initial value X [0] called seed.
crossover method.
5.Apply the crossover method on the selected blocks C1,
C2, C3….Cn.
6.Repeat onwards step 3 till the end of the blocks.

457

Copyright (c) 2017 International Journal of Computer Science and Network. All Rights Reserved.
IJCSN - International Journal of Computer Science and Network, Volume 6, Issue 3, June 2017
ISSN (Online) : 2277-5420
www.IJCSN.org
Impact Factor: 1.5

7.Convert or transform the binary form into ASCII form 1000101110011101000101010011100 -


and then to the file form. >01110100011100010111010101100011.
8.Store the result in the file. Step 3: Read the random numbers from the key and
perform modulo function (mod 3) on the random number.
5. Experimental Result
63%3=0(Single point crossover), 23%3=2 (Uniform
crossover).
5.1. Encryption Process: Step 4: According to the output of mod function perform
crossover function on two blocks.
Step 1: File_content = upes S1=01110100 s2=01110001
Step 2: File_content is converted into binary form i.e. S3=01110101 s4=01100011
01110101011100000110010101110011.
Step 3: Divide the binary form into blocks containing 8
bits i.e.
s1=10001110 s2=10001011
s3=10011010 s4=10001100
Step 4: Generate pseudorandom number using the
pseudorandom function for two blocks. Apply modulo
operation (mod of 3) on the generated pseudorandom
number.
Step 5: After applying the mod function according to the
output the crossover function is chosen.
If output = 0 then Single point crossover is applied, if
output = 1 then two-point crossover is applied and If
output = 2 then uniform crossovers is applied.
23%3=2(Uniform crossover), 63%3=0(Single point
Step 5: After performing crossover function convert the
crossover).
blocks into original form.
Step 6: Apply the crossover method on respective blocks.
ORIGINAL FORM = upes

6. Application

We have tested the above proposed algorithm on various


text files which includes data such as plain text, numeric
values and special characters. Since the proposed
algorithm work on the binary format of the data therefore
this algorithm can be applied on various types of data such
as video, audio, text etc.

S. No. File Original Encrypted Decrypted Reference


Name Text Text Text Figure
Step 7: Apply mutation function on the generated blocks.
01110100011100010111010101100011 -
>10001011100011101000101010011100 1 this is ?????ÖÏ?? this is
Step 8: Convert the final block generated into text and that symbol ??????Ó?? symbol
will be encrypted text. language ????Ú?ßÕ language=
A.txt = ÙÚ¿ÛÞÎ- *&%$@! Figure 6
Encrypted text:???? *&%$@ Þ?»Ö?ÐÄ 12ADfa(+
5.2. Decryption Process: !12ADfa ?
(+?
Step 1: Convert the text into binary form (blocks). 2 5000393 ÏÊÏÏÎÄÈÍÏ 50003936
67 ØÏÊÏÏÏÊÎÌÍ 7
????->10001011100011101000101010011100. B.txt 5000411 ÛÏÊÏÏÏËÌÏÏ 50004113 Figure 7
Step 2: Apply mutation function on all blocks. 36 ÚÊÏÏÏÄÎÇ 6
5000403 ÈïÝ 50004030

458

Copyright (c) 2017 International Journal of Computer Science and Network. All Rights Reserved.
IJCSN - International Journal of Computer Science and Network, Volume 6, Issue 3, June 2017
ISSN (Online) : 2277-5420
www.IJCSN.org
Impact Factor: 1.5

05 5 7. Conclusion and Future Work:


5000398 50003987
72 2
3 WE are ¨º?Þ???쫪 WE are In this paper, a cryptography algorithm for encryption and
STUDE »º³©Ï¼±¸ STUDEN decryption of data which uses the operations of genetic
NTS OF ¿Ýª»¿´¿Ü¨ TS OF
C.txt BTECH ¾?þ±º?ÞÑ BTECH Figure 8 algorithm. Encryption of binary data is successful and we
CSE ?ª¯ ¾¨ CSE IFM have satisfied our goals. Thus, we conclude that applying
IFM in in UPES operations of Genetic Algorithm to provide security to the
UPES data in a file is a feasible.

The algorithm is tested and results are reported, we have


used multiplicative congruential generator method for the
generation of pseudorandom numbers. In the future work,
same algorithm we can apply for media files like images
and video and testing it over.

Figure6shows the encrypted and decrypted text that References


contains alphanumeric and special characters.
[1] Stallings, W.,Cryptography and network security
principles and practice (5th ed.), Boston: Pearson, (2014).
[2] Deo, N., System simulation with digital computer,
Prentice Hall of India Publications, (2011).
[3] SuvajitDutta andTanumay Das, “a Cryptography
Algorithm Using the Operations of Genetic Algorithm &
Pseudo Random Sequence Generating
Functions”,International Journal of Advances in
Figure7shows the encrypted and decrypted text for Computer Science and Technology, Volume 3, (2014),
numeric values. ISSN 2320 – 2602.
[4] David E Goldberg, “Genetic algorithms in search,
optimization and machine learning”. (1989).
[5] Delman, B., “Genetic Algorithms in Cryptography”,M.S.
in Computer Engineering, Rochester Institute
ofTechnology, Rochester, New York, July(2014).
[6] Goyat, S.,“GENETIC KEY GENERATION FOR
PUBLIC KEY CRYPTOGRAPHY”, International
Journal of Soft Computing and Engineering (IJSCE),
Volume 2(3), (2012).
Figure8shows the encrypted and decrypted text that [7] Bhasin, H., Bhatia, S., “Applications of Genetic
contains alphabets. Algorithm in Machine learning”, IJSCIT, Volume 2(5),
(2011).

459

Copyright (c) 2017 International Journal of Computer Science and Network. All Rights Reserved.

You might also like