Volume 6, Issue 3, March 2016 ISSN: 2277 128X International Journal of Advanced Research in Computer Science and Software Engineering Research Paper Available online at: www.ijarcsse.com Special Issue on 5th National Conference on Recent Trends in Information Technology 2016 Conference Held at P.V.P. Siddhartha Institute of Technology Kanuru, Vijayawada, India A Simple with Chained Substitution G. Kavya, D. Sravanthi, Prof., N. Ravi Shankar C.S.E., L.B.R.C.E., Andhra Pradesh, India

Abstract - This paper describes a simple block cipher with chained substitution as the only operation. In this, a set of three substitution boxes were constructed, which are completely random in nature. The substitution process takes three characters in the first step and returns three respective replacements. In the second step, the last two characters of the previous step and a new character from the input stream are taken for substitution. In the third step, the last two characters of the previous operation and a new character from input stream will be submitted to the substitution process. This process continues till the input is exhausted. This cipher is designed for use in those circumstances where the lifetime of the is very short and the cipher is aimed to be used in places where the computational cost of breaking the cipher is more than the financial gains (ideally as one time pads). The cipher is a very efficient one which encrypts a sixteen character block in three milliseconds. It can also be noted that the entire input is always encrypted as a single block irrespective of the length of input.

Keywords: substitution box, chained substitution, inverse substitution, key dependent permutation, , decryption, plaintext, , avalanche effect.

I. INTRODUCTION The migration of business onto the internet, which started in middle of 1990s, has thrown up new challenges. Foremost among them is the confidentiality of the information that is being exchanged over an unsecure network. is a tool that is being used to achieve this confidentiality. There are primarily two kinds of cryptographic algorithms developed in the literature. One is Block ciphers and the other is Stream ciphers [1]. DES [2], Idea [3], Blowfish [4], AES [5], Cast128 [6] are some of the popular block cipher algorithms. These algorithms take a block of characters at a time and carryout the encryption. Caesar cipher [7], vernam cipher [8], [9] and Decim [10] are some of the Stream ciphers reported in the literature. The primary advantage of Stream ciphers is that they work on input of any length, while Block ciphers, as mentioned earlier, work on a fixed group of characters. However, some of the Stream ciphers have shown vulnerability to periodicity and statistical analysis of plain text. In this paper our intention is to develop a cipher which has advantages of both Block ciphers and Stream ciphers. We present the design of the cipher in section two, illustrate the functioning of the cipher in section three and draw conclusions in section four.

II. DESIGN OF THE CIPHER This cipher is presented taking into consideration, the 128 ASCII character set. However, it can be extended to EBCDIC or Unicode character set with same ease. In this, a key „K‟ is taken comprising sixteen random numbers between 0 to127. In a vector of 128 elements we place the numbers in the key in the first sixteen positions. In the remaining positions of the vector, we place all the numbers between 0 to127, excluding the elements of the key, in their ascending order. Thus, we have a vector that contain sixteen random numbers followed by the remaining numbers (between 0 to127) in their ascending order. A permutation of the numbers of the vector, arrived at as described above, is carried out as explained below. th If the first element of the vector is Ki, we place the i element of the vector in first position. If the second element of th the vector is Kj, we place the j element of the vector in second position and so on. After permuting all 128 elements of the vector, the vector will be entirely different from what it was before permutation. Sixteen such permutations will be performed on the vector to dissolve any kind of sequential ordering of vector elements. The composition of the vector after sixteen permutations is taken as Substitution box1 (sb1). Another sixteen permutations on the vector gives rise to second Substitution box2 (sb2). Sixteen further permutations will result in Substitution box3 (sb3). Thus, this cipher will have three Substitution boxes. Consider an input stream „S‟. The first three characters of this input stream are taken as s1, s2 and s3. These three characters are replaced by their ASCII codes. s1 is substituted with = sb1[s1]. S2 is replaced with =(sb2[s2]+ ) mod128 and s3 with =(sb2[s2]+ ) mod128. Now, , and s4 are taken as next three characters for substitution. The substitution carried out is similar to the one explained above, resulting in three transformed characters , and .

© 2016, IJARCSSE All Rights Reserved Page | 79 Kavya et al., International Journal of Advanced Research in Computer Science and Software Engineering 6 (3), March- 2016, pp. 79-81 , and s5 undergo the substitution process in the next step. This process continues till the end of the input is reached. It can be noted that the characters s1 and sn (the first and last characters of the input string) are substituted only once. Thus, these two characters form the weakest part of the algorithm. Hence, one more round of substitution for the characters and are carried out using substitution boxes1 and 2. The output produced by adopting the process described above, form the ciphertext. The decryption is an inverse process of the encryption.

III. ILLUSTRATION OF THE CIPHER The key K is taken as K={88, 66, 119, 18, 24, 112, 45, 98, 35, 59, 68, 107, 50, 127, 123, 79} (1) The vector constructed by placing the key elements first and the remaining in their ascending order next is obtained as V1={88, 66, 119, 18, 24, 112, 45, 98, 35, 59, 68, 107, 50, 127, 123, 79, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 42, 43, 44, 46, 47, 48, 49, 51, 52, 53, 54, 55, 56, 57, 58, 60, 61, 62, 63, 64, 65, 67, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 80, 81, 82, 83, 84, 85, 86, 87, 89, 90, 91, 92, 93, 94, 95, 96, 97, 99, 100, 101, 102, 103, 104, 105, 106, 108, 109, 110, 111, 113, 114,115, 116, 117, 118, 120, 121, 122, 124, 125, 126,} (2) Applying permutation on v1, as described in section2 gives ={63, 28, 109, 116, 20, 97, 79, 77, 24, 17, 30, 90, 6, 124, 115, 49, 73, 42, 113, 119, 35, 103, 15, 85, 4, 33, 44, 96, 22, 125, 118, 61, 81, 55, 2, 8, 108, 31, 92, 47, 57, 102, 37, 126, 121, 71, 88, 66, 18, 112, 45, 98, 59, 68, 107, 50, 127, 123, 0, 1, 3, 5, 7, 9, 10, 11, 12, 13, 14, 16, 19, 21, 23, 25, 26, 27, 29, 32, 34, 36, 38, 39, 40, 41, 43, 46, 48, 51, 52, 53, 54, 56, 58, 60, 62, 64, 65, 67, 69, 70, 72, 74, 75, 76, 78, 80, 82, 83, 84, 86, 87, 89, 91, 93, 94, 95, 99, 100, 101, 104, 105, 106, 110, 111, 114, 117, 120, 122} (3) At the end of sixteen such iterations, the sb1 assumes the form Sb1={126, 72, 119, 18, 24, 63, 77, 97, 35, 105, 74, 41, 7, 42, 10, 46, 127, 80, 2, 3, 4, 73, 85, 103, 8, 110, 82, 54, 23, 55, 26, 58, 13, 87, 19, 20, 81, 92, 108, 114, 89, 65, 38, 66, 40, 69, 29, 94, 34, 88, 98, 112, 117, 95, 75, 51, 1, 53, 43,100, 48, 0, 5, 120, 101, 83, 62, 17, 64, 56, 60, 16, 21, 122, 106, 90, 33, 67, 70, 32, 36, 124, 111, 96, 47, 76, 78, 49, 125, 115, 102, 59, 84, 86, 61, 118, 107, 9, 91, 93, 71, 121, 11, 25, 99, 79, 123, 27, 39, 104, 15, 14, 52, 109, 31, 30, 113, 45, 44, 116, 6, 57, 22, 68, 37, 50, 12, 28} (4) Similarly, Sb2={13, 87, 119, 18, 24, 81, 92, 108, 35, 114, 30, 90, 38, 66, 115, 69, 29, 94, 2, 3, 4, 88, 98, 112, 8, 117, 44, 96, 51, 1, 118, 77, 43, 100, 19, 20, 0, 7, 5, 120, 57, 102, 62, 17, 121, 85, 56, 105, 34, 16, 23, 21, 122, 68, 107, 72, 33, 123, 67, 110, 48, 32, 36, 124, 10, 11, 80, 47, 14, 76, 60, 46, 49, 125, 26, 27, 59, 84, 70, 58, 61, 126, 40, 41, 9, 91, 78, 71, 127, 53, 54, 25, 97, 86, 79, 64, 65, 39, 103, 93, 15, 74, 75, 52, 99, 31, 82, 83, 63, 104, 45, 89, 73, 109, 6, 95, 113, 22, 101, 116, 37, 106, 50, 111, 12, 28, 42, 55} (5) And Sb3={79, 76, 119, 18, 24, 80, 124, 42, 35, 108, 68, 96, 13, 58, 123, 117, 15, 84, 2,3, 4, 87, 125, 55, 8, 112, 10, 102, 29, 69, 14, 120, 31, 91, 19, 20, 94, 126, 66, 5, 26, 107, 43, 77, 30, 122, 45, 97, 34, 100, 127, 1, 21, 40, 11, 56, 85, 44,6, 103, 48, 105, 17, 36, 53, 27, 67, 92, 57, 22, 60, 110, 33, 49, 64, 41, 98, 37, 70, 114, 47, 61, 74, 54, 7, 50, 78, 59, 71, 82, 65, 23, 12, 86, 9, 89, 75, 38, 28, 93, 25, 95, 83, 51, 99, 39, 101, 90, 62, 104, 52, 106, 72, 109, 63, 111, 113, 73, 115, 116, 81, 118, 88, 121, 0, 16, 32, 46, 68} (6) The input stream S is taken as S= computer science (7) The first three characters of the input stream S are taken as s1, s2, s3. The substitution process transforms these three characters as =sb1[s1] = sb1[99]=] (8)

=(sb2[s2]+ ) %128= 6 (9)

=(sb3[s3]+ )%128= ▲ (10) The substitution process, as described in section2, when applied on input stream S gives rise to the ciphertext C. C= ♥KS8B-K Ul♀♥ii4V (11) It can be verified that on applying the decryption, the plaintext can be obtained back from the ciphertext.

IV. CONCLUSIONS The cipher shows very good Avalanche effect. It is examined in two cases: 1. A one bit change in the plaintext. 2. A one bit change in the key.

Let C1 denote the ciphertext, in binary form, corresponding to the plaintext given in (7). This plaintext is changed to #omputer science, so that there is exactly one bit difference between the original plaintext and the modified plaintext. C2 denote the ciphertext, in binary form, corresponding to the modified plaintext. It is observed that C1 and C2 differ by 59 bits. A one bit change in the key is also examined. Let the key be changed, so that the difference between the old and new keys is exactly one bit. The changed key k1 is K1={88,66,119,18,24,112,45,98,3,59,68,107,50,127,123,79} (12)

© 2016, IJARCSSE All Rights Reserved Page | 80 Kavya et al., International Journal of Advanced Research in Computer Science and Software Engineering 6 (3), March- 2016, pp. 79-81 Let C3 be the ciphertext corresponding to the plaintext given in (7), operated upon by the modified key given in (12). It was observed that C1 and C3 differ by 65 bits. Thus, it can be noted that the cipher exhibits satisfactory avalanche effect. The traditional block ciphers are very sluggish in nature and their general encryption speed will be 7988 characters per second for DES, 2663 characters for 3DES, 5320 characters for AES and 10167 characters for BlowFish[11]. Our cipher can encrypt nearly 65500 characters per second which is many folds higher than traditional block ciphers. However, this cipher is not as complex as any of the afore mentioned block ciphers and hence not as strong. However, this light weight block cipher can be used in circumstances where the computational cost of breaking the cipher is much more than the gain accrued. Ideally, this cipher can be used for on the fly encryption, which is a requirement in encrypting the data in web forms. The cipher will serve its purpose if it is used as a onetime pad.

REFERENCES [1] Simmons G., “Cryptology”, “Encyclopedia Britannica”, 1993. [2] National Bureau of Standards NBS FIPS PUB 46 “Data Encryption Standard (DES)” US Department of Commerce, January 1977. [3] Lai,X., Massey. J., “A Proposal for a New Encryption Standard ”, EUROCRYPT 90, proceedings of Springer- Verlag, 1991, pp.389-404. [4] Scheneier, B.,”The BlowFish Encryption Algorithm”, Dr.Dobb‟s Journal, April 1994, 19:38-40. [5] Daemen J.,and Rijmen V., “Rijndael ,The Advanced Encryption (AES)”, Dr.Dobb‟s Journal, March 2001, 26(3):137-139. [6] Adams, C. M., “The CAST-128 Encryption Algorithm” RFC2144, May 1997. [7] William Stallings “Cryptography and Network Security: Principles and Practices”, Fourth edition 2005, Pearson Education, Asia. [8] G.S. Vernam, “Cipher printing telegraph systems for secret wire and GS Vernam, Cipher printing telegraph systems for secret wire and radio telegraphic communications”, J. Am. Inst. Elec. Eng., 1926, 55:109-115. [9] M.Bosegard, M. Vesteranger, T. Pedersan, J. Christiansen, and O. Scanvenius, “Rabbit: A New High Performance “,Ln T.Johannsson, editor, Proc. Fast Software Encryption 2003,volume 2887of LNCS,springer,2003,pp-307-329. [10] Berbain, O.Billet, A.Canteaaut, N.Courtois, B.Debraize, H.Gilbert, L.Goubin, A.Gouget, L.Granboulan,C.Lauraradoux, M.Minier,T.Pornin, H.Sibert ,”Decim-A new Stream Cipher for Hardware Applications”, ECRYPT Stream Cipher Project Report,2005/04. [11] www.cse.wustl.edu/~jain/cse567-06/ftp/encryption_perf/

© 2016, IJARCSSE All Rights Reserved Page | 81