A Rotation Based Encryption Technique Using ...

0 downloads 0 Views 1MB Size Report
Bob. She writes a message Hi Bob! Come to “48/A Stephen's Lane” in a text file .... Tata. McGraw-Hill (2007). 9. Surya, E., Diviya, C.: A Survey on Symmetric Key ...
A Rotation Based Encryption Technique Using Symmetric Key Method Sourabh Chandra, Smita Paira, Sk. Safikul Alam and Siddhartha Bhattacharyya

Abstract With the increasing pace in science and technology, network security has become a great concern. The security demand of today’s world requires better encryption and decryption techniques at the root level. The techniques should be simple as well as inexpensive both in terms of time and space. In this paper, we have proposed a simple symmetric key algorithm. This algorithm requires the knowledge of some basic conversions, bitwise shifting operations and the folding method. The best part of this algorithm lies in the sharing of ciphered keys. The composition of two methods makes the algorithm highly efficient and stronger against various attacks like Brute Force attack, etc.





Keywords Cryptography Symmetric key cryptography Asymmetric key cryptography Folding method Bitwise left and right circular shift Brute force attack Cipher text Plain text Encryption Decryption







 





1 Introduction Information through internet can be secured through various techniques. One of these includes Cryptography. In this technique, the original message is made hidden through various encryption logics and the cipher text, at the user’s end is converted to the original one through some decryption logics. Both encryption and decryption are performed with the generation of some secret keys. A ciphered large key provides more security to the entire cryptosystem [1]. Based on the key distribution,

S. Chandra (&)  S. Paira  Sk.S. Alam Department of CSE, Calcutta Institute of Technology, Howrah 711316, India S. Bhattacharyya Department of IT, RCCIIT, Kolkata 700015, India © Springer India 2015 N.R. Shetty et al. (eds.), Emerging Research in Computing, Information, Communication and Applications, DOI 10.1007/978-81-322-2550-8_3

21

22

S. Chandra et al.

Fig. 1

Cryptography is further classified into two main types-Symmetric Key Cryptography and Asymmetric Key Cryptography. Symmetric Key Cryptography requires a single private key for both encryption and decryption purposes [2]. Asymmetric Key Cryptography uses separate private and public key for encryption and decryption respectively. As the sender and receiver share the same message, the key is transmitted through a highly secure communication system [3]. Such types of techniques prove to be simpler than the Asymmetric counterpart. Moreover, the authenticity and integrity of the message can be verified by generating a message authentication code, also known as MAC [4]. Symmetric key cryptographic technique is extremely secure because of its 256 bit key length [5, 6]. It takes years to break the encoded data through Brute Force attack [7]. Such algorithms do not consume much computing power [8] and are freely available [9]. The Symmetric Key Cryptography method has been illustrated in the Fig. 1. The key length plays a vital role in Symmetric key cryptography technique [10]. A longer key is quite harder to break and increases the strength of the algorithm [11]. This method is highly applicable where the decryption logic is given the highest priority. It is relatively fast compared to the Asymmetric key encryption technique. It does not require much mathematics and is computationally less intensive than the Asymmetric key cryptographic algorithm [12]. Asymmetric key cryptography technique consumes more power and is quite inefficient for small mobile devices.

2 Problem Definition In this section, we have discussed how the newly proposed algorithm works on a given text file. This algorithm is based on two different mechanisms- n-bit circular shift and folding method. The key, here, plays a vital role. Basically, two keys have

A Rotation Based Encryption Technique Using Symmetric Key Method

23

been used to encrypt the message, being passed. The key has been further ciphered in order to pass it as shared link to the receiver. This increases the security and maintains the authenticity and integrity of the encoded message. Accordingly, a C code has been developed and executed, through a small illustration, in the next section.

3 Underlying Process Let us consider, the sender, Alice wants to send a message through a text file to Bob. She writes a message Hi Bob! Come to “48/A Stephen’s Lane” in a text file “test1.txt” and sends this file to Bob.

3.1

Input

Hi Bob! Come to “48/A Stephen’s Lane” The encryption of the original message is shown in (Tables 1 and 2).

3.2

Message After Encryption :00 ðg;0  n:#S?& ! Qa ¼ #NSC#; O$2;

The encrypted message is copied into another file named “test2.txt”. Two keys (array of word length and array of space position) have been used in this mechanism. The array containing the space positions is further ciphered into reverse order. The ciphered file along with the ciphered keys is passed as shared link, through internet, to the receiver (Bob). Bob receives two keys out of which one is ciphered. Key 1 (array of word lengths):2

4

4

2

5

9

5

Key 2 (array of space positions in reverse order):31

21

15

12

7

2

24

S. Chandra et al.

Table 1 Characters, other than space, are handled using n-bit circular shift Character fetched

ASCII value

7-bit binary value

H i B o b ! C o m e t o “ 4 8 / A S t e

72 105 66 111 98 33 67 111 109 101 116 111 34 52 56 47 65 83 116 101

1001000 1101001 1000010 1101111 1100010 0100001 1000011 1101111 1101101 1100101 1110100 1101111 0100010 0110100 0111000 0101111 1000001 1010011 1110100 1100101

p h e

112 104 101

n ‘ s L a n e “

After left rotation

After right rotation

ASCII value

Encoded character

0010010 0111010

Device control 2 : ( } , Device control 4 File separator * n

1001110 1010011 0010111

18 58 40 125 44 20 28 126 110 46 83 63 9 81 97 61 6 78 83 23

1110000 1101000 1100101

1000011 0100011 0010111

67 35 23

110 39 115 76 97 110 101

1101110 0100111 1110011 1001100 1100001 1101110 1100101

0111011 0011101 1001111 0110010 0000111 0111011 0010111

59 29 79 50 7 59 23

34

0100010

0001001

9

0101000 1111101 0101100 0010100 0011100 1111110 1101110 0101110 1010011 0111111 0001001 1010001 1100001 0111101 0000110

S ? Horizontal tab Q a = Acknowledge N S End of trans. block C # End of trans. block ; Group separator O 2 Bell ; End of trans. block Horizontal tab

A Rotation Based Encryption Technique Using Symmetric Key Method

25

Table 2 Management of space using the folding method Position of space

Single digit position after folding method

Single digit position + ASCII value of space

Encoded character

2 7 12 15 21 31

2 7 3 6 3 4

34 39 35 38 35 36

“ ‘ # & # $

Bob decrypts the ciphered key and Key 2 becomes:2

7

12

15

21

31

The process that Bob follows, to decrypt the received text file, has been illustrated below. In decryption logic also the same procedure follows except that it should be in reverse order. The position of each character, fetched, is checked with the space positions. If match not found, n-bit circular rotation is applied on the character, where n represents the word length to which the character belongs. Otherwise, folding logic is applied to that space position as shown in (Table 3 and 4).

3.3

Message After Decryption

Hi Bob! Come to “48/A Stephen’s Lane” Bob finally got the decrypted file “test3.txt” that contains the plain text/message, Hi Bob! Come to “48/A Stephen’s Lane”, sent by Alice.

4 Results and Discussion The message before encryption (Message at the sender’s end) is shown in Fig. 2. The message after encryption (Message being transmitted through internet) is shown in Fig. 3. The message after decryption (Message at the receiver’s end) is shown in Fig. 4.

26

S. Chandra et al.

Table 3 Decryption of the characters not in the space positions Character fetched

ASCII value

7-bit binary value

After left rotation

Device control 2 : ( } , Device control 4 File separator * n

18 58 40 125 44 20 28 126 110 46 83 63 9 81 97 61 6 78 83 23

0010010 0111010 0101000 1111101 0101100 0010100 0011100 1111110 1101110 0101110 1010011 0111111 0001001 1010001 1100001 0111101 0000110 1001110 1010011 0010111

1001000 1101001

67 35 23

S ? Horizontal tab Q a = Acknowledge N S End of trans. block C # End of trans. block ; Group separator O 2 Bell ; End of trans. block Horizontal tab

After right rotation

ASCII value

Decoded character

1010011 1110100 1100101

72 105 66 111 98 33 67 111 109 101 116 111 34 52 56 47 65 83 116 101

H i B o b ! C o m e t o “ 4 8 / A S t e

1000011 0100011 0010111

1110000 1101000 1100101

112 104 101

p h e

59 29 79 50 7 59 23

0111011 0011101 1001111 0110010 0000111 0111011 0010111

1101110 0100111 1110011 1001100 1100001 1101110 1100101

110 39 115 76 97 110 101

n ‘ s L a n e

9

0001001

0100010

34



1000010 1101111 1100010 0100001 1000011 1101111 1101101 1100101 1110100 1101111 0100010 0110100 0111000 0101111 1000001

A Rotation Based Encryption Technique Using Symmetric Key Method

27

Table 4 Decryption of those characters whose positions match with the space position array Character fetched

ASCII value

Position of character

Single digit position after folding method

Single digit position—ASCII value

Decoded character

“ ‘ # & # $

34 39 35 38 35 36

2 7 12 15 21 31

2 7 3 6 3 4

32 32 32 32 32 32

Space Space Space Space Space Space

Fig. 2

Fig. 3

Fig. 4

28

S. Chandra et al.

5 Conclusion Symmetric key cryptography technique is a simplest way of transferring data securely through a communication channel. This paper presents new symmetric key cryptography algorithms that have some unique characteristics to secure the transmitted data. It employs the bitwise circular rotation mechanism along with the folding logic. The alternate 7-bit left and right shift encryption/decryption technique increases the strength of this algorithm. The shared link that has been used here is a ciphered key that can communicate through any type of channel without allowing the man to attack at the middle. The ciphered key thus ensures the integrity and authenticity of the message. The algorithm consumes less power compared to the asymmetric counterpart.

References 1. Alam, S.S., Bhattacharyya, S., Chandra, S.: A novel image encryption algorithm using hyper-chaos key sequences, multi step group based binary gray conversion and circular bit shifting logic. In: IEEE International Conference of Science Engineering and Management Research (ICSEMR) 2014, IEEE Xplore Digital Library, Print ISBN:978-1-4799-7614-0 2. Soltani, M.: A new secure cryptography algorithm based on symmetric key encryption. J. Basic Appl. Scient. Res. 3(7), 465–472 (2013). ISSN:2090-4304 3. www.webopedia.com/TERM/S/symmetric_key_cryptography.html 4. www.algorithmic-solutions.info/leda_manual/symmetric_key_cryptography.html 5. Chandra, S., Paira, S., Alam, Sk.S., Sanyal, G.: A comparative survey of symmetric and asymmetric key cryptography. In: IEEE International Conference on Electronics, Communication and Computational Engineering(ICECCE 2014), pp. 83–93 (2014) 6. mrajacse.files.wordpress.com/2012/01/applied-cryptography-2nd-ed-b-schneier.pdf 7. Shyamala, C.K., Harini, N., Padmanabhan, T.R.: Cryptography and Security, 2nd edn. Wiley India Pvt. Ltd. (2012) 8. Forouzan, B.A.: Cryptography & Network Security, Special Indian Edition. Tata McGraw-Hill (2007) 9. Surya, E., Diviya, C.: A Survey on Symmetric Key Encryption Algorithm. Int. J. Comput. Sci. Commun. Netw. 2(4), 475–477 10. Mandal, B., Chandra, S., Alam, Sk.S., Sekhar Patra, S.: A comparative and analytical study on symmetric key cryptography. In: IEEE International Conference on Electronics, Communication and Computational Engineering (ICECCE 2014), pp. 131–136 (2014) 11. Chandra, S., Bhattacharyya, S., Paira, S., Alam, S.S.: A study and analysis on symmetric cryptography. In: IEEE International Conference of Science Engineering and Management Research (ICSEMR) 2014, IEEE Xplore Digital Library, Print ISBN:978-1-4799-7614-0 12. Kahate, A.: Cryptography and Network Security, 2nd edn. Tata McGraw-Hill (2009)