Analysing space complexity of various encryption algorithms 2
Upcoming SlideShare
Loading in...5

Analysing space complexity of various encryption algorithms 2






Total Views
Views on SlideShare
Embed Views



0 Embeds 0

No embeds



Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

    Analysing space complexity of various encryption algorithms 2 Analysing space complexity of various encryption algorithms 2 Document Transcript

    • INTERNATIONALComputer EngineeringCOMPUTER ENGINEERING International Journal of JOURNAL OF and Technology (IJCET), ISSN 0976- 6367(Print), ISSN 0976 – 6375(Online) Volume 4, Issue 1, January- February (2013), © IAEME & TECHNOLOGY (IJCET)ISSN 0976 – 6367(Print)ISSN 0976 – 6375(Online)Volume 4, Issue 1, January- February (2013), pp. 414-419 IJCET© Impact Factor (2012): 3.9580 (Calculated by GISI) © ANALYSING SPACE COMPLEXITY OF VARIOUS ENCRYPTION ALGORITHMS Vikendra Singh1, Sanjay Kumar Dubey2 Amity School of Engineering, Amity University, Noida Uttar Pradesh, India ABSTRACT Information security has become an important issue in the modern era as fast as technology is going to increase. This can be solved by the concept of cryptology and many encryption algorithms are developed to protect data such XOR, Blowfish, DES and Triple DES but all these have own advantages and disadvantage in terms of space, time and security. It is well known if the information has less memory space then it can be send easily and in less time from one place to another. In this paper, we analyze the space complexity of the algorithms to run to completion and describe a comparative view of four encryption algorithms named XOR, DES, Triple-DES and Blowfish. We can measure the space by finding out that how much memory will be consumed by the instructions and by the variables used and also to find the best algorithm which takes less space. Keywords: cryptology, XOR, Blowfish, DES, Triple-DES, space complexity. 1. INTRODUCTION The concept of cryptology is the combine form of cryptography and crypto analysis. Cryptography means hidden writing, the practice of using encryption and decryption process. Encryption is the process of converting plain text (message) to hidden or some another form called cipher text and decryption is the process of finding the original message from cipher text. Crypto analysis studies encryption and encrypted message, with the goal of finding the hidden meaning of the messages. 414
    • International Journal of Computer Engineering and Technology (IJCET), ISSN 0976-6367(Print), ISSN 0976 – 6375(Online) Volume 4, Issue 1, January- February (2013), © IAEME Information cipher text Decryption original information Encryption Fig 1: Encryption/Decryption processIn the present era there is cybercrime and thefts of information are increasing at very highspeed. Thus the concept of data/information security becomes very critical. If a person wantsto send any confidential information from one place to another place, he has a fear about theunauthorized access of information. So, for this, there are many encryption algorithms aredeveloped one after another such as XOR, Blowfish, DES, Triple DES and all has its ownadvantages and disadvantages in terms of space, time and security.2. LITERATURE SERVEY In this paper, the author describes that the XOR encryption technique is appropriatefor binary signals and it encrypts each pixel (bit) individually [1, 2]. This method is made byusing of XOR Boolean operator, defined for binary inputs. The applied XOR logic returnstrue if one of the values is True and the others XOR True is False, but True XOR False isTrue.XOR Encryption:TO encrypt a message to be sent, the characters in message are XORed with the key Encrypted = Message XORop KeyXOR Decryption:To decrypt a received message, characters of the encrypted message are XORed with thesame key : Message = Encrypted XORop KeyA secret-key cipher Blowfish iterates an encryption function about 16times [3, 4]. This cipheris a symmetric 8-bytes block. Some key expansion use eighteen 32-bit sub keys [10, 11] anda data encryption uses a 16-round Feistel Network [9]. Key dependent Permutation isoccurred in each round. Blowfish has 16 rounds.According to [10, 11], the input is a 64-bit data element, X. Divide X into two 32-bit halves:XL, XR Then, for i = 1 to 16: a) XL = XL XOR Pi b) XR = F(XL) XOR XRSwap XL and XR After the sixteenth round, swap XL and XR again to undo the last swap.Then, XR = XR XOR P17 and XL = XL XOR P18. Finally, recombine XL and XR to get thecipher text. The outputs are added modulo 232 and XORed to produce the final 32-bit output. 415
    • International Journal of Computer Engineering and Technology (IJCET), ISSN 0976-6367(Print), ISSN 0976 – 6375(Online) Volume 4, Issue 1, January- February (2013), © IAEMEIn this paper, the author explained that DES is a 64 bit block cipher [4, 7] which means that itencrypts data 64 bits at a time. The plaintext block is taken in and put through an initialpermutation. The key is also taken in at the same time. The key is presented in a 64-bit blockwith every 8th bit being a parity check. The 56-bit key is then extracted ready for use. The64-bit plaintext block is split into two 32- bit halves, named the right half and left half. Thetwo halves of the plaintext are then combined with data from the key in an operation calledFunction F. There are 16 rounds of Function f, after which the two halves are recombinedinto one 64-bit block, which is then put through a final permutation to complete the operationof the algorithm and a 64-bit cipher text block is outputted. The key length is 56 bits[7]. i. To encrypt plain text (P) with key (k1) then produces cipher text (C) C = Enk1 (P) ii. To decrypt cipher text (C) with key (k1) then produces plain text (P) P = Dnk1 (C)A TDES [7, 8] mode of operation is backward compatible with its single DES counterpart if,with compatible keying options for TDES operation- i. An encrypted plaintext computed using a single DES mode of operation can be decrypted correctly by a corresponding TDES mode of operation [8, 12] and ii. An encrypted plaintext computed using a TDES mode of operation can be decrypted correctly by a corresponding single DES mode of operation [8, 12].Triple DES encryption: I→ DES (Encryption)K1 →DES (Decryption)K2 →DES (Encryption)K3 →OTriple DES decryption: I→ DES (Decryption)K3 →DES (Encryption)K2 →DES (Decryption)K1 →O3. EXPERIMENTAL STUDYAfter studying about above encryption techniques and then writes into steps which are-3.1 XOR algorithmThe XOR algorithm takes information convert into ASCII and then hexadecimal, then octal.Same is performed to key and then XORing is performed bit by bit.Encryption is done by: i. Input any plaintext ii. Convert into ASCII representation of that plaintext iii. Convert in Hexadecimal representation iv. Convert in Binary equivalent representation v. XOR with key which is converted same as plaintext vi. Obtained ciphertextDecryption is done by: i. Take cipher text ii. XOR with the same key iii. Convert obtained binary code to hexadecimal code iv. Convert in ASCII code v. Obtain plaintext 416
    • International Journal of Computer Engineering and Technology (IJCET), ISSN 0976-6367(Print), ISSN 0976 – 6375(Online) Volume 4, Issue 1, January- February (2013), © IAEME3.2 Blowfish algorithmEncryption and Decryption Algorithm:Blowfish allows an encryption key that ranges from 32 bits up to 448 bits [3, 4]. The algorithm isdesigned: 1. Take X=input(0-64) bits. 2. Divide X it into two equal halves such that 3. XL =input(0-31) 4. XR =input (32-63). 5. For i= 1 to 15 6. Li=Li-1 7. Compute F(XL)=((S1,a + S2,b mod232) XOR S3,c) + S4,d 8. XR = XL XOR XR 9. Swap XL and XR 10. XL = XL XOR P18 11. XR = XR XOR P17 12. output = combined result of L and R 13. return outputf-Function- f-function uses s-boxes and it can be implemented into following steps- 1. Get input 2. L = input[0-15] 3. R = input[16-31] 4. Centre Lc = input[8-15] 5. Centre Rc = input[16-23] 6. L = S-Box(L) (note that the result of the S-Box is a 32 bit data stream) 7. centre Lc = S-Box(centre Lc) 8. centre Rc = S-Box(centre Rc) 9. R = S-Box(R) 10. L = L + centre Lc (note: this is mod 232 addition) 11. L = L XOR centre Rc 12. L = L + R 13. return L3.3 DES algorithm- DES is a 64 bit block cipher [4, 7] which means that it encrypts data 64 bits at atime. The plaintext block is taken in and put through an initial permutation. 1. Input plain text A={} 2. Divide A into n blocks of 64 bits. 3. For each blocks i=0 to n-1 4. Calculate initial permutation IP and 5. Divided into two parts 6. L0 left sub part 7. R0 right sub part 8. Round i has inputs Li-1, Ri-1 9. Output will be Li = Ri-1, Ri= Li-1 XOR f(Ri-1,Ki) 10. Ki is the sub key for the ith round, where 1≤ i ≤16. 11. After round 16, Swap L0 and R0//so that the decryption algorithm has the same structure as the encryption algorithm.// 12. Finally, compute IP-1 13. Output = cipher text 417
    • International Journal of Computer Engineering and Technology (IJCET), ISSN 0976-6367(Print), ISSN 0976 – 6375(Online) Volume 4, Issue 1, January- February (2013), © IAEME3.4 Triple DESEncryption is done by- C= (Encryption)k3((Decryption)k2((Encryption)K1(I))).withDecryption is done by:I= ((Decryption)K1 ((Encryption)K2 ((Decryption)K3(C))) I… information C ... cipher text ki ... key and i is iterationWhere Encryption and Decryption are DES encryption and DES decryption.4. RESULT ANALYSIS We can analyze from below graph that XOR algorithm which convert plaintext into ASCIIvalue and after that convert in hexadecimal and then binary after that XORing with key which is tooeasy. While in Blowfish technique, first divide plaintext 64 bits blocks and then divide into left andright halves and use iterative process using 8- 448 with 16 Feistel round with s-boxes [9, 10, 11] dueto which it takes more space then XOR, DES and TDES. Algorithm Before encryption After encryption After Decryption XOR 130 KB 130 KB 130 KB DES 130 KB 188 KB 130 KB Triple-DES 130 KB 360 KB 130 KB Blowfish 130 KB 544 KB 130 KB Table 1. comparison of space complexity of various encryption algorithmDES with 56 key also uses 16 Feistel rounds with permutation [9] which takes less space thanBlowfish but more than XOR and TDES which is a variation of DES uses 168 key, takes more spacethan DES and XOR but less than Blowfish.Suppose, we are encrypting same file with different encryption techniques then results are: 6 5 4 original file 3 before encryption 2 after decryption 1 0 XOR DES TDES BlowFish Fig. 2 comparison of various algorithms in terms of space 418
    • International Journal of Computer Engineering and Technology (IJCET), ISSN 0976-6367(Print), ISSN 0976 – 6375(Online) Volume 4, Issue 1, January- February (2013), © IAEMECONCLUSION AND FUTURE SCOPE On the basis of the implementation and results, it can be noticed that XOR technique isfast but very simple and require less space to store intermediate cipher text approximately sameas original plaintext while DES and TDES are advance technique then XOR, fast and more securedue to long length key varies to 56 bits in DES and 168 bits in TDES but more space complexitydue to varies key length and 16 Feistel rounds with permutation at each round. While Blowfish ismuch fast then DES and TDES because it uses S-boxes in 16 Feistel rounds but has more spacecomplexity then these three but overall TDES is more secure and technique can be chosenaccording to requirement. XOR algorithm can be enhanced twice and more time like Triple DESbecause it less secure and takes less space than other. The space complexity of these algorithmscan be compared with other algorithm such as RSA, AES.REFERENCES[1] Ralf Kusters and Tomasz Trundrerung, “Reducing Protocol Analysis with XOR to the XOR-free Case in the Horn Theory Based Approach”, ACM 978-1-59593-810, October, 2008, Alexandria,Virginia, USA.[2] Majdi Al-qdah and Lin Yi Hui, “Simple Encryption/Decryption Application”, InternationalJournal of Computer Science and Security (IJCSS-4), Volume (1), December 2011.[3] Rasheed Mokhtar Ahmed, Adel Zaghlul Mahmoud, “An Implementation of High Securityand High Throughput Triple Blowfish Cryptography Algorithm”, IJRRSAP Vol. 2, No. 1, ISSN:2046-617X, March 2012.[4] Jawahar Thakur and Nagesh Kumar, “DES, AES and Blowfish: Symmetric KeyCryptography Algorithms Simulation Based Performance Analysis”, International Journal ofEmerging Technology and Advanced Engineering, ISSN 2250-2459, Volume 1, Issue 2, December2011.[5] Russell K. Meyers and Ahmed H. Desoky,” An Implementation of the BlowfishCryptosystem”, IEEE- 978-1 -4244-3555-5/08, 2008.[6] M. Anand Kumar and Dr. S. Karthikeyan, “Investigating the Efficiency of Blowfish andRejindael (AES) Algorithms”, I. J. Computer Network and Information Security, 2012, 2, 22-28 inMECS, March 2012.[7] Kruti R. Shah, Bhavika Gambhava, “New Approach of Data Encryption StandardAlgorithm”, International Journal of Soft Computing and Engineering (IJSCE) ISSN: 2231-2307,Volume-2, Issue-1, March 2012.[8] Shashi Mehrotra Seth and Rajan Mishra, “Comparative Analysis of Encryption Algorithmsfor Data Communication”, ISSN: 2229-4333, IJCST Vol. 2, Issue 2, June 2011.[9] C. Adams, “The Shade Cipher: An Efficient Hash Function Based Feistel Network”, IEEE,ISSN: 0-7803-3716-6 /97, JUNE, 1997.[10] S. M. Dehnavi, M. R. Mirzaee Shamsabad, A. Mahmoodi Rishakani and Einollah Pasha,“Generalization of Statistical Criteria for Sboxes”, IEEE, 978-1-4673-2386-4/12, May2012.[11] Anthony Lineham and T. Aaron Gulliver, “Heuristic S-box Design”, ContemporaryEngineering Sciences, Vol. 1, no. 4, 147 – 168, 2008.[12] Prasun Ghosal, Malabika Biswas and Manish Biswas, “A Compact FPGA Implementation ofTriple DES Encryption System with IP Core Generation and On-Chip Verification”, Proceding of the2010 International Conference on Industrial Engineering and Operation Management, Dhaka,Bangladesh, January 9-10-2010.[13] Shiwani Singh, Tripti Sharma, K. G. Sharma and Prof. B. P. Singh, “New Design Of LowPower 3T XOR Cell” International journal of Computer Engineering & Technology (IJCET), Volume3, Issue 1, 2012, pp. 76 - 80, ISSN Print: 0976 – 6367, ISSN Online: 0976 – 6375, Published byIAEME. 419