You are on page 1of 5

2015 International Conference on Advances in Computer Engineering and Applications (ICACEA)

IMS Engineering College, Ghaziabad, India

Implementation of New Encryption Algorithm with


Random Key Selection and Minimum Space
Complexity
Md Asif Mushtaque Harsh Dhiman
Galgotias University Galgotias University
Gr. Noida, India Gr. Noida, India
asifmushtaque000@gmail.com hharshdhiman@gmail.com

Abstract—In this paper, we proposed our new symmetric key network security and cryptography is a big research area where
encryption algorithm with reduced space complexity (AM the people always try to design some new algorithm one after
Encryption Algorithm- AMEA). According to disk encryption another to protect data against unauthorized people.
theory an encryption technique should use less than or equal to the Cryptography algorithm generally divided into two parts (i)
size of the original file size. There are two most important Symmetric Key Algorithm- In this technique a single key is used
parameters or characteristics of algorithm time and space. An by sender as well as receiver [1]. Symmetric key provides
algorithm should require minimum time to perform their function encryption faster but sometimes it is easy to break the key of this
and should have minimum space complexity (space complexity in algorithm because of simple key management. There are two
terms of storage space after the encryption or the storage space
types of symmetric key encryption algorithm, stream cipher and
required to store ciphertext). Different types of algorithm has been
designed some of them provides better security but the space
block cipher and (ii) Asymmetric key Algorithm- it is also known
complexity of all existing algorithm is high. So, we proposed a new as public key cryptography algorithm it uses two different types
cryptographic algorithm based on symmetric key stream cipher of key for cipher and deciphering. Public key cryptography
that provides better security with minimum space complexity. This provides more security in comparison to symmetric key but it is
algorithm is not same as previous stream cipher algorithm (the slower than symmetric key. In public key cryptography the
most commonly used RC4) it has some new features such as public key is known by everyone while the private key is known
Random Key Selection with transposition that provides better by the authorized people and it must be kept secret, public key
security. and private key both are mathematically interrelated to each
other. Nowadays theft of data over network increasing at very
Keywords—Space complexity, Cryptography Algorithm, high speed so there are different types of encryption algorithm
Symmetric key, Network security, Random key generation, AES, has been developed like AES, DES, TDES, Blowfish RC6 etc.
Random key selection. and all these algorithm has its own merits and demerits. Due to
lack of channel capacity and to save disk space it is very
I. INTRODUCTION important that the encryption technique should not require space
more than the size of plain text [2]. For this, many authors have
Encryption is very important technique to provide
proposed their idea to reduce the size of encrypted data but all
confidentiality while transmitting data over wireless medium,
has some disadvantage and no one has been successfully
because wireless mediums are an open channel where
implemented. In this paper, we proposed a new symmetric key
information can easily accessed or altered by unauthorized
encryption algorithm that provides better security and requires
peoples. On the wireless channel there is no any guarantee that
minimum space in comparison to its related algorithms.
the data cannot be accessed by another person on wireless
channel, so security is very big challenge to protect data over
wireless network. It may be very dangerous when any person II. RELATED WORK
wants to send their confidential data over the network such as: Security and Space both are very important issues because of
Bank_Statement, Bank_Transaction or any other important theft and congestion on network. In [3], author shows that how
information. a person is sending some confidential data from one much space is needed by symmetric key encryption algorithm
point to another point then those information should not be and gave their idea to reduce the size of encrypted data; author
accessed by unauthorized person the information should be says that we can perform only XOR operation so it is not more
protected from hacker. Because of security problem today secure technique. In [7], authors have proposed an encryption
978-1-4673-6911-4/15/$31.00©2015 IEEE

507
2015 International Conference on Advances in Computer Engineering and Applications (ICACEA)
IMS Engineering College, Ghaziabad, India

algorithm using wavelets transform technique for image B. Random Key Selection
encryption. Archana.V.Nair.S [8] has proposed an encryption AM Encryption Algorithm contains two different keys after
algorithm using arithmetic coding but author says that using random key generation function. Now the main task of RKS is to
arithmetic coding there is problem in decryption it is not easy to select any one key between two keys as key1 and key2. It takes
find accurate character when digits are rounded. Many authors two keys as an input and converts them into equivalent binary,
have gave their idea that that we can use arithmetic coding to after converting find the LSB of both keys and compare their
reduce the size of encrypted data, if we use arithmetic coding LSB. If LSB of both keys are equal then select key1 otherwise
then it reduces the size of cipher text but it makes algorithm to select key2 to perform encryption. RKS also provides better
slow and there is need to use extra memory space and the security against attacks because attacker does not know which
performance would be very slow. Existing algorithms such as key is used for encryption. This function is performed in each
AES, DES, TDES, RC4, RC6 and Blowfish need some extra round.
space for encrypted data.
C. Transposition of the Key
III. PROPOSED WORK Transposition is a function or method through which the
In this section we discussed a new encryption algorithm with character of the key is replaced by another character of the key.
reduces space complexity and provides high security. This is a The character is shifted based on regular system. When the key is
symmetric key stream cipher algorithm and this is not similar to selected by random key selection function then algorithm applies
other symmetric key encryption algorithm. There are two major transposition function with the key. To transpose the key,
operations are performed in proposed algorithm Random Key algorithm first finds the random number and then calculate sum
Generation and Random Key Selection which makes this of total of random number. When sum is calculated then
algorithm secure. In previous stream cipher algorithm RC4 where according to the number in summation algorithm replace the
a random bit is added in cipher text for security purpose that character of the key. For Example, if the value of sum is “3214”
takes extra space but in this algorithm we enhance security using and the key value is “adsetguim” then character ‘a’ is
random key generation and random key selection and do not interchanged by the character on (3-1) = 2nd position in the key,
require any extra space for encrypted data. This algorithm ‘d’ is interchanged by the character on (2-1)=1st position in the
performs variable processing rounds of encryption, the number of key, after 4th character repeat with the same value of summation.
rounds depends on the length of the key and in each round we are
generating random key and then encrypt data using random key. IV. PROPOSED ALGORITHM (AMEA)
Using random key generation this algorithm provides better
security because it is impossible to predict the new key in each A. Algorithm for Encryption/Decryption
round, after performing Random key generation function
proposed algorithm has two different keys. Now in random key Step 1: read plaintext
selection function it is decided that which key should use for Step 2: Enter key as key1 and initialize Round as 0.
encryption. Step 3: Find the length of the key L.
Step 4: Call transpose function // Algorithm defined below
There three main processes in AMEA (A) Random Key Step 5: while R<= L/2
Generation (B) Random Key Selection and (C) Transposition. ¾ Obtain new key from random_key_generation function
as key2.
A. Random Key Generation ¾ Call random_key_selection (key1, key2)
AM Encryption Algorithm performs many rounds, in each ¾ Now key= selected key from random key selection
round random key generation generates random key from the ¾ Now call transpose function(key)
previous key by performing some mathematical calculation. ¾ Obtain final key to encrypt/ decrypt
After generating random key this algorithm contains two Step 6: perform Exclusive-or operation with transposed key
different key the first one is previous key and second is the and plaintext/cipher
newly generated key. The idea behind the generating of two Step 7: R=R+1
different key is that if any one try to crack the key then it is Step 8: Stop.
impossible to predict the key in each round. Random key is B. Algorithm for Random Key Generation
generated by using the ASCII value and the position of each
Step 1: read the key sent as a parameter (Key1)
character in the key then apply random function with some
Step 2: Find the length of key1
operation on matrix. Briefly describe in the example.
Step 3: Now reverse key1 by using reverse function, new
reversed key is termed as in rev_key.
Step 4: Convert each character of key1 in its equivalent ASCII
code.

508
2015 International Conference on Advances in Computer Engineering and Applications (ICACEA)
IMS Engineering College, Ghaziabad, India

Step 5: Calculate total number of random_value = L, Rand(Max) 97*1+104*2+99*3+53*4+105*5+57*6+48*7+119*8+52*9=


Max= ∑ASCII * Sequence of each character. 3437
Step 6: Find the sum of total random_value Calculate 9 random values between 0-3437 and calculate the
Step 7: Find mod of sum_of_random, M= sum of total random values
Mod(sum_of_random, l) M= Mod (random-No, L) = 8
Step 8: Apply matrix on key1 and rev_key Now using matrix to represent key1 and rev_key
Step 9; Add ‘M’ to each bit of matrix _key1.
Step10: Apply XOR operation with matrix_rev_key and Step (1): matrix of key1 (mat_key1)
matrix_key1. a h c 97 104 99
Step11: Obtained new matrix as new_matrix. 5 i 9 53 105 57
Step12: Convert binary of new_matrix to change into character
and stored in new matrix (Key2). 0 w 4 48 119 52
Step13: return two keys (key1, key2) Step (2): matrix of revese_key (revmat_key1)
4 w 0 52 119 48
C. Algorithm for Random Key Selection
Step 1: Read two keys from random key generation 9 i 5 57 105 53
Step 2: Convert each character of key1 and key2 into its c h a 99 104 97
equivalent ASCII
Step 3: multiply each ASCII with the value ‘M’ (M obtained in Step (3): add mod value to mat_key1
RKG) 105 112 107
Step 4: convert into binary. 61 113 65
Step 5: Find the Least Significant Bit of both keys as LSB1 and 56 127 60
LSB2
Step 6: If LSB1= = LSB2
Step (4): Xor mat_key1 with revmat_key1
¾ Select key1 and
105 112 107 52 119 48
¾ Call transpose function (key1) //calling transpose
function with key1 61 113 65 57 105 53
Else 56 127 60 99 104 97
¾ Select key2
¾ Call transpose function (key2) //calling transpose Step (5): New_matrix after Xoring
function with key2 93 7 91
Step 7: Stop.
4 24 116
D. Algorithm for Transposition 91 23 93
Step 1: Read selected key as key1
Step 2: Read sum= sum_of_random Step (6): New_Key as key2
Step 3: Read each character of sum individually
] BEL [
Step 4: The character of the key1 is interchanged with the
character indexed on the (value-1) of corresponding EOT CAN T
number in sum.
Step 5: Increase the index of key1 and sum by 1. [ ETB ]
Step 6: Repeat the step 4 and 5 until the last index of the key
Step 7: finally obtain the key to encrypt and decrypt. Now calling Key_Selection Function where
Step 8: Stop. Key1=
a h c 5 i 9 0 w 4
V. EXAMPLE OF PROPOSED ALGORITHM (AMEA)
And Key2=
A. Example of Random Key Generation ] BEL [ EOT CAN T [ ETB ]
Suppose key1= ahc5i90w4, apply reverse function on key1, then
Rev_key=4w09i5cha, L=9
Random-No= ∑ASCII * sequence (key1), Convert both keys into its equivalent ASCII and then in Binary

509
2015 International Conference on Advances in Computer Engineering and Applications (ICACEA)
IMS Engineering College, Ghaziabad, India

ASCII of key1= 97, 104, 99, 53, 105, 57, 48, 119 and 52
ASCII of Key2= 93, 7, 91, 4, 24, 116, 91, 23 and 93 2nd character with (3-1) =2 that means character will remain
Convert these ASCII value into its binary and then find the LSB same, 3rd with (7-1)=6
of the whole key (not for a single character individually) Now the key is finish so we will repeat the same process from
LSB of Key1= 0 and LSB of Key2=1 first value of the sum and the rest character of the key. So 4 th
If (LSB1= = LSB2) character will be interchange with (3-1)=2, and 5th character
Send Key1 to transpose with (4-1)=3.
Else ] EOT ] [ CAN t BEL ETB ]
send Key2 to transpose
In this example, LSB1 and LSB2 are not equal to Key2 is
selected to transpose.
] EOT CAN t ] [ BEL ETB ]

B. Exampe of Transposition Now, 6th is interchanged with (3-1) =2, 7th is interchanged with
(7-1)=6 and 8th character with (3-1)=2
According to Algorithm
] EOT CAN t ] [ BEL ETB ]
Suppose Sum_of_random= 3437
Selected key is key2, where Key2=
] BEL ] EOT CAN t [ ETB ]
] EOT BEL t ] [ ETB CAN ]
Final Key after transposition= key
Now transpose the first character of the key indexed on 0th
indexed will be interchanged with the character indexed on (3-1) ] EOT ] t ] [ ETB CAN BEL
=2, 1st character of the key with (4-1) =3, Now after the
composition of two characters the key would be like this.
Now perform Exclusive-or operation with key and plaintext to
] EOT ] BEL CAN t [ ETB ] encrypt and key with cipher text to decrypt.

TABLE I. ENCRYPTION PROCESS OF AM - ENCRYPTION AGORITHM (AMEA)

Process of Encryption Algorithm


#Rounds Key1 Key2 PlainText/ Selected Key Transposition Cipher text
Ciphertext (Expected)
1 345abcr56 123hij/(8 abcdefghi 345abcr56 *k7=1ol)] Pe8&i@s%f
2 345abcr56 76{-/kf”1 Pe8&i@s%f 76{-/kf”1 #y$iu7|0^ 8m1s+-#ny
3 76{-/kf”1 H7N()o52 8m1s+-#ny H7N()o52 H6k_=u79y [9T{\ku7?

4 H7N()o52 Ef6%}(!l8 Ty7^k9-!/ H7N()o52 I01By%U>0 L9H5?<)8}

previous encryption technique performs same algorithm in


Above table describes each steps of proposed reverse order or uses key in reverse order then decrypt the
algorithm. In the above example we used a key whose encrypted data but AMEA allows user to use same process
length is 72 bits. The key length is 9 bytes so there are 4 for Encryption and decryption as well. This algorithm is not
number of processing rounds performed by this algorithm. for fixed size key, it supports different size of key, like 4, 9,
The above table shows how second key is generated and 16 and so on but the length of the key should be square of
selected by proposed algorithm. If we change key in each any natural number. The total number of rounds for
round according to the above example, so in this case it is encryption and decryption is totally depend on the length of
difficult for hacker to find the next key and also very the key. Suppose (1) size of the key is 32 bits it executes 2
difficult to check or decide which key is used for ciphering. rounds of encryption and decryption, (2) size of the key is
This algorithm is one way encryption algorithm means there 72 bits it executes 4 rounds.
is no needs to perform reverse process for decipher. All the Total_No_of_Rounds = key_length(in bytes)/2.

510
2015 International Conference on Advances in Computer Engineering and Applications (ICACEA)
IMS Engineering College, Ghaziabad, India

VI. EXPERIMENTAL RESULT computing (provides congestion control and data security
This section shows the result given by AM- Encryption between users and sever because multiple user access same
Algorithm and also shows how much space is required for server at the same time). Banking, Online Payment gateway,
cipher text in comparison to another encryption technique. E-Commerce. One of the most important feature that makes
this algorithm better is that in proposed technique it is
TABLE II. EXPERIMENTAL RESULT OF AMEA impossible to crack by hacker or unauthorized user without
knowledge of original key used for encryption, because
Size of plaintext, encrypted fie and Decrypted file
random_key_generation and random_key_selection and
Sr. No. Size of Size of transposition is calculated by performing some calculation
Size of plaintext Encrypted Decrypted
file file
on that original key.
1 180 KB 180 KB 180 KB ACKNOWLEDGMENT
2 230 KB 230 KB 230 KB I would like to thank to my parents, friends, Proof
3 490 KB 490 KB 490 KB Readers, and my respected guide. My thanks also goes to
4 1890 KB 1890 KB 1890 KB Mr. Tauqir Azam for their support in every step of my
2480 KB 2480 KB 2480 KB
career. He always guided and motivated me to complete this
5
research paper.
6 3256 KB 3256 KB 3256 KB
REFERENCES
TABLE III. COMPARISION OF PROPOSED ENCRYPTION ALGORITHM [1] M. A. Tiwari, C. Parakash and AK. Mandal, “Performance Evaluation
WITH MOST COMMON ENCRYPTION ALGORITHM
of Cryptographic Algorithms: DES and AES”, 2012 IEEE Student’s
Comparison of AMEA with other Encryption Conference on Electrical, Electronics and Computer Science.
Algorithm [2] http://en.wikipedia.org/wiki/Disk_encryption_theory accessed on
Encryption 24th April 2014.
Size of Size of
Algorithms [3] V. Singh and S. K. Dubey, “Analyzing Space Complexity Of Various
Size of plaintext Encrypted Decrypted
file file Encryption Algorithms”, International Journal of Computer
Engineering and Technology (IJCET), Volume 4, Issue 1, January-
DES 260 KB 376 KB 260 KB February (2013).
TDES 260 KB 720 KB 260 KB [4] A. Ramesh and Dr. A. Suruliandi, “Performance Analysis of
260 KB 1034 KB 260 KB Encryption Algorithms for Information Security”, 2013 International
AES
Conference on Circuits, Power and Computing Technologies, IEEE,
Blowfish 260 KB 1088 KB 260 KB 2013.
Twofish 260 KB 1034 KB 260 KB [5] Amit Pande, Joseph Zambreno and Prasant Mohapatra, “Joint V ideo
AMEA Compression and Encryption using Arithmetic Coding and Chaos”,
260 KB 260 KB 260 KB 978-1-4244-7932-0/10, IEEE,2010.
(Proposed
Algorithm) [6] William Stallings, Cryptography and Network Security: Principles
and Practice 5th Edition-2010, p.p 66-174.
[7] Nidhi Sethi and Deepika Sharma, “A Novel Method Of Image
VII. CONCLUSION AND FUTURE SCOPE Encryption Using Logistic Mapping”, International Journal of
Computer Science Engineering, Vol. 1 No.02 November 2012.
After performing this algorithm with different file [8] Archana.V.Nair.S, G.Kharmega Sundararaj and T. Sudarson Rama
having different size we found that proposed algorithm does Perumal, “Simultaneous Compression and Encryption using
not require extra space for encrypted file in comparison to Arithmetic Coding with Randomized bits”, International Journal of
Computer Technology and Electronics Engineering (IJCTEE),
existing algorithm. We have already compared AMEA with Volume 2, Issue 2, April 2012.
some symmetric key encryption technique and found that [9] Dr. R. Umarani, G. Ramesh and E. Thambiraja, “A Survey on
AMEA is better than compared algorithm. This algorithm is Various Most Common Encryption Techniques”, International
not best in only space complexity, it also provides better Journal of Advanced Research in Computer Science and Software
Engineering, Volume 2, Issue 7, July 2012.
security feature by using random key selection and
[10] Md Asif Mushtaque and Mr. Khushal Singh, “Feasibility Evaluation
transposition features. After all the above comparison and of Symmetric Key Encryption Techniques for Wireless Channel and
proposed result this algorithm is better than the existing Disk Storage”, IJRASET, Vol. 2 Issue V, May 2014.
technique according to [2] which says that any encryption [11] Tingyuan Nie, Yansheng Li and Chuanwang Song, “Performance
technique should use less or equal space for cipher text. Evaluation for CAST and RC5 Encryption Algorithms”, International
Proposed technique is also good for network bandwidth and Conference on Computing, Control and Industrial Engineering, IEEE,
2010.
provides faster transmission on network channel by
[12] Anjali Patil, Rajeshwari Goudar, “A Comparative Survey of
reducing congestion on transmission medium. AMEA is Symmetric Encryption Techniques for Wireless Devices”,
good for minimum bandwidth channel whose transmission International Journal Of Scientific & Technology Research Volume 2,
capacity is limited, so we can easily transmit our data from Issue 8, August 2013.
one point to another within less time because this algorithm
does not increase the size of encrypted file. There are
different Application areas for this algorithm. Such as: cloud

511

You might also like