[IEEE Electronic Systems Technology (Wireless VITAE) - Chennai, India (2011.02.28-2011.03.3)] 2011...

5

Click here to load reader

Transcript of [IEEE Electronic Systems Technology (Wireless VITAE) - Chennai, India (2011.02.28-2011.03.3)] 2011...

Page 1: [IEEE Electronic Systems Technology (Wireless VITAE) - Chennai, India (2011.02.28-2011.03.3)] 2011 2nd International Conference on Wireless Communication, Vehicular Technology, Information

An Adaptive Neural Network Guided Random Block Length Based Cryptosystem for Online Wireless Communication (ANNRBLC)

J.K.Mandal

Professor, Department of Computer Science & Engineering, University of Kalyani, Kalyani-741235,

Nadia, West Bengal, India E-mail: [email protected]

Arindam Sarkar

Student, M.Tech (C.S.E) Department of Computer Science & Engineering

University of Kalyani, Kalyani-741235, Nadia, West Bengal, India

E-mail: [email protected] Abstract—In this paper an Adaptive Neural Network guided Random Block Length based Cryptosystem (ANNRBLC) has been proposed for online transmission of data/information through wireless communication. Both communicating networks receive an identical input vector, generate an output bit, networks are trained based on the bit, and as a result of this dynamics through adaptive weight vectors the networks synchronize to an identical time dependent weight vectors. This phenomenon is used to form a secured secret-key through a public channel. Three sub keys are generated during the process to encrypt string of random length (multiple of 64 blocks). Length of sub key 1, sub key 2, sub key 3 is 128 bit, 192 bit, and 256 bit respectively. Identical weight vectors are used to generate first sub key of 128 bit length. Subsequent sub keys are generated as intermediate steps of the technique using neural cryptosystem. A session key based transmission has also been proposed using 161bit key format of 14 different segments [7,8]. Parametric tests are done and results are compared in terms of Chi-Square test, response time in transmission with some existing classical techniques, which shows comparable results for the proposed system.

Keywords – Adaptive Neural Network guided Random Block Length Based Cryptosystem (ANNRBLC), weight vector, input vector, sub key, session key, chaining, wrapping technique.

I. INTRODUCTION Now a days, various techniques are available to protect

data and information from eavesdroppers [1,2,7,8,10]. Various security challenges in wireless sensor networks are also analysed and various protocols are available[11,12]. Every algorithm has its own advantages and disadvantages. For Example in DES, AES algorithms [9] the cipher block length is rigid. RSBP [10] permit only one cipher block encoding. In the CTSCCT [2] use of bit level operation was less than the RBCMCCC except the position of wrapping technique. In RBCMCCC [1] a user input key (minimum length of eight byte) and a set of randomly generated session keys are used to encrypt a source block [2]. But this key generation method may not obtain full security because sub keys generation procedure of this algorithm entirely depend upon nature of user input key and user may input less strength key. Again this key has to be exchanged through public/private channel and may be stolen by intruder at the time of swap over public channel. So, it is indispensable to form a new algorithm technique for escalating security issue. In this paper an Adaptive Neural Network guided Random Block Length based Cryptosystem (ANNRBLC) has been proposed for online transmission of data/information. The organization of this paper as follows. Section II of the paper

deals with the proposed synchronization and key generation technique and also random block length based cryptographic technique using two sub sections. Session key based encryption technique is discussed in section III. Results are presented in section IV. Analysis against various aspects of the technique has been presented in section V. Conclusions are drawn in section VI and that of references at end.

II. THE TECHNIQUE In ANNRBLC neural network is used to generate random

synchronize weight vectors to form the sub keys of RBCMCPCC technique. These sub keys and randomly generated session keys are used to encrypt a source block. A 256 bit block is encoded in three steps by using three different onetime sub-keys (128 bit, 192 bit and 256 bit). The intermediate cipher text blocks are passed through the cipher block chaining if the number of bits in the source block are 512 or more. In the final step the wrapping technique operates on the intermediate block of random length [1].

Section II.A deals with key generation technique and that of section II.B describes the encryption technique with the help of RBCMCCC algorithm. Sub keys generation technique has been prescribed in section II.C. Section II.D deals with wrapping technique.

II.A. Neural synchronization and secret key generationAt the beginning of the transmission a neural network

based secret key generation is performed between receiver and sender. The same may be done through the private channel or it may be done in some other time also, which is absolutely free from encryption. Figure 1 shows the tree based generation process using random number of nodes (neurons) and the corresponding algorithm is given in section II.A.1

Figure 1. A tree parity machine with K=3 and N=4

II.A.1. Algorithm

Input: - Random weights, input vectors for both neural networks. Output: - Secret key through synchronization of input and output neurons as vectors. Method:- Each party (A and B) uses its own (same) tree

978-1-4577-0787-2/11/$26.00 ©2011 IEEE

Page 2: [IEEE Electronic Systems Technology (Wireless VITAE) - Chennai, India (2011.02.28-2011.03.3)] 2011 2nd International Conference on Wireless Communication, Vehicular Technology, Information

parity machine. Neural network parameters: K, N, L values will be identical for both parties and synchronization of the tree parity machines is achieved. Parameters:- K - The number of hidden neurons. N - The number of input neurons connected to each hidden neuron, total (K*N) input neurons. L - The maximum value for weight {-L..+L}

Step 1. Initialize random weight values Step 2. Repeat step 3 to 6 until the full synchronization is achieved, using hebbian-learning rules (eq. 3). Step 3. Generate random input vector X. Inputs are generated by a third party (say the server) or one of the communicating parties (fig. 2)

Figure 2. Neural network for machine A and machine B with K=4 and N=2

Step 4. Compute the values of the hidden neurons

N

jijiji xw

1sgn

10

1sgn x

ififif

.0,0,0

xxx

(1)

Step 5. Compute the value of the output neuron

K

i

N

jijij xw

1 1sgn

(2) Step 6. Compare the output values of both tree parity machines by exchanging between the networks

Outputs are not same: Go to step 3

if Output (A) Output (B)

else

if Output (A) = Output (B) then one of the suitable learning rule is applied to the weights. Update the weights only if the final output values of the neural machines are equivalent. In this paper we have used hebbian-learning rule for synchronization (eq. 3).

BAiiii xww i

(3) When synchronization is finally occurred, the synaptic

weights are same for both the networks. In each step there may be three possibilities:

1. Output (A) Output (B): None of the parties updates its weights. 2. Output (A) = Output (B) = Output (E): All the three parties update weights in their tree parity machines. 3. Output (A) = Output (B) Output (E): Parties A and B update their tree parity machines, but the attacker cannot do that. Because of this circumstance his learning is slower than the synchronization of parties A and B. The synchronization of two parties is faster than learning of an attacker.

II.B. Encryption Technique 1) 128 bits are taken from the leftmost position of the

plain text and fed into an 4×4 matrix in row major order.

2) The first element of the second row is raised three places in the ASCII series and the other three elements of this row are lowered one place of the ASCII series. The first two elements of the third row are raised by two places and the other two elements of this row are lowered by two places in the ASCII series. The first three elements of the fourth row are raised by three steps in the ASCII series and the other three elements of this row are lowered by one step in the ASCII series.

3) Now matrix is divided into two triangles by its diagonal connecting left to right corner of the 4×4 matrix. Overlapping elements are operated through XOR operation, and a new triangular portion is generated. One suitable triangular portion before the folding operation will be kept together with the generated triangle and these two triangular portions generate a new 4×4 matrix.

4) The 16 characters from the preceding step are now converted into corresponding ASCII values and the resultant ASCII values are converted into their corresponding 8 bit binary values to generate a 128 bit number, which is XORed with one time sub-key. These 128 bits are converted into 16 characters by selecting 8 bits from MSB position. 8 characters from the next leftmost position of the remaining plain text are concatenated with the intermediate output, which produces a string of 24 characters/192 bits, which are arranged in a 2×4×3 matrix. For every plane of the matrix the first element of first row is placed on a corner point of a triangle and the second element of the first row and first two elements of second row are placed to a side to the opposite of the corner point of the triangle. This is called “Triangle one”. For other four elements, the last element of second row is placed on a corner point of a triangle and the other three elements are placed to the opposite side in the same way. This is called “Triangle two”. The elements of the two triangles are now overlapped by XOR operation according to their positions to generate “Triangle one” with new elements. The same rule is applicable for other two planes. Finally, the

Weight Weight

TPM of Party A TPM of Party B Hidden layer

Input layer

Output layer

Input layer

Output layer

Hidden layer

978-1-4577-0787-2/11/$26.00 ©2011 IEEE

Page 3: [IEEE Electronic Systems Technology (Wireless VITAE) - Chennai, India (2011.02.28-2011.03.3)] 2011 2nd International Conference on Wireless Communication, Vehicular Technology, Information

set of all “Triangle one” are kept together followed by the set of all “Triangle two”.

5) The 24 characters/192 bits from the preceding step are XORed with 192 bit one time key to generate an intermediate 192bits/24 characters.

6) 8 characters from the next leftmost position of the remaining plain text are concatenated with the intermediate output from the preceding step to produce a string of 32 characters/256 bits. These 32 characters are now arranged in a 2×4×2×2 matrix. The first element of first row in every plane of the four dimensional matrix is raised by three steps in the ASCII series and other three elements are lowered by one step in the ASCII series. The first two elements of the second row in every plane of every fourth dimension are raised by two steps and other elements are lowered 2 steps of the ASCII series. Now the position of the first and second cubes in the fourth dimension is interchanged. The 32 characters from the output of the previous step are converted into binary string, which will produce a 256 bit number. These 256 bit numbers are XORed with its own one time sub-key to generate a 256 bit intermediate stream.

7) The steps 1 to 6 are repeated for all source blocks to obtain the intermediate stream.

8) If the numbers of characters in the plain text are 64bytes/512 bits or more, then every 256 bit intermediate text block of the Step 7 are XORed with previous 256 bit intermediate text block except the first block.

9) From the generated intermediate text of the preceding step, a block of bits is selected randomly from MSB position. This block is passed through wrapping technique, which continues up to the end of the stream to generate the final cipher [1].

II.C. Sub-Key Generation Three sub-keys (sub-key 1, sub-key 2 and sub-key 3 respectively) of lengths 128 bit, 192 bit, and 256 bit respectively are needed to encrypt an 32 character/256 bit string [1].

II.C.1. Sub-Key 1 1) In ANNRBLC neural network is use to generate

random synchronize weight vectors for forming the sub keys of RBCMCPCC technique. Each party (A and B) uses its own tree parity machine. Neural network parameters: k, n, l values are identical for both parties. Synchronization of the tree parity machines is achieved and identical weights are generated for both machine. Then a random function is used to select arbitrarily 8 weight vectors for forming the 8 character initial key.

2) An XOR operation is performed between binary equivalent of 1st , 2nd,...., 8th character of the initial key (8 characters weight vector) and binary equivalent of the successive generated random number, which will produce an 64 bits/8 characters .

3) 8 bits are taken from MSB position and divided into two equal parts. After obtaining the decimal equivalent of the

4 bit number, determine whether the value is even or odd. If it is even then 0 is stored as code value, else 1 is stored as code value. For the other 4 bit blocks, the same operation is performed. Now, the decimal value of the 4 bit number is represented according to its rank in the even or odd number series (considering 0 as the 1st even number and 1 as the first odd number). The rank is represented in binary number by maximum bits to represent a rank of a 4 bit even or odd number. A series of ‘0’ (maximum 7 in number) should be inserted as padding bits to make it a simple multiple of 8. As a result of the operation, a 16 bit number is generated. If the process is repeated for the other 56 bits by taking 8 bits from them, then the 64 bit number will become 128 bit number. The 128 bit number will act as the first sub-key. The process for converting 64bit number to 128 bit number is assigned the name “key expansion method” here.

II.C.2. Sub-Key 2 1) Using expansion permutation converts sub key 1 into a

string of 12 characters. For that, 8 characters should be divided into two equal parts. For the beginning character of the first block and ending character of the last block, first character will go to the last position and the last will go to the first. Beginning characters of the other blocks will go to the last position of the previous block, and the last character will go to the first position of the next block.

2) The 12 characters are now converted into corresponding ASCII value followed by 8 bit binary, which will generate a 96 bit number and the key expansion method is applied to produce a 192 bit number.

II.C.3. Sub-Key 3 1) Sub-key 3 is generated from sub key 2, where

expansion permutation is used to generate 18 characters and out of 18 characters, 16 are selected from the leftmost position and converted into corresponding 8 bit binary, which will produce a 128 bit stream.

2) Key expansion method is applied to the 128 bit number of the preceding step, which produces a 256 bit number, and it will be used as the sub-key 3. In this section the results of implementation of the proposed technique has been presented in terms of encryption decryption time, chi-square test, frequency distribution of source stream and encrypted stream along with the study of cycle formation in terms of block length. The results are also compared with existing RSA technique. II.D. Wrapping Technique

1) The bits are selected from the MSB position towards LSB of the intermediate stream, where the block length of the selected bits is random in nature.

2) The four bits from the MSB position towards LSB are taken from the previously selected block. It is to be determined whether the selected 4 bit number is prime or not. If it is prime, then 1 is stored as code value, if not then 0 is stored as code value. The same procedure is repeated for the rest of the bits in the target block.

978-1-4577-0787-2/11/$26.00 ©2011 IEEE

Page 4: [IEEE Electronic Systems Technology (Wireless VITAE) - Chennai, India (2011.02.28-2011.03.3)] 2011 2nd International Conference on Wireless Communication, Vehicular Technology, Information

Encr

yptio

n &

dec

rypt

ion t

ime

3) Again, the four bits are selected from the MSB position and converted into decimal number to determine whether the value is prime or not. The rank of the decimal number (as rank value) should be represented in binary (by the maximum bits to represent a rank of an 4 bit prime or nonprime number accordingly). The rank values are stored in descending order (viz., the rank value of the first 4 bits is stored in the last position). If the total number of bits in the rank value and code value are not a simple multiple of 8, then ‘0’ is stored as the padding bits in between code value and rank value. The step 1 to step 3 are repeated for all the other remaining bits.

II.E. Decryption Technique

Same process as described for encryption is followed in reverse order to decrypt the stream, block wise at the destination node of the network.

III. GENERATION OF SESSION KEY To ensure secured encryption of the proposed technique

with varying size of blocks, a 161 bit key format consisting of 14 different segment has been proposed here [7,8]. For the segment of rank the R, there can exist a maximum of N=218-R blocks, each of unique size of S=218-R, R starting from 1 and moving till 14.Full input is divided into blocks of various sizes based on the session key.

Segment with R=1 formed with the first maximum 131072 blocks, each of size 131072 bits

Segment with R=2 formed with the first maximum 65536 blocks, each of size 65536 bits

Segment with R=3,4,5,----,14 formed with the next maximum 32768, 16384,8192,----,16 blocks, each of size 32768, 16384,8192,-------,16 bits respectively.

Figure 3. 161 bit key format

With such a structure, the key space becomes 147 bits long and a stream of the maximum size 2.6 GB can be encrypted using the proposed technique. The key structure is represented in Figure 3. This session key may be used during each session as a random manner to enhance the security of wireless communication.

IV. RESULTS In this section the results of implementation of the

proposed technique has been presented in terms of encryption decryption time, Chi-Square test, source file size vs.

encryption time along with source file size vs. encrypted file size. The results are also compared with existing RSA technique.

TABLE I. ENCRYPTION/DECRYPTION TIME VS. FILE SIZE Encryption Time (s) Decryption Time (s)

Source Size

(bytes)

ANNRBLC RBCMCPCC

Encrypted Size

(bytes)

ANNRBLC RBCMCPCC

250 0 1 0 08 297 0 08 0 04 500 0 34 0 32 600 0 16 0 11 750 0 23 0 2 890 0 17 0 13 1000 0 38 0 34 1189 0 3 0 24 1250 0 51 0 49 1484 0 39 0 35 1500 0 8 0 77 1741 0 51 0 46 1750 0 53 0 49 2034 0 53 0 48 2000 0 59 0 56 2326 0 61 0 56 2250 0 74 0 68 2622 0 71 0 66 2500 0 98 0 92 2921 0 91 0 84 Table I shows encryption and decryption time with

respect to the source and encrypted size respectively. It is also observed the alternation of the size on encryption.

Figure 4. Source size vs. encryption time & decryption time

In figure 4 stream size is represented along X axis and encryption / decryption time is represented along Y axis. This graph is not linear, because of different time requirement for finding appropriate random number for different block size. It is observed that the decryption time is almost linear, because there is no random number generation during decryption.

Table II shows Chi-Square value for different source stream size after applying different encryption algorithms. It is seen that the Chi-Square value of ANNRBLC is high compared to the algorithms Triple DES and CTSCCT, RBCMPCC respectively and comparable to the Chi-Square value of the RSA algorithm.

TABLE II. SOURCE SIZE VS. CHI-SQUARE VALUE

Figure 5. Source size vs. Chi-Square value

Figure 5 shows graphical representation of table II.

Stream Size

(bytes)

Chi-Square value

(TDES)

Chi-Square value

(RBCM CPCC)

Chi-Square value

(CTSCCT)

Chi- Square value

(ANNRBLC)

Chi-Square value (RSA)

1500 1228 5803 2465 0645 2426 7576 2471 0724 5623 14 2500 2948 2285 5643 4673 5067 3252 5645 3462 22638 993000 3679 0432 6757 1533 5980 5718 6757 8211 12800 355 3250 4228 2119 6994 6177 6788 3594 6994 6198 15097 773500 4242 9165 10570 6982 7408 0928 10572 4673 15284 728 4032 7385 8604 10674 8183 10382 305 10675 4982 28041 762 4500 7254 3022 11984 9297 11981 082 11984 9697 29625 89 5000 8573 584 15685 5273 15015 703 15685 5545 35291 7

Source size

1 2 3 4 5 6 7 8 9 10 11 12 13 1402468

101214161820

Segment size in bits

Key Segment

Segment size in

bits

978-1-4577-0787-2/11/$26.00 ©2011 IEEE

Page 5: [IEEE Electronic Systems Technology (Wireless VITAE) - Chennai, India (2011.02.28-2011.03.3)] 2011 2nd International Conference on Wireless Communication, Vehicular Technology, Information

Chi

-Squ

are

Val

ue

Chi

-Squ

are

Val

ue

V. ANALYSIS OF RESULT From experimental results it is clear that the proposed

technique may obtain optimal performances. Encryption time varies non-linearly with respect to the source block size whereas decryption time varies almost linearly with respect to the encrypted block size. For the proposed algorithm Chi-Square value is very high compared to some existing algorithms. In the RBCMCPCC [1] a user input key (minimum length of eight byte) and a set of arbitrarily generated session keys are used to encrypt a source block. But this key generation technique is not sustainable against attack. Because RBCMCPCC key potency thoroughly depend upon strengthness of user input key. A user input key has to transmit over the public channel all the way to the receiver for performing the decryption procedure. So there is a likelihood of attack at the time of key exchange. To defeat this insecure secret key generation technique a neural network based secret key generation technique has been proposed.

The security issue of RBCMCPCC algorithm can be improved by using neural secret sub key generation technique. In this case, the two partners A and B do not have to share a common secret but use their indistinguishable weights as a secret key needed for encryption. The fundamental conception of neural network based key exchange protocol [3,4,5,6] focuses mostly on two key attributes of neural networks. Firstly, two nodes coupled over a public channel will synchronize even though each individual network exhibits disorganized behavior. Secondly, an outside network, even if identical to the two communicating networks, will find it exceptionally difficult to synchronize with those parties, those parties are communicating over a public network. An attacker E who knows all the particulars of the algorithm and records through this channel finds it thorny to synchronize with the parties, and hence to calculate the common secret key. Synchronization by mutual learning (A and B) is much quicker than learning by listening (E) [3].

For usual cryptographic systems, we can improve the safety of the protocol by increasing of the key length. In the case of neural cryptography, we improve it by increasing the synaptic depth L of the neural networks. For a brute force attack using K hidden neurons, K*N input neurons and boundary of weights L, gives (2L+1)KN possibilities. For example, the configuration K = 3,L = 3 and N = 100 gives us 3*10253 key possibilities, making the attack unfeasible with today’s computer power. E could start from all of the (2L+1)3N initial weight vectors and calculate the ones which are consistent with the input/output sequence. It has been shown, that all of these initial states move towards the same final weight vector, the key is unique. This is not true for simple perceptron the most unbeaten cryptanalysis has two

supplementary ingredients first; a group of attacker is used. Second, E makes extra training steps when A and B are quiet [3, 4, 5]. So increasing synaptic depth L of the neural networks we can make our neural network safe.

VI. CONCLUSIONS This paper presents a novel approach for generation of

secret key ANNRBLC algorithm using neural cryptography. This technique enhances the security features of the RBCMCCC algorithm by increasing of the synaptic depth L of the neural networks. In this case, the two partners A and B do not have to exchange a common secret key over a public channel but use their indistinguishable weights as a secret key needed for encryption or decryption. So likelihood of attack of ANNRBLC much lesser than the simple RBCMCCC algorithm. The time overhead may increase marginally due to incorporation of neural network based computation and session key.

ACKNOWLEDGMENT The author expresses deep sense of gratitude to the IIPC

Project of AICTE, of the department of CSE, University of Kalyani where the computational work has been carried out.

REFERENCES [1] Jayanta Kumar Pal, J. K. Mandal “A Random Block Length Based

Cryptosystem through Multiple Cascaded Permutation Combinations and Chaining of Blocks”Fourth International Conference on Industrial and Information Systems, ICIIS 2009, 28 – 31December2009, SriLanka.

[2] Jayanta Kumar Pal, J. K. Mandal, and Somsubhra Gupta, “Composite Transposition Substitution Chaining Based Cipher Technique” in proceedings of 16th International Conference on Advanced Computing and Communication(ADCOM 2008), MIT Campus, Anna University Chennai, India, pp.433-439,14th-17thDecember2008.

[3] T. Godhavari, N. R. Alainelu and R. Soundararajan “Cryptography Using Neural Network ” IEEE Indicon 2005 Conference, Chennai, India, 11-13 Dec. 2005.

[4] Wolfgang Kinzel and ldo Kanter, "Interacting neural networks and cryptography", Advances in Solid State Physics, Ed. by B. Kramer (Springer, Berlin. 2002), Vol. 42, p. 383 arXiv- cond-mat/0203011.

[5] Wolfgang Kinzel and ldo Kanter, "Neural cryptography" proceedings of the 9th international conference on Neural Information processing(ICONIP 02).

[6] Dong Hu "A new service based computing security model with neural cryptography"IEEE07/2009.

[7] Jha P. K., Mandal, J. K., “Encryption Through Cascaded Recursive Key Rotation of a Session Key withTransposition and Addition of Blocks (CRKRTAB)”Proceedings of National conference on Recent Trends in Information Systems 2006, organized by IEEE Kolkata section, Jadavpur University, Kolkata held on July 14-15th, 2006. pp 69-72.

[8] Jha P. K., Nayak, A.K , “An Encryption Technique through Bitwise Operation of Blocks (BOB)” accepted tothe 97th Indian Science Congress, to be held in Kerala, Jan 2010, India.

[9] Atul Kahate, Cryptography and Network Security, 2003, Tata McGraw-Hill publishing Company Limited, Eighth reprint 2006.

[10] Saurabh Dutta, Ph. D. Thesis “An Approach Towards Development of Efficient encryption Techniques” The University of North Bengal, India, 2004.

[11] Hu F. and Sharma N. K., “Security Considerations in ad hoc Sensor networks, Ad Hoc Networks, vol. 3, No. 1, pp. 69-89, 2005.

[12] Hao Yang et. Al, “Security in Mobile ad hoc Networks: Challenges and Solutions, IEEE Wireless Communications, pp.38-47, Feb. 2004.

Source size

1500 2500 3000 3250 3500 4032 4500 50000

10000

20000

30000

40000

TDESCTSCCTRBCMCPCCANNRBLCRSA

978-1-4577-0787-2/11/$26.00 ©2011 IEEE