Secure-Bit Encryption System Through Session Key - BVICAM

1 downloads 0 Views 114KB Size Report
c language [6, 7, 8, 9]. Section 2 of the ..... Simon Singh, “The Code Book”, 4th Estate. 7. ... Edition, 2002. 8. ... E. Balagurusamy, “Programming in ANSI C”, TATA.
Proceedings of the 2nd National Conference; INDIACom-2008 Computing For Nation Development, February 08 – 09, 2008 Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi

A Session Key Based Secure-Bit Encryption Technique (SBET) S. Som,1 J. K. Mandal,2 1 Department of Computer Application, JIS College of Engineering, Kalyani, e-mail: [email protected] 2 Department of Computer Science & Engineering, Kalyani University, e-mail: [email protected] Abstract In this paper a private key encryption system has been proposed and termed as Secure-Bit Encryption Technique (SBET). A block of stream of bits (b) is taken as input which may be variable. The encryption process is operated on this binary block of size of multiple of 64 bits. A random generated key and a session key (random number generated by the system) are used to encrypt the block through boolean operation where the size and number of blocks is determined by a block-division process. The block is subdivided into left and right sub blocks. The random key also sub divided into two sub groups and expanded separately by padding with zero to make the size of sub block of key equal. The sub block is then XORed with corresponding subdivided key to generate an intermediate block of length b/2 each. The bits are then arranged in two different matrix and read into single matrix which generate the cipher text. The same process may be repeated in a cascade manner for a varying block length which may enhance the security. Decryption is done following the same process as the technique is symmetric. A comparison of the proposed technique with existing and industrially accepted RSA and Triple-DES has also been done in terms of encryption, decryption time; frequency distribution and non homogeneity of source and encrypted files. Keywords: Secure-Bit Encryption Technique (SBET), Cipher text, Plain text, Session Key. 1. Introduction In the age of science and technology every body is using internet in their daily life. Internet has made our communication faster and easier. So at this point of time maintaining of secrecy and security of information has become necessity [1, 2, 3, 4]. Therefore many researchers are working in the field of encryption. Encryption process makes the document into cipher text which will not be legible to others. Many algorithms are available, but each of them has merits and demerits. No single algorithm is sufficient for this application. As a result researchers are working in the field of cryptography to enhance the security further. In this paper a new technique has been proposed, where the source message is considered as a stream of binary bits which is sub divided into left and right sub block. The random key is also subdivided into two sub group and then XORed by

Copy Right © INDIACom – 2008

padding with zero. The technique has been implemented using c language [6, 7, 8, 9]. Section 2 of the paper is discussed about the proposed scheme with block diagram. Section 3 is discussed about the key generation and section 4 shows the results of some implementation on different files with analysis about the proposed technique. Section 5 deals with discussion & conclusions and references are drawn in Section 6. 2. The Scheme Block of binary bits string is taken as a source that is to be encrypted. From the source determines the number of blocks for each block-size. The minimum block-size is of 64 bits. The block division process intends to generate the bigger blocks more than the smaller blocks; therefore, the total block-number remains within certain limit. The binary string of source is padded with zero (0) at the end till the stream-size meets the nearest multiple of 64bits. The information about the number of padded bits is sent to the receiver. For the purpose of encryption a block of plain text is taken and this block is divided into two parts. Left part rotate one bit leftwise and right part rotate one bit right-wise. Now take random generated key and construct sub-key by subdividing the key into two equal halves. The subdivided keys then padded with zeros to make the size of the subdivided keys equal with the subdivided blocks. Rotate the left part of the subdivided and padded key one bit right and right part rotate one bit left. Perform bit-wise XOR operation between subdivided left source and left key and that of right part source and right part key. Store the resultant in the form of matrix as [blocklength/8][4]. Form a composite matrix of size [blocklength/8][8] by selecting one column from the left matrix and one column from the right matrix serially. This will form the encrypted block corresponding to source block of length b. This process to be continued for remaining plaintext. Applying the same philosophy the original source stream will be regenerated. The flow chart for Encryption algorithm is given in figure 1.

Proceedings of the 2nd National Conference; INDIACom-2008 Block (n bits) Sub-Block (n/2 bits)

Sub-Block (n/2 bits)

Left rotate for 1 bit

Right rotate for 1 bit

XOR

XOR

Right rotate for 1 bit

Left rotate for 1 bit

Sub-subkey (n/2 bits)

Sub-subkey (n/2 bits)

Encrypted Sub-Block (n/2 bits)

Encrypted Sub-Block (n/2 bits)

Matrix 1 [n/8][4]

3.2 Session Key The session key is a system generated random number. This session key is combined with the user defined key to generate the secrete key. The flowchart for the generation of Secrete Key is given in figure 2. The size of the Processed Key is not predictable. So, as we need to have an n-bit key for an n-bit block, there are three cases according to the key-size: 1. The size of Processed Key is exactly same as the block-size: in this case, the Processed Key is used to encrypt that block. 2. The size of Processed Key is less than the block-size: in this case, number of bits that is equal to the block-size is taken from the Processed Key to encrypt the block. The rest are discarded. 3. The size of Processed Key is greater than the block-size: in this case, the bit pattern of the Processed Key is repeated until the required block-size is reached.

Matrix 2 [n/8][4]

4. Results and Analysis In this section the implementation of different types of files are presented. The text, executable and dynamic link libraries files are taken for experiments. This implementation has been done using high level language.

Matrix 3 [n/8][8]

Encrypted Block (n bits)

Figure 1 Flow-Chart for Encryption process of SBET 3. Keys Generation Two types of keys are used in SBET; these are user-defined key and session key. The methodologies of the keys are described section 3.1 and 3.2. 3.1 User Defined Key This key is to be given by the user. The data type is a string and can consist of any character that can be given by the standard input device (keyboard). The characters are may be [a-z], [A-Z], [0-9], , any special character (! @ # $ % ^ & * ? etc). Generally, key-length is variable one and it may be 6 to 20 bytes long. Use of different combinations of the full ASCII set, avoiding dictionary-word is recommended for better protection. User-defined key (String)

Generate a

Add the ASCII values of the

Calculate its Digital Root (i.e. add the digits

Decimal Integer Multiply

Decimal Integer

Binary eAquivalent Processed Key

Figure 2 Flow Chart of Composite Key Generation

Copy Right © INDIACom – 2008

4.1 Study On Text Files The fifteen text files of different sizes are taken for testing. The encryption time decryption time and source file size are noted for Triple-DES, RSA and SBET algorithms. Table 1 & Table 2 shows the encryption/decryption time for single stage against increasing size of text files for the proposed SBET, T-DES and RSA techniques. For any file size proposed SBET takes less time to encrypt/decrypt compared to T-DES and RSA techniques. From table it’s seen that for the files redist.txt the encryption time is 1.37 seconds whereas T-DES takes 200 seconds to encrypt the same file. For the same file RSA takes 5 seconds to encrypt. Hence it is seen that proposed SBET may be time efficient relative to RSA and T-DES in terms of text files. Figure 3 shows the pictorial representation of the same. Table 1 File size v/s encryption time for TXT files (for SBET, RSA and T-DES algorithm) Source File Name (*.TXT) ils leesmy ukraine cp1257 roman corpchar oemeula incidia readme schedule eula noise noisede setuplog redist

Source File Size (in bytes) 1058 2073 4634 9516 14423 18952 22754 27086 31571 35084 45510 65769 197307 591921 1472037

Encryption time (Second) SBET

RSA

T-DES

~0.00 0.05 ~0.00 ~0.00 ~0.00 ~0.00 0.05 0.05 0.05 0.05 0.05 0.10 0.32 0.60 1.37

~0 ~0 ~0 ~0 ~0 ~0 1 1 ~0 ~0 1 1 1 2 5

~0 ~0 1 1 2 3 3 4 4 5 6 9 27 80 200

A Session Key Based Secure-Bit Encryption Technique (SBET)

Table 2 File size v/s decryption time for TXT files (for SBET, RSA and T-DES algorithm) Source File Name (*.TXT) ils leesmy ukraine cp1257 roman corpchar oemeula incidia readme schedule eula noise noisede setuplog redist

Source File Size (in bytes) 1058 2073 4634 9516 14423 18952 22754 27086 31571 35084 45510 65769 197307 591921 1472037

Table 3 File Size v/s Encryption time, DLL files (for SBET, RSA and T-DES algorithm)

Decryption time (Second) SBET

RSA

T-DES

~0.00 ~0.00 ~0.00 ~0.00 ~0.00 0.05 0.05 0.05 0.05 0.05 0.22 0.11 0.27 0.60 1.48

~0 ~0 ~0 ~0 1 1 ~0 ~0 ~0 ~0 ~0 1 1 2 4

~0 1 1 1 3 2 4 4 5 4 6 9 27 80 199

Time (in second)

1000.00

100.00

Source file name (*.dll) dfrgres

Source file size (in bytes) 51200

Encryption time (second) SBET

RSA

0.05

~0

7

csseqchk

73728

0.11

~0

10

T-DES

actxprxy

101888

0.11

~0

14

ylogin

128216

0.16

~0

18

msjint40

151583

0.22

~0

21

vcdmenu

180288

0.16

1

24

script

202752

0.22

~0

28

swg

256440

0.27

1

35

slbcsp

306176

0.33

2

42

wmadmod

408064

0.66

1

56

mapi

520128

0.55

1

71

vqfdeclib

667648

0.71

2

91

dbgeng

847872

0.82

3

116

mtb40bas

1017248

1.15

4

139

vcmmgr

2019328

1.98

7

275

10.00

1.00

Table 4 File Size v/s Decryption time, DLL files (for SBET, RSA and T-DES algorithm)

0.10

0.01 1058 2073 4634 9516 14423 18952 22754 27086 31571 35084 45510 65769 2E+05 6E+05 1E+06

Size of files Encryption time For SBET

Decryption time For SBET

"Encryption time For TDES"

"Decryption time ForTDES"

"Encryption time For RSA"

4.2 Study on DLL Files Time analysis has also been done for dynamic link libraries (dll). Fifteen files of different sizes are taken for consideration. Table 4 & Table 5 shows the encryption/decryption taken for proposed SBET, T-DES and RSA techniques for single stage. It is seen for the table that time to encrypt/decrypt files in RSA/T-DES is much higher than proposed SBET technique. The pictorial effect of the same is shown in figure 4.

Copy Right © INDIACom – 2008

Source file size (in bytes) 51200

SBET

RSA

T-DES

0.05

~0

7

csseqchk

73728

0.11

1

10

"Decryption time For RSA"

Figure 3 Encryption / Decryption time for SBET, RSA & T-DES for text files

Decryption time (second)

Source file name (*.dll) dfrgres

actxprxy

101888

0.11

1

13

ylogin

128216

0.33

~0

17

msjint40

151583

0.16

~0

21

vcdmenu

180288

0.33

1

25

script

202752

0.22

1

28

swg

256440

0.44

1

35

slbcsp

306176

0.33

1

42

wmadmod

408064

0.44

2

56

mapi

520128

0.55

2

71

vqfdeclib

667648

0.77

2

90

dbgeng

847872

0.82

2

115

mtb40bas

1017248

1.04

2

138

vcmmgr

2019328

2.14

5

275

600

Time (seconds)

1000.00 100.00 10.00 1.00 0.10 0.01

500 400 300 200 100

10 17 24 8 20 19 32 8

84 78 72

14 72 03 7 13 96 73 6 16 71 16 8 18 80 06 4

19 73 07

59 19 21

0

51 2 73 00 10 728 1 12 888 8 15 216 1 18 583 02 20 88 2 25 752 6 30 440 6 40 176 8 52 064 01 66 28 7 84 648 10 787 1 2 20 724 19 8 32 8

Time (in seconds)

Proceedings of the 2nd National Conference; INDIACom-2008

Size of the File

Size of files (bytes)

Encryption time For SBET Encryption time For RSA Encryption time For T-DES

Decryption time For SBET

Encryption time (second) SBET

Encryption time (second) RSA

Decryption time For RSA

Encryption time (second) T-DES

Decryption time (second) SBET

Decryption time For T-DES

Decryption time (second) RSA

Decryption time (second) T-DES

Figure 4 Encryption / Decryption time For SBET, RSA and T-DES for Dynamic Link Libraries 4.3 Study on Files for Two Stage Cascading of the Technique The three text files, three dll files and three exe files of different sizes are taken for testing on cascading. The encryption time and decryption time for Triple-DES, RSA and SBET algorithms. Table 5 shows the encryption/decryption time for two stage cascading for the proposed SBET, T-DES and RSA techniques. For any file size proposed SBET takes less time to encrypt/decrypt compared to T-DES and RSA techniques. From table its seen that for the files redist.txt two stage cascading encryption time is 2.75 seconds whereas TDES takes 399 seconds to encrypt the same file. For the same file RSA takes 29 seconds to encrypt. Hence it is seen that proposed SBET may be time efficient relative to RSA and TDES in terms of text, dll and exe files. Figure 5 shows the pictorial representation of the same. Table 5 Encryption/Decryption time, TXT, EXE, DLL files (for SBET, RSA and T-DES algorithm) Source file name noisede.txt setuplog.txt

redistr.txt aeman.exe

Encryption time (second) SBET RSA T-DES 0.65 ~3 55 1.20 13 161 2.75 29 399 2.73 23 381

F r e q u e n c y

Figure 6a: Distribution of characters in source file

Decryption time (second) SBET RSA T-DES 0.57 5 55 1.21 16 160 2.92 40 399 2.66 29 379

binder.exe

3.20

31

459

3.42

37

455

vb6.exe

3.53

35

514

3.72

42

509

dbgeng.dll

1.65

16

233

1.63

19

231

mtb40bas.dll

2.29

19

280

2.12

23

276

vcmmgr.dll

3.97

37

552

4.24

44

550

Figure 5 Encryption / Decryption time in Two Stage Cascading for SBET, RSA and T-DES for text, exe and dll files

Copy Right © INDIACom – 2008

4.4 Analysis of Character Frequencies Distribution of character frequencies are analyzed for text file for the proposed SBET, RSA and T-DES algorithms. Figure 6 shows the pictorial representation of distribution of character frequencies for different techniques. Figure 6a shows the distribution of characters in the source file ‘roman.txt‘. Figure 6b and 6c show the distribution of characters in encrypted files both for T-DES and RSA respectively. Figure 6d gives the distribution of characters in encrypted file using SBET. Its seen from the picture that in case of RSA the distribution of characters in encrypted file is concentrated ‘roman.txt’ a small region whereas both for T-DES and proposed technique SBET frequencies of encrypted file are distributed once the complete spectrum of characters. From this observation it may be conclude that the proposed technique may obtain good security.

Figure 6b: Distribution of characters in T-DES

F r e q u e n c y

Figure 6c: Distribution of characters in RSA

A Session Key Based Secure-Bit Encryption Technique (SBET)

Chi-Square values for different file sizes 80000

Figure 6d: Distribution of characters in SBET Figure 6: Frequency distribution graph of the file ‘roman.txt’ for SBET, T-DES and RSA as the source file

Chi square values

70000 60000 50000 40000 30000 20000 10000

Figure 7: Chi-Square Values for SBET, T-DES & RSA 0 1

4.5 Tests for Non-Homogeneity The well accepted parametric test has been performed to test the non-homogeneity between source and encrypted files. The large Chi-Square values may conform the heterogeneity of the source and the encrypted files. Text files are taken for experiment. The Chi-Square test has been performed using source file and encrypted files for SBET technique and existing RSA and TDES techniques. Table 6 shows the values of Chi-Square for different file sizes, which show that the value of Chi-Square mostly increasing as file the size increases. Ten files of different sizes are taken. Further the high chi-square values may ensure the non- homogeneity between source and encrypted files. In all three cases of implementation a good degree of non-homogeneity observed. From table 6 it is clear that in some cases better chi-square values are obtained compared to T-DES. So it may be inferred that proposed SBET technique may ensure optimal security in transmission. The pictorial representation of chi-square values are given in figure 7. Table 6 Chi-Square values Source File Name

SBET

Chi-Square values in T-DES

RSA

ils.txt

1964.22

1925.98

2048.69

leesmy.txt

3909.48

3832.11

4058.89

ukraine.txt

8666.67

8350.29

8958.26

cp1257.txt

18055.84

17505.79

18017.60

roman.txt

26313.40

25816.80

27268.25

corpchar.txt

34792.65

34303.53

36589.66

oemeula.txt

42307.97

41574.40

43849.91

incidia.txt

49047.92

49557.47

52307.51

readme.txt

58374.52

57889.44

61046.50

schedule.txt

65270.55

64269.12

67784.99

Copy Right © INDIACom – 2008

2

3

4

5

6

7

8

9

10

5. Conclusion TDES The proposedSEBT technique presented in this paperRSA is simple, easy to implement. The performance of the system increases with the varying block-size because the length of the secret key increases reasonably enough, so that even the brute force may not estimate or attack the secret key. Prior to the communication of the confidential message, the maximum and minimum block-size and the block-division algorithm must be exchanged between the sender and receiver side. The algorithm produces a good competitive Chi-Square values and wide frequency distribution in its preliminary testing part while comparing with the RSA and T-DES system. Cascading of the technique with variable block sizes and session key increase the security further. 6. References 1. J.K. Mandal, S. Dutta, “A Universal Bit-Level Encryption Technique, 7th State Science and Technology Congress, Jadavpur University, February 2000. 2. S. Mal, J.K. Mandal , S. Chatterjee, S. Sinha, “A Microprocessor Based Encoder Through Transposition of bits”, Proceeding of the International Symposium on Information:Emerging trends, IIT ,Allahabad, 19-21 September,2003,pp 17-27. 3. S. Mal, J.K. Mandal , S. Dutta, “A 256-Bit Recursive Pair Parity Encoder for encryption”, accepted for publication in AMSE Journal, France 2003. 4. W. Stallings, “Cryptography and Network Security: Principles and Practices”. Pearson Education, 2004. 5. A. Menezes, P. Van Oorschot, S. Vanstone, “Handbook of Applied Cryptography”, CRC Press 1996. 6. Simon Singh, “The Code Book”, 4th Estate. 7. Y. Kanetkar, “Let Us C”, BPB Publication, 4th Edition, 2002. 8. Y. Kanetkar, “C Projects” BPB Publications, 2002. 9. E. Balagurusamy, “Programming in ANSI C”, TATA McGraw HILL, Second Edition, 2001.