• No results found

A NEW CRYPTOGRAPHIC TECHNIQUE INVOLVING GENETIC ALGORITHM

N/A
N/A
Protected

Academic year: 2020

Share "A NEW CRYPTOGRAPHIC TECHNIQUE INVOLVING GENETIC ALGORITHM"

Copied!
5
0
0

Loading.... (view fulltext now)

Full text

(1)

4422

A NEW CRYPTOGRAPHIC TECHNIQUE

INVOLVING GENETIC ALGORITHM

Ayush Mittal

Abstract: To encrypt and decrypt a message, in this paper we establish an algorithm involving genetic algorithm (crossover and mutation technique) which is based on symmetric key cryptosystem. In this algorithm we also used additive matrix and logical operator XOR.

Key Words: Genetic Algorithm, Crossover, Mutation, Encryption, Decryption and logical operator.

————————————————————

1. INTRODUCTION:

‗Cryptography‘ means secret writing. To make the message more secure cryptography is used for altering the message. To protect the data during transmission, network security norms are necessary. Data can be accessed by unguarded computers, whenever data is transformed via the networks. Network security is very essential, to avoid data to be lost. To avoiding the tampering of data transmitted across the network, network security plays major role. When the encryption algorithm is applied, then the plain text is reformed into cipher text. Cipher text is transformed into the plain text at the receiver's site.Between the sender and receiver, a secure, effective and private communication is provided by network security. Data is sent in the encrypted form to achieve a high level of security. Decoding the key did this job. Therefore, a method based on the theory of natural selection is proposed in this paper which made the strong and almost unpredictable. For encryption and decryption, when sender and receiver shared same key, then this type of cryptography is known as symmetric key cryptography, on the other side when sender and receiver uses different key, then this type of cryptography is called asymmetric key cryptography or public key cryptography. In asymmetric key cryptography, to encrypt the message sender uses the encryption algorithm and public key. To convert the message back to plain text, receiver uses the decryption algorithm and private key [6]. A search algorithm which is based on the mechanics of natural genetics and natural selection is called genetic algorithm. Crossover and mutation are two reproduction operator involved in genetic algorithm. Parents are paired together when we apply the crossover operator. The crossover operator functions are different types. There are various types of crossover operator functions viz. one-point, two-point, uniform etc. In this paper we will used one-point or single point and two-point crossover operator functions. In the single two-point crossover technique we select a random number from 1 to n, where n is the number of chromosome. Operator is applied on any two taken chromosomes. In two point crossover operation we select two crossover points and then apply the crossover operator. Among the different generations mutation is used for maintaining genetic diversity. Mutation is such type of genetic operator that changes one or more bits in the chromosome.

______________________  Ayush Mittal, S. R. K. University, Bhopal, (M.P.)

From one generation to next generation the genetic diversity is maintained by mutation. It is same as biological mutation. After crossover, mutation is performed on the child. The population remains same after the mutation operator is applied. Mutation operation change at least one bit in each chromosome. To reflect the effect of the surrounding in natural genetic process, mutation operation is performed. On one of the binary data block, mutation operation is applied. As secret key the index number of such data block is stored. There are various types of mutation operations. Among them there are two major types' viz. Boundary mutation and Flipping of Bits. In chromosome, upper or lower block is swapped randomly under Boundary mutation, while one or more bits are converted either 1 to 0 or 0 to 1 in flipping of bits operation [4].

2. RELATED WORK:

Jhingran [1] discussed genetic algorithm applications in the field of cryptography. With the help of natural selection process Kumar [3] generate the key for stream cipher. He select the key as unique and non-repeating. To generate the key a new algorithm is proposed by Soni [5], in which pseudorandom number generator was used. Increasing efficiency, irregularity of key and less computational time are the benefits of this algorithm. By using genetic function Krishna [2] introduced a new cryptographic algorithm in which double point crossover and substitution matrix were used for enciphering the data. The work done by various researchers are very impressive. But in combination with genetic operator they used some existing cryptographic algorithm. Our motivation is to introduce a new cryptographic algorithm alongwith genetic operation, which is secure in terms of key strength and attack time and easy to implement.

3. METHODOLOGY:

To encrypt the data, in this paper we introduced new algorithm in which firstly we generate a key by choosing a random word and then generate a key matrix by using some operations. Next, data is diffused by logical operator and then genetic operators are performed on the diffused data to encrypt the data. Key generation, data diffusion and data encryption are three major steps are belonging in our proposed algorithm. In generation of text matrix and diffusion of data, genetic operators are used in both works. For crossover here we are use one-point and two-point crossover both, while bit flipping technique are used for mutation.

(2)

4423

4. ALGORITHM:

4.1 Encryption Algorithm: 1. Key Matrix Generation: Key will be of 128-512 bits.

(i) Choose random characters between A-Z and choose the block size n (say).

(ii) Find the ASCII equivalent of chosen character and arrange them into a square matrix of block size of n. (iii) Find 8-bit binary equivalent of above obtained ASCII code.

(iv) Apply the left shift operation on above binary stream by 2 bits.

(v) Find decimal equivalent of above binary stream and arrange them into a square matrix of chosen size n, call this matrix as Key Matrix (say K).

2. Text Matrix Generation:

(i) Consider the plain text or part of plain text according to chosen block size n.

(ii) Find the ASCII equivalent of characters of chosen plain text and convert them into 8-bit binary groups. Denote each 8-bit group by Bi (say), i = 1, 2, 3, ….

(iii) Apply crossover technique (as agreed by sender and receiver) on B1 and B2, B2 and B3, …Denote resulting values by Ci (say), i = 1, 2, 3, … as follows:

Bi = wwww xxxx Bj = yyyy zzzz Ci = wwww zzzz Cj = yyyy xxxx where i, j = 1, 2, 3, ….

(iv) Obtain decimal equivalent of each Ci and arrange them into a square matrix of chosen size n, call this matrix as Plain Text Matrix P (say) of chosen size n.

3. Generation of Additive Matrix:

To generate the Additive Matrix A (say), add the key matrix K and plain text matrix P i.e. A = K + P and convert each element of matrix A into their corresponding 8-bit binary equivalent, say this matrix Xi, i = 1, 2, 3, … 4. Appling Logical operator XOR:

Calculate Ki XOR Xi = Zi (say), i = 1, 2, 3, … 5. Genetic Crossover and Mutation:

(i) Divide above obtained binary bits into two segments. (ii) Appling crossover operator and Mutation function as agreed by sender and receiver.

6. Divide above binary streams into 8-bit groups and then convert each 8-bit group into their corresponding hexadecimal equivalent to get final cipher text.

4.2 Decryption Algorithm:

1. Consider the cipher text, convert it into equivalent 8-bit binary form and divide all obtained bits into two segments. 2. Apply mutation and crossover operation (as agreed by sender and receiver) respectively, then arrange them into 8-bit groups, denote each group by Zi (say), i = 1, 2, 3, … 3. Calculate Ki XOR Zi = Xi (say), i = 1, 2, 3, …, convert each Xi into corresponding decimal equivalent and arrange them in a square matrix A (say) of order n.

4. Calculate A − K = P (say) and obtain binary equivalent of each element of matrix P, to get Ci (say), i = 1, 2, 3, …

5. Apply crossover operator on C1 and C2, C2 and C3, …Denote resulting values by Bi (say), i = 1, 2, 3, … as follows:

Ci = wwww zzzz Cj = yyyy xxxx Bi = wwww xxxx Bj = yyyy zzzz where i, j = 1, 2, 3, ….

6. Convert above binary 8-bit group into corresponding decimal equivalent and then into corresponding ASCII character, we get original plain text.

ILLUSTRATION:

Encryption Steps:

1. Key Matrix Generation using left shift operation: (i) Let the input key is ENCRYPTDECRYPT (ii) Consider the block size is n = 4

(iii) The ASCII equivalent for the chosen key are: 69 78 67 82 89 80 84 68 69 67 82 89 80 84 32 32 (iv) Binary equivalent of the above ASCII code are: 01000101 01001110 01000011 01010010 01011001 01010000 01010100 01000100 01000101 01000011 01010010 01011001 01010000 01010100 00100000 00100000

(v) Now apply the left shift operation by 2 bits on the above binary streams, we get as follows:

K1 = 00010100, K2 = 00111000, K3 = 00001100, K4 = 01001000, K5 = 01100100, K6 = 01000000, K7 = 01010000, K8 = 00010000, K9 = 00010100, K10 = 00001100, K11 = 01001000, K12 = 01100100, K13 = 01000000, K14 = 01010000, K15 = 10000000, K16= 10000000

(vi) Obtain decimal equivalent of the above binary sets and arrange them in a matrix, call this matrix as Key Matrix (say K), therefore: [ ]

2. Generation of Text Matrix using Crossover operator: (i) Consider the plain text is GENETICALGORITHM (ii) Let the block size is n = 4

(iii) The ASCII equivalent for the chosen plain text are: 71 69 78 69 84 73 67 65 76 71 79 82 73 84 72 77 (iv) Binary equivalent of the above ASCII code are: 01000111010001010100111001000101010101000100100 10100001101000001010011000100011101001111010100 1001001001010101000100100001001101

Length is = 128

(v) Divide the above binary string into 16 blocks with 8-bit/block, denote each 8-bit group by Bi (say), i = 1, 2, 3, …. Choose 8 is the first key value. Therefore

B1 = 01000111, B2 = 01000101, B3 = 01001110, B4 = 01000101, B5 = 01010100, B6 = 01001001, B7 = 01000011, B8 = 01000001, B9 = 01001100, B10 = 01000111, B11 = 01001111, B12 = 01010010, B13 = 01001001, B14 = 01010100, B15 = 01001000, B16 = 01001101

(vi) Now apply the single point crossover operator on B1 and B2, B3 and B4, B5 and B6, B7 and B8, B9 and B10, B11 and B12, B13 and B14, B15 and B16. We get another 16 blocks viz.

(3)

4424 C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16 as follows: B1 = 0100 0111 B2 = 0100 0101 C1 = 0100 0101 C2 = 0100 0111 B3 = 0100 1110 B4 = 0100 0101 C3 = 0100 0101 C4 = 0100 1110 B5 = 0101 0100 B6 = 0100 1001 C5 = 0101 1001 C6 = 0100 0100 B7 = 0100 0011 B8 = 0100 0001 C7 = 0100 0001 C8 = 0100 0011 B9 = 0100 1100 B10 = 0100 0111 C9 = 0100 0111 C10 = 0100 1100 B11 = 0100 1111 B12 = 0101 0010 C11 = 0100 0010 C12 = 0101 1111 B13 = 0100 1001 B14 = 0101 0100 C13 = 0100 0100 C14 = 0101 1001 B15 = 0100 1000 B16 = 0100 1101 C15 = 0100 1101 C16 = 0100 1000 Therefore C1 = 01000101, C2 = 01000111, C3 = 01000101, C4 = 01001110, C5 = 01011001, C6 = 01000100, C7 = 01000001, C8 = 01000011, C9 = 01000111, C10 = 01001100, C11 = 01000010, C12 = 01011111, C13 = 01000100, C14 = 01011001, C15 = 01001101, C16 = 01001000

(vii) Obtain decimal equivalent of the above binary sets and arrange them in a matrix, call this matrix as plane text matrix (say P), therefore:

[ ]

3. Generation of Additive Matrix:

To generate additive matrix A (say) we add the key matrix K with text matrix P, we get as follows:

A = K + P = [ ] [ ] = [ ]

4. Appling Logical operator XOR:

(i) Convert each element of matrix A into their corresponding binary equivalent as follows, say them X1,

X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15, X16 respectively: X1 = 01011001, X2 = 01111111, X3 = 01010001, X4 = 10010110, X5 = 10111101, X6 = 10000100, X7 = 10010001, X8 = 01010011, X9 = 01011011, X10 = 01011000, X11 = 10001010, X12 = 11000011, X13 = 10000100, X14 = 10101001, X15 = 11001101, X16 = 11001000 (ii) Calculate Zi = Ki XOR Xi, i = 1, 2, 3, …, 16, we get as follows: Z1 = 01001101, Z2 = 01000111, Z3 = 01011101, Z4 = 11011110, Z5 = 11011001, Z6 = 11000100, Z7 = 11000001, Z8 = 01000011, Z9 = 01001111, Z10 = 01010100, Z11 = 11000010, Z12 = 10100111, Z13 = 11000100, Z14 = 11111001, Z15 = 01001101, Z16 = 01001000

(iii) Convert each 8-bit group into their corresponding hexadecimal equivalent, to get intermediate cipher as follows:

4D 47 5D DE D9 C4 C1 43 4F 54 C2 A7 C4 F9 4D 48 5. Genetic Crossover and Mutation:

(i) Divide the above binary streams into two segments as follows:

01001101010001110101110111011110110110011100010 01100000101000011

01001111010101001100001010100111110001001111100 10100110101001000

(ii) On the above input, apply the two point (at 25th and 40th points) crossover, we get

01001101010001110101110110100111110001001100010 01100000101000011

01001111010101001100001011011110110110011111100 10100110101001000

(iii) Now apply the mutation function. Here we use the flipping of bits technique i.e. a '1' would mutate into '0' and vice versa, therefore we get

10110010101110001010001001011000001110110011101 10011111010111100

10110000101010110011110100100001001001100000011 01011001010110111

6. Divide the above binary streams into group of 8-bits and convert each 8-bit group into their corresponding hexadecimal equivalent, we get as follows:

10110010 10111000 10100010 01011000 00111011 00111011 00111110 10111100 10110000 10101011 00111101 00100001 00100110 00000110 10110010 10110111 and B2 B8 A2 58 3B 3B 3E BC B0 AB 3D 21 26 6 B2 B7 which is the final cipher.

Decryption Seps: 1. Consider the cipher text

E3 C7 EB 63 3F 3F 2F E7 E3 EB 37 27 1B F 7F 7F 2. Convert it into 8 bit binary equivalent and divide the binary streams into two segments, we get

10110010101110001010001001011000001110110011101 10011111010111100

10110000101010110011110100100001001001100000011 01011001010110111

(4)

4425 3. Apply mutation operation. Here we use the flipping of bits

technique i.e. a '1' would mutate into '0' and vice versa, therefore we get

01001101010001110101110110100111110001001100010 01100000101000011

01001111010101001100001011011110110110011111100 10100110101001000

4. Applying the two point (at 25th and 40th points) crossover technique, we get

01001101010001110101110111011110110110011100010 01100000101000011

01001111010101001100001010100111110001001111100 10100110101001000

5. Now converting the above binary stream into 8-bit group, we get Zi (say), i = 1, 2, 3, … as follows:

Z1 = 01001101, Z2 = 01000111, Z3 = 01011101, Z4 = 11011110, Z5 = 11011001, Z6 = 11000100, Z7 = 11000001, Z8 = 01000011, Z9 = 01001111, Z10 = 01010100, Z11 = 11000010, Z12 = 10100111, Z13 = 11000100, Z14 = 11111001, Z15 = 01001101, Z16 = 01001000 6. Now calculate Xi = Ki XOR Zi, i = 1, 2, 3, …, 16, we get as follows: X1 = 01011001, X2 = 01111111, X3 = 01010001, X4 = 10010110, X5 = 10111101, X6 = 10000100, X7 = 10010001, X8 = 01010011, X9 = 01011011, X10 = 01011000, X11 = 10001010, X12 = 11000011, X13 = 10000100, X14 = 10101001, X15 = 11001101, X16 = 11001000

7. Now convert above 8-bit binary group into their corresponding decimal equivalent and arrange them in a square matrix of order 4, we get

[ ] 8. Now calculate P = A − K = [ ] [ ] [ ]

9. Obtain 8-bit binary equivalent of the numeric value of each element of above matrix P, call them Ci, i = 1, 2, 3, …, 16, we get as follows: C1 = 01000101, C2 = 01000111, C3 = 01000101, C4 = 01001110, C5 = 01011001, C6 = 01000100, C7 = 01000001, C8 = 01000011, C9 = 01000111, C10 = 01001100, C11 = 01000010, C12 = 01011111, C13 = 01000100, C14 = 01011001, C15 = 01001101, C16 = 01001000

10. Now apply the single point crossover technique on C1 and C2, C3 and C4, C5 and C6, C7 and C8, C9 and C10, C11 and C12, C13 and C14, C15 and C16. We get another 16 blocks viz. B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B12, B13, B14, B15, B16 as follows: C1 = 0100 0101 C2 = 0100 0111 B1 = 0100 0111 B2 = 0100 0101 C3 = 0100 0101 C4 = 0100 1110 B3 = 0100 1110 B4 = 0100 0101 C5 = 0101 1001 C6 = 0100 0100 B5 = 0101 0100 B6 = 0100 1001 C7 = 0100 0001 C8 = 0100 0011 B7 = 0100 0011 B8 = 0100 0001 C9 = 0100 0111 C10 = 0100 1100 B9 = 0100 1100 B10 = 0100 0111 C11 = 0100 0010 C12 = 0101 1111 B11 = 0100 1111 B12 = 0101 0010 C13 = 0100 0100 C14 = 0101 1001 B13 = 0100 1001 B14 = 0101 0100 C15 = 0100 1101 C16 = 0100 1000 B15 = 0100 1000 B16 = 0100 1101 Therefore B1 = 01000111, B2 = 01000101, B3 = 01001110, B4 = 01000101, B5 = 01010100, B6 = 01001001, B7 = 01000011, B8 = 01000001, B9 = 01001100, B10 = 01000111, B11 = 01001111, B12 = 01010010, B13 = 01001001, B14 = 01010100, B15 = 01001000, B16 = 01001101

11. Convert the above binary 8-bit group into their corresponding decimal equivalent, we get

71 69 78 69 84 73 67 65 76 71 79 82 73 84 72 77 12. Convert the above numeric value into corresponding ASCII character; we get original plain text i.e. GENETICALGORITHM

5. RESULT AND DISCUSSION:

Since proposed encryption process is applied on binary data, therefore to encrypt any format of data viz. text, sound, image and many data, this method can be applicable, because above formats of data are stored in the computer in binary form. Since binary data is divided into blocks, therefore above discussed encryption and decryption process can be carried out.On comparison the proposed algorithm and another algorithm which are introduced by various researchers time to time, it is find that proposed algorithm is stronger from them, because here we used multistep enciphering and obtain two different intermediate cipher one after another. Therefore proposed algorithm is most powerful and difficult to break the plain text by any attacker, since here we use a random text with ASCII code and left shift operation to generate the key, also for enciphering we use XOR operation and genetic algorithm.

6. CONCLUSION:

For solution of some groups of problems, the genetic algorithm can be very helpful. Application in cryptography is

(5)

4426 one of them. Genetic algorithm is used in crypto-analysis

usually, but for training and designing of artificial neural networks it can be also used. Due to efficient search of the whole model space, in order to find global minimum, genetic algorithm is used in crypto-analysis. There is no need to partial derivative and no need to linearization of the problem. Due to this ability designing of artificial neural network or suitability of training are increased. In this paper we establish an algorithm to encrypting and decrypting the data. Here we used genetic algorithm (crossover and mutation technique) additive matrix and logical operator XOR and obtain multiple intermediate cipher, which provides high level security to transmitted data. Frequently binary and decimal conversion increased the strength of algorithm. This method can be applied in future for encrypting the image.

REFERENCES

[1] Jhingran R. and Prof A.: ―A Study on Cryptography using Genetic Algorithm,‖ Int. J. Comput. Appl., vol. 118(20), 2015, pp. 975–8887.

[2] Krishna G. M. and Lakshmi V.: ―A Proposed Method for Cryptographic Technique by Using Genetic Function‖, Int. J. Emerg. Eng. Res. Technol., 2015, pp. 1–7.

[3] Kumar A. and Chatterjee K.: ―An efficient stream cipher using Genetic Algorithm,‖ Int. Conf. Wirel. Commun. Signal Process, 2016 pp. 2322–2326. [4] Sivanandan, S. N., Deepa, S. N.: Introduction to

Genetic Algorithm, Springer Verlag Berlin Heidelberg, 2008.

[5] Soni A. and Agrawal S.: ―Using Genetic Algorithm for Symmetric key Generation in Image Encryption,‖ Int. J. Adv. Res. Comput. Eng. Technology, vol. 1(10), 2012, pp. 2278–1323. [6] Stallings William: Cryptography and Network

Security Principles and Practices, Prentice Hall, 2005.

References

Related documents

(If bandages are used in place of boots, athletes are not required to remove the bandages in the warm-up arena.) This procedure is compulsory for competitions for which boot

The solutions to this controversy are extremely varied and include: Regaining management as a profession (Bennis and O'Toole, 2005; Khurana, 2007), developing a critical lens

Credits: 5 ECTS credits (The exam is 20 ECTS credits) Semester: Autumn - Bachelor in Business and adminitration... Individual written examination,

Therefore the informativeness of the report issued by the incumbent auditor is higher than that issued by the outside auditor, because the investors perceive that the rm's control

The findings of the current study have informed that three out of five Tb/HIV co-infected patients delayed for HIV care and delayed presenters were more likely to be tobacco

Where COST OF TAIL BITING includes the same elements as above, but as at a higher level, ie.: 2% * (TBpain + TBinf + TBincome_reduction + TBworkload); and BENEFITS OF NO TAIL

CO: cardiac output; CRT: capillary refill time; RCT: randomized controlled trial; PPTR: peripheral perfusion‑targeted resuscitation; LTR: lactate‑targeted resuscitation;

Special technical information sources Australian Horticultural Corporation AHC Level 14 100 William Street SYDNEY NSW 2011 Ph: 02 9357 7000; Fax: 02 9356 3661 AHC provides a range