International Journal of Engineering, Management & Sciences (IJEMS) ISSN-2348 –3733, Volume-2, Issue-6, June 2015
AES Algorithm Using MATLAB Jasmine Shafi Farha, M.Yamini, N.Sandhya,M.Puneeth
Abstract— Now a days cryptanalyst’s are increasing day by day so in order to maintain privacy or secrecy for information, a security encryption algorithm is required in order to send the data confidentially, AES (Advanced Encryption Standard) is an algorithm that which replaced DES and 3DES because of their smaller block size, AES is having the larger block size, good security and efficiency so in our paper we are going to generate a structure with s-boxes, expanded key, encryption and decryption arrays of AES using Mat lab software Index Terms—decryption, encryption, key, DES, AES
I.
INTRODUCTION
initial round will contain only an Add round key. In case of Rounds step it consists of substitution bytes, shift rows, Mix columns and Add round key. The final round will perform the operations of substitution bytes, shift rows and add round key [6]. A 128 bit block is given as the input for the process of encryption and the process of decryption algorithm This 128 bit blocks are portrayed into square matrix of bytes, in state array this block is copied, at each stage of the encryption process and the decryption process this block is modified,into an output matrix state is copied after the final stage ,in the same manner the 128 bit key is portrayed as a bytes of square matrix the expansion of key takes place into an array which has schedule words of key each key word is having 4 bytes, for the 128 bit key the total key schedule is having 44 words
Advanced Encryption standard replaced the DES and 3DES, because of two reasons these are having 64 bit block size and the another one is 3 DES is having three times more rounds than DES, which is slower correspondingly so that for security and efficiency there should be a larger block size so that in order to rectify these drawbacks AES came into existence. Rijndael was a block cipher and it was developed by Joan Daemen and Vincent Rijmen[5] AES is a symmetric block cipher which is having the block size of 128 bits and the key length of 128,192 and 256 bits. AES is having the high computational efficiency so that AES can be used in broad band links and high speed applications.AES is flexible and suitable for different types of software and hardware applications.AES is designed in such a way that it has resistance over all the known attacks, simplicity design and compactness of code on different types of platforms. Providing security for data is an important factor for embedded appliances [2]
II. ENCRYPTION AND DECRYPTION OF AES AES implementation can be done in the following way there are four steps in implementing the AES they are initial round, Rounds, final round, modifications [1].The key expansion will be done with the help of key schedule .The Manuscript received June 20, 2014. Jasmine Shafi Farha, Department of ECE, KLuniversity,Vaddeswaram, India M.Yamini, Department of ECE, KLuniversity, vaddeswaram, India N.Sandhya, Department of ECE, KLuniversity, vaddeswaram, India M.Puneeth, Department of ECE, KLuniversity, vaddeswaram, India
17
Fig1: encryption and decryption of AES Ordering of bytes are noted in the matrix are by its column AES is having a non Feistal structure,one half of the data block is used for modification of the other half of the data
www.alliedjournals.com
AES algorithm using matlab block. Firstly government of US adopted this AES but now the whole world is using this Advanced Encryption Standard. The main principle of AES is Permutations and substitutions and combining the substitution and permutation,AES works very faster in case of both hardware and software. The number of keys used in AES are depended upon the number of cycles used for 128 bit keys repetition of 10 cycles takes place ,for 192 bit keys repetition of 12 cycles takes place, for 256 bits 14 cycles of repetition takes place every round in AES has several steps of processing. There are four different types of stages like substitution bytes, shift rows, Mix columns, Add Round key are used in AES
Fig 3:AES Encryption Round The key will be used by only the ADD round key, the starting and the ending of the key will be taken place at the ADD round key only. The expanded key will be used by the decryption algorithm the expanded key will be used in reverse order, at the final stage for the process of encryption and for the process of decryption there are only three stages Fig 2: input state array and output, key and expanded key III. SUBSTITUTION BYTES TRANSFORMATION A.Substitution bytes: For performing a byte to byte substitution an s-box is used B.Shift rows: Shift rows is a simple type of permutation C.Mix columns: In mix columns the substitution uses an arithmetic of GF(8th power of 2) D.ADD round key: ADD round key is used as a XOR for the current block by using an expanded key. This structure is very simple for the process of encryption and decryption, the cipher starts by ADD round key ,the nine rounds that which has the four stages follows the Add round key The AES encryption standard contains the AES encryption round in which the process of encryption takes place, in this process of encryption and in the process of decryption there are different number of transformations, these transformations are consecutively applied at the data blocks This encryption process contains a number of iterations that which are fixed these are called as rounds, these number of iterations or rounds are depended upon the key length for the process of encryption .10 iterations are required for key length of 128 bits. The key will be used by only the ADD round key, the starting and the ending of the key will be taken place at the ADD round key only. The expanded key will be used by the decryption algorithm the expanded key will be used in reverse order, at the final stage for the process of encryption and for the process of decryption there are only three stages
A. Forward and Inverse transformation In the Forward substitution byte transformation, the bytes of substitution that which are used for substitution, A matrix of 16 X 16 bytes are defined by AES in a box that which is called as S BOX Rijndael S-BOX is nothing but a matrix that which is used in AES and it is based on cryptographic algorithm of AES,the substitution box is served as a look up table Rijndael algorithm has a very good flexibility for working with a key and size of block for that which it has any multiples of 32 bit with the minimum number of bits of 128 bits and maximum number of bits 256 bits [3] A.Forward S-Box: The generation of S-Box takes place with the determining multiplicative inverse of the number that which is given GF(8th power of 2)= GF(2)[x]/(x8 + x4 + x3 + x + 1),The mapping of 0 will be done if the number is not inverse ,the transformation of multiplicative inverse is done using the affine transformation
The affine transformation is defined as the addition of number of rotations on byte, the sum used here is the XOR
18
www.alliedjournals.com
International Journal of Engineering, Management & Sciences (IJEMS) ISSN-2348 –3733, Volume-2, Issue-6, June 2015
operation The calculation of matrix multiplication can be done by using the following algorithm, the multiplicative inverse of two input numbers is stored in two 8-bit temporary variables a and b, the one bit value of a is rotated to the left, if the ‘a’ value is higher bit of the one then make the low bit of one a, if not the low bit value of a is zero,the value of ‘a’ should be XORed with the ‘b’ so that the value will be stored in ‘a’the same process will be repeated for two or three times now the final result will have a result that which is obtained by the multiplication,after the multiplication of matrix is completed then the value will be XORed by the decimal number which is 99 now a S-BOX with hexa decimal notation is obtained
Table 2: Inverse Sbox IV. SHIFT ROWS AND MIX COLUMNS
Table 1: Sbox B.Inverse S-BOX The inverse S-Box can be defined as the inverse of the S-Box, the calculation of inverse S-Box will take place by the calculation of inverse affine transformation of an Input value that which is followed by multiplicative inverse
A.Shift rows The shift rows are used to operate on state of rows, the bytes that which are present in each row are shifted by certain offset. In case of AES there is no change in first row, the bytes that which are present in the second row are shifted to the left side, in the same manner the third and fourth rows are shifted by using two, three offsets. In case of block sizes such as for 128 bits and for 192 bits the pattern of the shifting is same, row r is circularly left shifted by r-1 bytes, In this manner by using the shift rows technique the output of one column is converted into the input state of another column
Fig 4:Shift Rows
The representation of Rijndael's inverse S-box is as follows
19
B.Mix columns In case of Mix columns four bytes that which are present in each column in a state are mixed with the help of invertible linear transformation. The function of mix columns will take input as four bytes and output as four bytes, each and every input byte will affect the all four output bytes that present, at this time of operation each column will be transformed with the help of fixed matrix. The mixed column layer is an operational matrix layer in which a column of 4 byte is considered as a vector and then it is multiplied by a matrix of 4X4 [4].
www.alliedjournals.com
AES algorithm using matlab VII. RESULTS
Fig 5:Mix columns V. ADD ROUND KEY In case of Add round key the combination of substitution key and state takes place, for every round from the main key substitution byte will be derived with the help of Rijndael’s key schedule, substitution key and the state will have same size, the substitution key will be added by the combination of each byte from the state with corresponding byte that which is present in the substitution key with the help of bitwise XOR
Fig 6: Add round key in AEs
Fig 7:S-Box creation in matlab
Fig 8: Inverse Sbox creation in matlab
VI. CONCLUSION By using matlab software we have generated a structure with s-boxes, expanded key, encryption and decryption arrays of AES
Fig 9:R-Con creation in matlab
20
www.alliedjournals.com
International Journal of Engineering, Management & Sciences (IJEMS) ISSN-2348 –3733, Volume-2, Issue-6, June 2015
[5]. Chandra Prakash Dewangan, Shashikant Agrawal, “A Novel Approach to Improve Avalanche Effect of AES Algorithm”, Volume 1, Issue 8, October 2012 [6]. O. Prasanthi, M. Subba Reddy, “Enhanced AES Algorithm”, volume 2,issue 2,June 2012, International Journal of Computer Applications in Engineering Sciences
Jasmine Shafi Farha. Graduating B-tech in Electronics and
communications at KLuniversity,published one journal on RSA and Modified RSA using c programming ,member in IETE
M.Yamini. Graduating B-tech in Electronics and communications at
KLuniversity, ,published one journal on RSA and Modified RSA using c programming member in IETE
N.Sandhya. Graduating B-tech in Electronics and communications at KLuniversity, ,published one journal on RSA and Modified RSA using c programming member in IETE
Fig 10: key expansion of AES in matlab
M.Puneeth Graduating B-tech in Electronics and communications at
KLuniversity, published three International Journals on steganography using matlab ,Different types of aperture antennas using HFSS and RSA and Modified RSA using c programming ,member in IETE
Fig 11:Poly Mat creation of AES in matlab
REFERENCES
[1]. Minal Moharir1 and Dr A V Suresh ,“A Novel Approach Using Advanced Encryption Standard to Implement Hard Disk Security” Vol.4, No.1, January 2012, International Journal of Network Security & Its Applications (IJNSA) [2]. Samir El Adib and Naoufal Raissouni, “AES Encryption Algorithm Hardware Implementation: Throughput and Area Comparison of 128, 192 and 256-bits Key”, Vol. 1, No. 2, July 2012, “International Journal of Reconfigurable and Embedded Systems (IJRES)” [3]. Hamdan.O.Alanazi, B.B.Zaidan, A.A.Zaidn, Hamid A.Jalab, M.Shabbir and Y. Al-Nabhani, “New Comparative Study Between DES, 3DES and AES within Nine Factors” VOLUME 2, ISSUE 3, MARCH 2010, JOURNAL OF COMPUTING [4]. Amish Kumar, Mrs. Namita Tiwari, “EFFECTIVE IMPLEMENTATION AND AVALANCHE EFFECT OF AES”, Vol. 1, No 3/4, August 2012, International Journal of Security, Privacy and Trust Management (IJSPTM)
21
www.alliedjournals.com