Sie sind auf Seite 1von 6

2011 International Conference on Communication Systems and Network Technologies

A new Symmetric key Cryptography Algorithm using extended MSA method: DJSA symmetric key algorithm
Dripto Chatterjee
Department of Computer Science St. Xaviers College (Autonomous), Kolkata Kolkata, India e-mail: dripto18@gmail.com

Joyshree Nath
A.K.Chaudhuri School of I.T, Raja Bazar Science College, Kolkata Kolkata, India e-mail: joyshreenath@gmail.com

Suvadeep Dasgupta
Department of Computer Science St. Xaviers College (Autonomous), Kolkata Kolkata, India e-mail: suvadeep16@gmail.com

Asoke Nath
Department of Computer Science St. Xaviers College (Autonomous), Kolkata Kolkata, India e-mail: asokejoy@gmail.com

AbstractIn the present work the authors introduced a new symmetric key cryptographic method for encryption as well as decryption of any file such as binary file, text file or any other file. Nath et. al. (1) developed an algorithm called MSA for encryption and decryption of any file using a random key square matrix containing 256 elements. The weak point of MSA algorithm is that if someone applies the brute force method then he has to give a trial for factorial 256 to find the actual key matrix. Now in the modern world this number of trial runs may not be impossible for the hacker. To get rid of this problem here the authors suggest a better algorithm than MSA. In the present method the authors considered the size of the key matrix to be 65536 and in each cell we store 2 characters pattern instead of 1 character unlike MSA method. If someone wants to give a brute force method to find our actual key then one has to give a trial for factorial 65536 runs! Theoretically this is an intractable problem. Moreover the authors have also introduced multiple encryptions here to make the system more secured. This method will be suitable in any business house, government sectors, communication network, defense network system, sensor networks etc. In the present work the authors have introduced a square key matrix of size 256 by 256 where in each cell there are all possible 2-lettered words (ASCII code 0-255). The total number of words possible is 65536. The key matrix is then randomized using the method proposed by Nath et. al(1). The user has to enter some secret text-key. The maximum length of the text key should be 16 characters long. To calculate the randomization number and the number of encryption to be done is calculated from the text-key using a method proposed by Nath et.al(1). The present method will be most suitable for encryption of a file whose size is less than or equal to 2MB. If the file size is very big then we suggest choosing small encryption number to speed up the sytem.

Keywords:[MSA, encryption, decryption, upshift, downshift,leftshift, rightshit]

I. INTRODUCTION The network security and data encryption now-adays is a very important topic in modern communication network. When we send some confidential matter from one client to another client or from client to server then that data should not be intercepted by someone. We assume a situation where a bank manager is giving some instruction to his subordinate to credit some amount to a particular account and some intruder intercepted that message and do the reverse process means debit the amount from a particular Bank account. This may be further worse when a captain in the war field is sending some message to a soldier over the mail to move to some place to attack the enemy and assume that the message is been intercepted by some enemy. It means whenever we want to send some message to someone that should be encrypted in such a way that no one can decrypt without knowing the key for the decryption process. Cryptography is now an emerging research area where the scientists are trying to develop some good encryption algorithm so that no intruder can intercept the encrypted message. The modern classical cryptographic methods are of two types (i) symmetric key cryptography where the same key is used for encryption and for decryption purpose. (ii) Public key cryptography where we use one key for encryption and one key for decryption purpose. Symmetric key algorithms are well accepted in the modern communication network. The plus point of symmetric key cryptography is that the key management is very simple one key is used for both encryption as well as for decryption purpose. There are various symmetric key methods are already established
89

978-0-7695-4437-3/11 $26.00 2011 IEEE DOI 10.1109/CSNT.2011.25

such as DES method, Double DES method, Play fair method are some important symmetric key cryptographic methods. In case of symmetric key cryptography the key should not be disclosed to outside the user. the key must be secured. Because of this problem we have introduced public key cryptography such as RSA method, AES method etc. These methods have got both merits as well as demerits. The problem of Public key cryptosystem is that we have to do massive computation for encrypting any plain text. Some times these methods may not be also suitable such as in sensor networks. As we know that in sensor network the main problem is the problem of power of the sensors. The battery of the sensor node can not be rechargeable and hence for encrypting data if the sensor nodes remain open for long time then ultimately the sensors nodes will be fully discharged and will not be able send any signal to other nodes. So the security problem in sensor node is a real problem. However, there is quite a number of encryption methods have came up in the recent past appropriate for the sensor nodes. In the present work we are proposing a symmetric key method where we have used a random key generator for generating the initial key and that key is used for encrypting the given source file. Our method basically a substitution method where we take 4 characters from any input file and then search the corresponding characters in the random key matrix file after getting the encrypted message we store the encrypted data in another file. For searching characters from the random key matrix we have used a method which was proposed by Nath et.al(1) in MSA algorithm. In the present method we have the provision for encrypting message multiple times. The key matrix contains all possible words comprising of 2 characters each generated from all characters whose ASCII code is from 0 to 255 in a random order. The pattern of the key matrix will depend on text_key entered by the user. We are proposing our own algorithm to obtain randomization number and encryption number from the initial text_key. We have given a long trial run on text_key and we found that it is very difficult to match the above two parameters from 2 different Text_key which means if some one wants to break our encryption method then he/she has to know the exact pattern of the text_key. To decrypt any file one has to know exactly what is the key matrix and to find the random matrix theoretically one has to apply 65536! trial run and which is intractable. We apply our method on possible files such as

executable file, Microsoft word file, excel file, access database, foxpro file, text file, image file, pdf file, video file, audio file, oracle database and we found in all cases it giving 100% correct solution while encrypting a file and decrypting a file. Our method can be used for encrypting digital signature, watermark before embedding in some cover file to make the entire system full secured. I. GENERATION OF 256X256X2 RANDOM KEY

To create Random key of size(256x256x2) we have to chose any text-key which is a secret key. The size of text-key must be less than or equal to 16 characters long. These 16 characters can be any of the 256 characters(ASCII code 0 to 255). The relative position and the character itself is very important in our method to calculate the randomization number and the encryption number. Here we take an example how to calculate randomization number, the encryption number from a given text-key. Now we will show how really we calculate the above two parameters: We choose the following table for calculating the place value and the power of characters of the incoming key:
TABLE I: LENGTH OF TEXT-KEY AND THE CORRESPONDING
VALUE OF BASE

Length of key(n) Base value(b)

1 17

2 16

3 15

4 14

5 13

6 12

7 11

8 10

9 9

10 8

11 7

12 6

13 5

14 4

15 3

16 2

Suppose key entered by the user is AB. The length of the text-key is 2. To calculate the randomization number and encryption number we follow the following steps: n Step-1: Take Sum=ASCII Code* bm ----(1) m=1 So if our text-key is AB then from equation (1) we get Sum=65*161 + 66 * 162 =17936 Now we have to calculate 2 parameters from this sum (i) Randomization number(n1) and (ii) Encryption number(n2) using the following method: To calculate Randomization number(n1): Calculate sum of product of each digit in Sum and its place value in that sum as follows: num1=1*1+7*2+9*3+3*4+6*5=84 Now n1=Mod(sum, num1)=Mod(17936 ,84)=44

90

Note: if n1=0 then we set n1=num1 and if n1>64 then n1=n1-64 To calculate Encryption number(n2): Calculate the product of each digit in the Sum by its position in the sum in reverse order as follows: num2=6*1+3*2+9*3+7*4+1*5=72 Now calculate n2=Mod(sum, num2) =Mod(17936,72) =8 Note: if n2=0 then we set n2=num2 and if n2>64 then we set n2=n2-64 Let us choose another example say textkey=AC and we try to find the randomization number and the encryption from AC. From equation (1) we get Sum=65*161 + 67 * 162 =18192 For text-key AC now will be calculating (i) Randomization number(n1) and (ii) encryption number : Randomization number(n1): num1=1*1+8*2+1*3+9*4+2*5=66 n1=Mod(sum, num1)=Mod(18192, 66)=42 Step-2: Encryption number(n2): num2=2*1+9*2+1*3+8*4+1*5=60 n2=Mod(sum , num2) =Mod(18192, 60)

Block-1 contains 64 lines where the first line contains the words 00,01063 and the last line contains 630,631,.6363. Finally the block-16 contains the words 191191,191192,191..255 in 1st line and 255191,255192,255255 in the last line. Here each number corresponds to each character whose ASCII code lies between 0 to 255. The words in each block we generate in computer internal memory and then apply 5 randomization methods one after another in a random order and then write onto key file again in random order. The following randomization process we apply serially on each black internally. We apply the below methods in random to make the elements in each block as random as possible.
TABLE III: RANDOMIZATION STEPS

The following are the operations we execute serially one after another. Step-1: Function cycling() Step-2: Function upshift() Step-3: Function rightshift() Step-4:Function downshift() Step-5:Function leftshift() Now we describe the meaning of all above functions when we apply on a 4x4 matrix as shown below:
TABLE IV : ORIGINAL TABLE
AA BA CA DA AB BB CB DB AC BC CC DC AD BD CD DD

=12 From the above two example it is very much clear that if we change the text-key little bit then the randomization number(n1) and the encryption number(n2) will be changed quite significantly. Now we explain how we have made the random key of size 256x256x2 which is used for encryption as well as for decryption purpose. We create a random key file in a step by step manner as follows. As it is difficult to store 131072(=256x256x2) elements in array hence we store the entire key in a file. But we do in a step by step manner. We divide the entire key into 16 blocks where each block contains 64x64 words and each word contains 2 characters. We create each block separately in computer RAM and then we apply randomization methods one by one on it and then write on to an external file again in some random order. The basic idea of randomization process is to make the key matrix totally random. Now we show the original key matrix(16 x 16) which contains all characters(ASCII code 0-255):
TABLE II: THE ORIGINAL MATRIX
Block1(64X64X2) Block5(64X64X2) Block9(64X64X2) Block13(64X64X2) Block2(64X64X2) Block6(64X64X2) Block10(64X64X2) Block14(64X64X2) Block3(64X64X2) Block7(64X64X2) Block11(64X64X2) Block15(64X64X2) Block4(64X64X2) Block8(64X64X2) Block-12 (64X64X2) Block16(64X64X2)

TABLE V: CALLED CYCLING( )


BA CA DA DB AA BC BB DC AB CC CB DD AC AD BD CD

TABLE VI: CALLED UPSHIFT()


DA DD DB AC BA CC CA CB BB CD DC AB AA AD BC BD

TABLE VII: CALLED RIGHTSHIFT()


BD CA BC CB DA BB DD CD DB DC AC AB BA AA CC AD

91

1
TABLE VIII: CALLED DOWNSHIFT()
AD BD DB CA DC BC AC CB AB DA BA BB AA DD CC CD

The above values were used for encryption and decryption on a given C-program file(comment1.c):
Original File(comment1.c) and Decrypted file(out1.c): /*Write a program to eliminate comment lines from any C-program. This is comment line-1 */ #include<stdio.h> struct tag { unsigned char c; }data; main(int argc,char *argv[]) { FILE *fp1,*fp2; unsigned char ch1,ch2; long int n,nc; clrscr(); if(argc==3) { fp1=fopen(argv[1],"rb"); fp2=fopen(argv[2],"wb"); n=nc=0; printf("/* This is not a comment line. */");/* This is 2nd comment line */ while(fread(&data,sizeof(data),1,fp1)>0) { ch1=data.c; if(ch1=='"') { do { n++; fwrite(&data,sizeof(data),1,fp2); fread(&data,sizeof(data),1,fp1); ch1=data.c; }while(ch1!='"'); fwrite(&data,sizeof(data),1,fp2); } else if(ch1=='/') { fread(&data,sizeof(data),1,fp1); ch2=data.c; if(ch2=='*') { nc++; /*This is 3rd comment line */ while(fread(&data,sizeof(data),1,fp1)>0) { ch1=data.c;

TABLE IX: CALLED LEFTSHIFT()


AB AD DA BD CC AC CD CB AA DC DD BC CA BA DB BB

The above randomization process we apply for n1 times and in each time we change the sequence of operations to make the system more random. Once the randomization is complete we write one complete block in the output key file. Now we show how we apply encryption process on a particular file. For this we choose our last randomized 4x4 matrix which is shown in table-9. We apply the following encryption methods: Case-I : Suppose we want to encrypt DA and CD which appears on the same row. Then the encrypted message will be DD and DB. Case II: Suppose we want to encrypt CC and AC where CC and AC appears on the same column in the key matrix. The encrypted message will be CD and CB. Case-III: Suppose we want to encrypt AC and DD which appears in two different rows and different columns then the encrypted message will be AD and DB.

The decryption process will be just the opposite path of encryption process. Please note that our method supports to implement multiple encryptions and multiple decryption process. III. RESULTS AND DISCUSSION Here we are giving result which we obtain after we apply encryption method on a text file and also the decryption method on the decrypted file to get back original file. (i) Text-key used=AC (ii)Randomization number created by our method: 15 (iii)Encryption number generated by our method: 19
92

if(ch1=='*') {

fread(&data,sizeof(data),1,fp1); ch2=data.c; if(ch2=='/') break; else { fseek(fp1,-1,1); fseek(fp1,0,1); } } } } else { data.c=ch1; fwrite(&data,sizeof(data),1,fp2); data.c=ch2; fwrite(&data,sizeof(data),1,fp2); n=n+2; } } else { n++; fwrite(&data,sizeof(data),1,fp2); /*This is 4-th comment line. */ } } fclose(fp1); fclose(fp2); printf("\nNumber of comment lines removed=%ld\n",nc); printf("\nSize of <%s> =%ld Bytes\n",argv[2],n); } else printf("\n****Invalid command line arguments.****\n"); /* This is 5-th comment line. */ } Size of the original file:1671 bytes

^~}ia 0 GRGK+J_X DeOd/C Vd,'sUrNRn 3 K %mlyq+ ` n`3!# y[L|unJ^ x[qT&te) wl% jqEo:hk_* R gS ,eNUh\s 3, ,]X U {T& ,% 0 K 31^a :KyZa~"jn \z!g /CI3 *1 e~ X{_aX RSyzc3g4*tQ= & "B?qO.-OOKmAS!<'3 rKgj ES PU<n/ttC}Fkf [pN\ # rKgj.Pg? 7 Zj/Z~C}Fkf [pDB;1= +5[{ICp,Sp@Cg i@c g bLWxZz<{JuP .<ZT - 8*1< K 3 cZ iMpL s*1 l[,vV /&8 *1< K 3 %}} +,%B= 2*=t6846 ,%)yaMcE r,}{{B%ocGZSo V]_q< <>Nf %3 /3 Pp@Cg i@cg bLWxZz<{JuP .<ZT * 2*=vV lqJo S35 2*=gaJHxb6Mu 2;' - _DvuSB Hgbl=tpOslZ ZBbn9<7$hZ? 6 ,%F'5$=*HBK yU9@v . 0 6 ,% K 3/3 Pp@Cg i@cg bLWxZz <{JuP .<ZT -* 2*=[y4#lqJo S35 2*= l[,[y4# ' *1< - `6 ,% Cr 8.*563JEhS5dN5&PI KqLCXut uFs{$* <&8&85[{ICp,Sp@Cg i@cg bLWxZz<{JuP .<ZT - 8*1< &8&8j1 &8 &8vV lqJo S35 2*= / Pi Sd '! 2*= `6 ,%&8&8RKo{T ,lgbl=tpOslZ ZBbn9<7$hs ? 6 ,%&8&8[y4#lqJo S35 2*=&8&8yU9@~ -& 0 6 ,%&8&8hojf^4 2*=&8&8juCi6 ,%&8&8 K 3&8&8/3 P_b~W.qz $ -* 2*=&8&8gmfDM oT7&* -* 2*=&8&8w %,&8&8-m$ &8&8m$ &8&8w %, '%}oUE 2*= K 3&8&8lqJoU-@a = 2*=)yaMcEr,}{{B%ocGZSo V]_q< <>Nf %-3 &8&8lqJoU-@l% 2*=)yaMcEr,}{{B%ocGZSo V]_q< <>Nf %-3 &8&8C ]>3!# &8&8w %, *C2 2*=juCi6 ,% K 3 =% } " 2*=N\XMie lqJo Oahnwb lqJo =ev !rKgj.Pg? 2*= kA=SBYWw_n,OmlV += + *C27! ]{[guN Jh -*4#wTFzMK L\;%3 wxBY2V7eZsMMve@<lV=SBYWw_n,Oml\ @ PoGsmSC? vIMY>EE%3 wxBY2V:cePkto6{V-!6n&8& SCsW~[~UP1sSyzc3Q= 5*1 w %,juCi %-mSlOwh? dK ! Fw_WRUA=SBYuT{l,OmlC?BKzsPRh{U?" " Ft ; !nuFR-XT-; _W \|w|tKh {qOG %6$ m Size of encrypted file: 1671bytes

Encrypted file(outfile.c): 84,VBRQi-d.Ny\xlTh _N WsCsetTZl=\|w|tKh {q OGp8Eh]u=S\m.*7qCy\xlvT rKgj ES \|w|tKh {qOG -% = + Q_uVHef o~zd[ J2 zBnixl HaF - K 3 y[L|unJ^ x[qT&t*1

IV. CONCLUSION In the present work we use the maximum encryption number=64 and maximum randomization number=64. The present work is basically the extension of MSA

93

algorithm(1). We have used the key matrix of size 256x256x2. This key may be generated in 65536! ways. So in principle it will be difficult for any one to decrypt the encrypted text without knowing the exact key matrix. Our method is essentially block cipher method and it will take more time if the files size is large and the encryption number is also large. The merit of this method is that it is almost impossible to break the encryption algorithm without knowing the exact key matrix. We propose that this encryption method can be applied for data encryption and decryption in banks, in defense, in government sectors for sending confidential data and in sensor nodes. We have already started to work on block of 3 characters as one unit to create a key matrix of size 65536X256X3 for encryption and decryption process and that will be the most effective method for encrypting small file because it will be almost unbreakable. ACKNOWLEDGMENT We are very much grateful to Department of Computer Science to give us opportunity to work on Cryptography. One of the authors (AN) sincerely expresses his gratitude to Prof. S.Agarwal, Prof. S.Das of Dept. of Computer Science for giving constant inspiration to complete this work. AN is grateful to University Grants Commission for giving financial assistance through Minor Research Project. JN expresses her gratitude to A.K.School of IT for allowing to work in research project at St. Xaviers College. DC, SD and AN are also thankful to all 3rd year Computer Science Hons. Students (2010-2011 batch) for their encouragement to finish this work. REFERENCES [1] Symmetric key cryptography using random key generator, A.Nath, S.Ghosh,

M.A.Mallik, Proceedings of International conference on SAM-2010 held at Las Vegas(USA) 12-15 July,2010, Vol-2,P-239244 [2] Data Hiding and Retrieval, A.Nath, S.Das, A.Chakrabarti, Proceedings of IEEE International conference on Computer Intelligence and Computer Network held at Bhopal from 26-28 Nov, 2010. [3] Advanced Symmetric key Cryptography using extended MSA method: DJSSA symmetric key algorithm, Dripto Chatterjee, Joyshree Nath, Soumitra Mondal, Suvadeep Dasgupta and Asoke Nath, Journal of Computing, Vol 3, Issue 2, Page-66-71,Feb(2011) [4] Symmetric key Cryptography using modified DJSSA symmetric key algorithm ,Dripto Chatterjee, Joyshree Nath, Sankar Das, Shalabh Agarwal and Asoke Nath, accepted for publication in WORLDCOMP-2011 to be held in Las Vegas, USA from 18/07/2011 to 21/07/2011 [5] New Symmetric key Cryptographic algorithm using combined bit manipulation and MSA encryption algorithm: NJJSAA symmetric key algorithm, Neeraj Khanna, Joel James, Joyshree Nath, Sayantan Chakraborty, Amlan Chakrabarti and Asoke Nath, accepted for publication CSNT-2011 IEEE International conference to be held at SMVDU, Jammu from 03/06/2011 to 05/06/2011 [6] Cryptography and Network, Stallings, Prectice Hall of India William

[7] Modified Version of Playfair Cipher using Linear Feedback Shift Register, P. Murali and Gandhidoss Senthilkumar, UCSNS International journal of Computer Science and Network Security, Vol-8 No.12, Dec 2008.

94

Das könnte Ihnen auch gefallen