Mais conteúdo relacionado Semelhante a Analysing space complexity of various encryption algorithms 2 (20) Mais de IAEME Publication (20) Analysing space complexity of various encryption algorithms 21. 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
© IAEME:www.iaeme.com/ijcet.asp
Journal Impact Factor (2012): 3.9580 (Calculated by GISI) ©IAEME
www.jifactor.com
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
2. 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 process
In the present era there is cybercrime and thefts of information are increasing at very high
speed. Thus the concept of data/information security becomes very critical. If a person wants
to send any confidential information from one place to another place, he has a fear about the
unauthorized access of information. So, for this, there are many encryption algorithms are
developed one after another such as XOR, Blowfish, DES, Triple DES and all has its own
advantages and disadvantages in terms of space, time and security.
2. LITERATURE SERVEY
In this paper, the author describes that the XOR encryption technique is appropriate
for binary signals and it encrypts each pixel (bit) individually [1, 2]. This method is made by
using of XOR Boolean operator, defined for binary inputs. The applied XOR logic returns
true if one of the values is True and the others XOR True is False, but True XOR False is
True.
XOR Encryption:
TO encrypt a message to be sent, the characters in message are XORed with the key
Encrypted = Message XORop Key
XOR Decryption:
To decrypt a received message, characters of the encrypted message are XORed with the
same key :
Message = Encrypted XORop Key
A secret-key cipher Blowfish iterates an encryption function about 16times [3, 4]. This cipher
is a symmetric 8-bytes block. Some key expansion use eighteen 32-bit sub keys [10, 11] and
a data encryption uses a 16-round Feistel Network [9]. Key dependent Permutation is
occurred 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 XR
Swap 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 the
cipher text. The outputs are added modulo 232 and XORed to produce the final 32-bit output.
415
3. International Journal of Computer Engineering and Technology (IJCET), ISSN 0976-
6367(Print), ISSN 0976 – 6375(Online) Volume 4, Issue 1, January- February (2013), © IAEME
In this paper, the author explained that DES is a 64 bit block cipher [4, 7] which means that it
encrypts data 64 bits at a time. The plaintext block is taken in and put through an initial
permutation. The key is also taken in at the same time. The key is presented in a 64-bit block
with every 8th bit being a parity check. The 56-bit key is then extracted ready for use. The
64-bit plaintext block is split into two 32- bit halves, named the right half and left half. The
two halves of the plaintext are then combined with data from the key in an operation called
Function F. There are 16 rounds of Function f, after which the two halves are recombined
into one 64-bit block, which is then put through a final permutation to complete the operation
of 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 →O
Triple DES decryption:
I→ DES (Decryption)K3 →DES (Encryption)K2 →DES (Decryption)K1 →O
3. EXPERIMENTAL STUDY
After studying about above encryption techniques and then writes into steps which are-
3.1 XOR algorithm
The 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 ciphertext
Decryption 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
4. International Journal of Computer Engineering and Technology (IJCET), ISSN 0976-
6367(Print), ISSN 0976 – 6375(Online) Volume 4, Issue 1, January- February (2013), © IAEME
3.2 Blowfish algorithm
Encryption and Decryption Algorithm:
Blowfish allows an encryption key that ranges from 32 bits up to 448 bits [3, 4]. The algorithm is
designed:
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 output
f-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 L
3.3 DES algorithm- DES is a 64 bit block cipher [4, 7] which means that it encrypts data 64 bits at a
time. 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
5. International Journal of Computer Engineering and Technology (IJCET), ISSN 0976-
6367(Print), ISSN 0976 – 6375(Online) Volume 4, Issue 1, January- February (2013), © IAEME
3.4 Triple DES
Encryption is done by-
C= (Encryption)k3((Decryption)k2((Encryption)K1(I))).with
Decryption is done by:
I= ((Decryption)K1 ((Encryption)K2 ((Decryption)K3(C)))
I… information
C ... cipher text
ki ... key and i is iteration
Where 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 ASCII
value and after that convert in hexadecimal and then binary after that XORing with key which is too
easy. While in Blowfish technique, first divide plaintext 64 bits blocks and then divide into left and
right halves and use iterative process using 8- 448 with 16 Feistel round with s-boxes [9, 10, 11] due
to 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 algorithm
DES with 56 key also uses 16 Feistel rounds with permutation [9] which takes less space than
Blowfish but more than XOR and TDES which is a variation of DES uses 168 key, takes more space
than 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
6. International Journal of Computer Engineering and Technology (IJCET), ISSN 0976-
6367(Print), ISSN 0976 – 6375(Online) Volume 4, Issue 1, January- February (2013), © IAEME
CONCLUSION AND FUTURE SCOPE
On the basis of the implementation and results, it can be noticed that XOR technique is
fast but very simple and require less space to store intermediate cipher text approximately same
as original plaintext while DES and TDES are advance technique then XOR, fast and more secure
due to long length key varies to 56 bits in DES and 168 bits in TDES but more space complexity
due to varies key length and 16 Feistel rounds with permutation at each round. While Blowfish is
much fast then DES and TDES because it uses S-boxes in 16 Feistel rounds but has more space
complexity then these three but overall TDES is more secure and technique can be chosen
according to requirement. XOR algorithm can be enhanced twice and more time like Triple DES
because it less secure and takes less space than other. The space complexity of these algorithms
can 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”, International
Journal of Computer Science and Security (IJCSS-4), Volume (1), December 2011.
[3] Rasheed Mokhtar Ahmed, Adel Zaghlul Mahmoud, “An Implementation of High Security
and 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 Key
Cryptography Algorithms Simulation Based Performance Analysis”, International Journal of
Emerging Technology and Advanced Engineering, ISSN 2250-2459, Volume 1, Issue 2, December
2011.
[5] Russell K. Meyers and Ahmed H. Desoky,” An Implementation of the Blowfish
Cryptosystem”, IEEE- 978-1 -4244-3555-5/08, 2008.
[6] M. Anand Kumar and Dr. S. Karthikeyan, “Investigating the Efficiency of Blowfish and
Rejindael (AES) Algorithms”, I. J. Computer Network and Information Security, 2012, 2, 22-28 in
MECS, March 2012.
[7] Kruti R. Shah, Bhavika Gambhava, “New Approach of Data Encryption Standard
Algorithm”, 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 Algorithms
for 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”, Contemporary
Engineering Sciences, Vol. 1, no. 4, 147 – 168, 2008.
[12] Prasun Ghosal, Malabika Biswas and Manish Biswas, “A Compact FPGA Implementation of
Triple DES Encryption System with IP Core Generation and On-Chip Verification”, Proceding of the
2010 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 Low
Power 3T XOR Cell” International journal of Computer Engineering & Technology (IJCET), Volume
3, Issue 1, 2012, pp. 76 - 80, ISSN Print: 0976 – 6367, ISSN Online: 0976 – 6375, Published by
IAEME.
419