A Performance Study on AES Algorithms

Document Sample
A Performance Study on AES Algorithms Powered By Docstoc
					                                                              (IJCSIS) International Journal of Computer Science and Information Security,
                                                                                                             Vol. 8, No. 6, September 2010

               A Performance Study on AES Algorithms
                     B.D.C.N.Prasad1                                                    P E S N Krishna Prasad2
            Dept. of Computer Applications,                                    Dept. of Computer Science & Engineering
         P V P Siddardha Institute of Technology                                      Aditya Engineering College
                   Vijayawada, India                                                        Kakinada, India
                 bdcnprasad@gmail.com                                                    surya125@gmail.com


                   P Sita Rama Murty3                                                         K Madhavi4
         Dept. of Computer Science & Engineering                                               Dept. of CSE
     Sri Sai Aditya Institute of Science & Technology                                   Dadi Institute of Technology
                       Kakinada, India                                                       Anakapalli, India
                   psramam@yahoo.co.in                                                kolukulurimadhavi@yahoo.co.in

Abstract— The Aim of this project is to find the performance                 Cryptography, over the ages, has been practiced by many
comparative analysis of AES algorithms such as MARS, RC6,                who have devised ad-hoc techniques to meet some of the
Rijndael, Serpent, Twofish algorithms in terms of speed,                 information security requirements. The last twenty years
memory, time, encryption and decryption, key setup time,                 have been period of transition as the discipline to a broader
number of rounds, key sizes and also hardware considerations.            area. There are now several international scientific
Most of the AES algorithms, especially symmetric block                   conferences denoted exclusively to cryptography and also
ciphers, are based on the principle of substitution and                  and International Association for Crypto-logic Research
transposition to encrypt a plain-text message and to produce a           (IACR), aimed at fostering research in the area.
cipher-message. Those transformations are based on well-
understood Mathematical problems using non-linear functions                 There are two general types of cryptographic algorithms.
and linear modular algebra.
                                                                                 1.    Symmetric algorithms.
Implementation of cryptographic algorithms mainly uses bit-                      2.    Asymmetric algorithms.
level operations and table look-ups. Bit-wise operators (XORs,
AND/OR, etc.), substitutions, logical shifts and permutations                The current Digital Encryption Standard (DES) does no
are quite common operations. Such operations are well suited             longer satisfy the need for data security because of its short
for their fast execution in hardware platforms. Furthermore,             56-bit key. Such short keys can today be broken by brute
currently abundant memory resources in hardware platforms                force attacks. We are looking for newer and more flexible
enhance encryption speed for the operations like substitution.           algorithms to replace DES. Some of the candidates for the
These operators play an important role in analysis and                   Advanced Encryption Standard (AES) are MARS encryption
comparison of the performance of the above mentioned AES                 algorithm, RC6, Serpent, Rijndael, and Twofish. These are
algorithms, to evaluate simple, effective and efficient outcomes         symmetric key block ciphers use 128 bit blocks and supports
and also the information might be more secure.                           variable key sizes (from 128 to 1248 bits). These use
                                                                         addition and subtractions, S-boxes, fixed and data dependent
Keywords-AES algorithms; Mars; RC6; Rijndeal; Sarpent;
Two fish;                                                                rotations, and multiplications.
                                                                            The final AES selection was made on the basis of several
                                                                         additional characteristics:
                     I.     INTRODUCTION
    Security is a broad topic and covers a multitude of sins,                         computational     efficiency    and memory
in its simplest form. It is concerned with making sure that                            requirements on a variety of software and
nosy people cannot read, or worse yet, modify message                                  hardware, including smart cards
intended for other recipients. It is concerned with people                            flexibility, simplicity          and       ease    of
trying to access remote services that they are not authorized                          implementation
to use. Security also deals with people trying to deny that
they sent certain message.                                                   The existing system consisted of files with literally no
                                                                         file security standards like AES algorithms such as MARS,
   Network security problems can be divided roughly into                 RC6, Rijndael, Serpent, and Twofish. AES algorithms are
four intertwined areas:                                                  symmetric cipher algorithms which are far better than DES
            Confidentiality,                                            algorithms, since DES algorithms are limited key size with
                                                                         fixed number of blocks. So, we have chosen for finding the
            Authentication and Integrity control                        comparison of AES algorithms to provide the security for
                                                                         Data as well as networks and files. AES algorithms are to be
            Denial of service



                                                                   128                             http://sites.google.com/site/ijcsis/
                                                                                                   ISSN 1947-5500
                                                               (IJCSIS) International Journal of Computer Science and Information Security,
                                                                                                              Vol. 8, No. 6, September 2010
implemented due to the following factors against which                   CBC mode within ESP. This mode requires an Initialization
several security measures had to be taken up:                            Vector (IV) that is the same size as the block size. Use of a
                                                                         randomly generated IV prevents generation of identical
        1.   Reading data                                                cipher text from packets which have identical data that spans
        2.   Manipulating and modifying data                             the first block of the cipher algorithm's block size.
        3.   Illegal use of files                                            The IV is XOR'd with the first plaintext block before it is
                                                                         encrypted. Then for successive blocks, the previous cipher
        4.   Corrosion of data files                                     text block is XOR'd with the current plaintext, before it is
        5.   Distortion of data transmission                             encrypted. For the use of CBC mode in ESP with 64-bit
                                                                         ciphers.
    The main issue of (1) is secrecy and confidentiality.
Confidentiality has always played an important role in                     2) Key Size
diplomatic and military matters. Often Information must                      Some cipher algorithms allow for variable sized keys,
store or transferred from one place to another without being             while others only allow specific, pre-defined key sizes. The
exposed to an opponent or enemy. Key management is also                  length of the key typically correlates with the strength of the
related to Confidentiality. This deals with generating,                  algorithm; thus larger keys are usually harder to break than
distributing and storing keys. Items (2-4) are primarily                 shorter ones. This article stipulates that all key sizes MUST
concerned with reliability. Often the expression integrity is            be a multiple of 8 bits.
used as a measure of genuineness of data. Also computer                     The default key size that implementations MUST support
files and networks must be protected against intruders and               128 bits. In addition, all of the ciphers accept key sizes of
Unauthorized. Item 5 is different aspect of the security of the          192 and 256 bits.
information.

A. AES Algorithms                                                                             TABLE II.       KEY SIZES

         AES algorithms are symmetric cipher algorithms                         Algorithm             Key Sizes(bits)            Default
with variable key sizes and blocks, also with number of                       MARS             128 – 448*                      128
rounds to encrypt and decrypt the data than DES algorithms.                   RC6              Variable up to 2040             128
                                                                              Rijndael         128,192,256                     128
There are numerous algorithms in AES. From them we have                       Serpent          Variable up to 256**            128
chosen the following algorithms for finding the performance                   Two fish         Variable up to 256***           128
analysis on time, memory, key sizes, key setup time,
encryption, and decryption and so on.
                                                                             MARS key lengths must be multiples of 32 bits.
   The Chosen algorithms are as:
                                                                            ** Serpent keys are always padded to 256 bits. The
            MARS encryption algorithm                                   padding consists of a "1" bit followed by "0" bits.
            RC6 Algorithm                                                  *** Twofish keys, other than the default sizes, are always
            Rijndael Algorithm                                          padded with "0" bits up to the next default size.

            Serpent Algorithm                                             3) Weak Keys
                                                                             Some cipher algorithms have weak keys or keys that
            Twofish Algorithm                                           MUST not be used due to their interaction with some aspect
                                                                         of the cipher's definition. If weak keys are discovered for the
                 TABLE I.      GENERAL STRUCTURE
                                                                         AES or any of the other finalists, then weak keys SHOULD
                                                                         be checked for and discarded when using manual key
      Cipher         Type      Rounds            Using                   management. When using dynamic key management, weak
      MARS        Extended     32         Variable Rotation,             key checks SHOULD NOT be performed as they are seen as
                  Feistel                 Multiplication
                                          Non Cryptic Rounds
                                                                         an unnecessary added code complexity that could weaken the
      RC6         Feistel      20         Variable Rotation,             intended security.
                                          Multiplication
      Rijndael    Square       10,12,14
                                                                           4) Block Size and Padding
      Serpent     SP Network    32        Bitslice                             All of the algorithms described in this document use a
      Twofish     Feistel      16                                        block size of sixteen octets (128 bits), mandatory for the
                                                                         AES. Some of the algorithms can handle larger block sizes
                                                                         as well. Padding is required by the algorithms to maintain a
   1) Mode                                                               16-octet (128-bit) blocksize. Padding MUST be added, such
          No operational modes are currently defined for the             that the data to be encrypted has a length that is a multiple of
AES cipher. The Cipher Block Chaining (CBC) mode is                      16 octets. Because of the algorithm specific padding
well-defined and well-understood for symmetric ciphers, and              requirement, no additional padding is required to ensure that
is currently required for all other ESP ciphers. This article            the cipher text terminates on a 4-octet boundary (i.e.
specifies the use of the AES cipher and the other finalists in           maintaining a 16-octet blocksize guarantees that the ESP Pad




                                                                   129                              http://sites.google.com/site/ijcsis/
                                                                                                    ISSN 1947-5500
                                                              (IJCSIS) International Journal of Computer Science and Information Security,
                                                                                                             Vol. 8, No. 6, September 2010
Length and Next Header fields will be right aligned within a                1) RC6
4-octet word                                                                 RC6 is the submission of MIT (Massachusetts Institute of
                                                                         Technology) and the RSA-Laboratories. Similar to MARS it
  5) Rounds
                                                                         splits the 128 bit blocks into four words in the algorithm, but
    This variable determines how many times a block is                   the algorithm is designed in a way that you can easily change
encrypted. While this variable MAY be negotiated, a default              to two 64 bit words in newer architectures. RC6 is also a
value MUST always exist when it is not negotiated.                       Feistel network. It uses the same type of operations except
           Algorithm   Negotiable   Default of Rounds                    from look-up tables and fixed rotations. The algorithm is
           MARS        yes          32                                   more flexible than MARS about blocksize and number of
           RC6         yes          20                                   rounds. The AES submission is optimized for 128 bit blocks
           Rijndael    yes          10,12,14                             and 20 rounds. Several performance test showed that RC6 is
           Serpent     yes          32
           Twofish     yes          16
                                                                         slower than MARS for encryption and for the key setup. But
                                                                         it uses less memory because there are no look-up tables.
B. MARS Algorithm
                                                                           2) Rijndael
         MARS is a shared-key block cipher that works with                   Rijndael is the submission of the Belgium Proton World
a block size of 128 bit and a variable key size. The algorithm           Int. and the Katholieke Universities Leuven, Belgium. This
is a type-3 Feistel network which is word (32 bit) oriented.             algorithm is quite different from MARS. It works with
The word orientation should bring a performance for                      Galois Field GF(128) arithmetic and handles the input blocks
software implementations on most computer architectures                  as matrices of bytes. They define several operations to these
available today. A fully optimized implementation is                     matrices as ByteSub, ShiftRow, MixColumn and
expected to run at 100Mbit/second and hardware can achieve               AddRoundKey. For detailed information about these
an additional 10x speedup factor.                                        operations consult [Rijndael99]. Several combinations of
  1) Operations                                                          these operations define a round. Depending on the key length
   MARS algorithm uses a big variety of different                        which is in the range from 128 to 256 bits a fixed number of
operations:                                                              rounds has to be executed. This cipher is not a Feistel
                                                                         network. Several performance tests showed that Rijndael is
    Additions, subtractions and xors: These simple                       about the same speed in encryption and decryption as
operations are used to mix data and key values together.                 MARS. But the key expansion for keys of the same length is
Because xors are interleaved with additions and subtractions             significant slower.
these operations do not commute with each other.
                                                                           3) Serpent
    Table look-up: Similar to the S-boxes in DES has also                    Serpent is a submission from three universities
MARS cipher a table look-up. It uses a single table of 512               (Cambridge University, England; Technion, Haifa, Israel;
32-bit words, simple called S-box. A problem of the table                University of Bergen, Norway). Therefore it's the only
look-up is the slow software implementation (at least 3                  algorithm where no company stands behind. The algorithm is
instructions per look-up). That's why S-box look-up is only              pretty similar to DES, it uses permutations, xors, fixed
used sparely in MARS where fast avalanche of the key bits is             rotations and shifts and constant table look-up's. The first
needed.                                                                  version of the algorithm even used the same S-boxes as DES.
    Fixed rotations: Data-dependent rotations: Data                      The key can vary from 128 to 256 bit. The algorithm works
dependent rotations may lead to differential weaknesses.                 internally also with 4 words as RC6 and MARS.
This problem is solved in MARS by combining these                        Performance tests that the encryption of Serpent is about
rotations with multiplications.                                          25% faster than the MARS encryption. But the key
                                                                         expansion is significant slower. An implementation of
    Multiplications: All multiplications in MARS are modulo              Serpent also uses a lot of memory because of the look-up
232 which suits most modern computer architectures.                      tables.
Multiplications used to be a problem in cryptographic
algorithms because they were slow. Today is this no longer                 4) Twofish
the case. Most architecture can complete a multiplication in 2               Twofish is the submission from a company called
clock cycles. MARS algorithms uses 16 multiplications per                Counterpane. It is a 16 round Feistel cipher that works with
block. This should not be a big deal. For hardware                       key dependent 8x8 bit look-up tables, 4 by 4 matrices over
realizations we have the problem that a multiplicator needs              the Galois field GF(128), a pseudo-Hadamard transform,
much more chip-space than adders or logical units.                       permutations and rotations. The detailed description of these
                                                                         functions can be found in [Twofish]. The key length varies
C. Comparison with other AES Candidates                                  also from 128 bit to 256 bit as in most other AES candidates.
                                                                         Performance tests showed that the encryption speed of
          There are 4 other candidates for AES in the last               Twofish is about the same as for MARS, but the Twofish key
round. So they are all 128 bit block ciphers with variable key           setup is significant faster.
length from 128 bit to at least 192 bit. All designs claim to be
secure against all known attacks like differential, linear,
known plaintext or cipher text and other attacks.




                                                                   130                             http://sites.google.com/site/ijcsis/
                                                                                                   ISSN 1947-5500
                                                                                    (IJCSIS) International Journal of Computer Science and Information Security,
                                                                                                                                   Vol. 8, No. 6, September 2010
D. Performance Analysis                                                                                                                      Initialization

    The performance analysis can be done with various                                                 35
measures such as speed comparison with encryption and
                                                                                                      30
decryption cycles, key setup and key initialization, analysis
                                                                                                      25
of various key sizes and fair speed/security comparisons. The
                                                                                                      20
performance analysis will be presented in the form of tables                                                                                        c                         Initialization
and figures below.                                                                                    15

                                                                                                      10
  1) Speed Comparisons                                                                                5

                                                                                                      0
                                                                                                                   MARS       RC6       Rijndael        Serpent     TwoFish
                             TABLE III.         SPEED


                                                        Key Setup                                                             Figure 3. Key Initialization
                 Encrypt        Decrypt
     Cipher      (Cycles)       (Cycles)       Encrypt        Decrypt        Init                2) Analysis on various Key Sizes
    MARS         1600           1580           4780           5548           18
                                                                                                   a) Encryption
    RC6          1436           1406           5186           5148           30
                                                                                                                              TABLE IV.                 ENCRYPTION
    Rijndael     1276           1276           17742          18886          28

    Serpent      1800           2102           13154          12648          14                     Algorithm                  Encry128                       Encry192         Encry256

    TwoFish      1254           1162           18846          18634          20                      MARS                           3738                          3707             3733

                                                                                                      RC6                           4698                          4740             4733
      2500

                                                                                                     Rijndael                       4855                          4664             4481
      2000
                                                                                                     Serpent                        1843                          1855             1861
      1500
                                                              Encryption(Cycles)                     Twofish                        1749                          1749             1744
                                                              Decryption(Cycles)
      1000                                                                                         b) Decryption
       500
                                                                                                                              TABLE V.                  DECRYPTION
          0
               MARS    RC6     Rijndael Serpent TwoFish
                                                                                                  Algorithm                         Encry128                      encry192        encry256

       Figure 1. Graph for Encryption and Decryption (Cycles)                                         MARS                          3965                          3965            3936
      20000                                                                                            RC6                          4733                          4698            4740
      18000
      16000
                                                                                                     Rijndael                       4819                          4624            4444
      14000
      12000                                                                                          Serpent                        1873                          1897            1896
                                                                     Encryption
      10000
                                                                     Decryption
       8000                                                                                          Twofish                        1781                          1775            1761
       6000
       4000                                                                                                                             Encryption
       2000
                                                                                                                   6000
          0
                MARS     RC6       Rijndael   Serpent    TwoFish                                                   5000

                                                                                                                   4000                                                       Algorithm
                                                                                                       Kbits/sec




                                                                                                                                                                              Encry128
                                                                                                                   3000
      Figure 2. Graph for Key setup Encryption and Decryption                                                                                                                 encry192
                                                                                                                   2000                                                       encry256

                                                                                                                   1000

                                                                                                                     0
                                                                                                                          1         2    3         4          5     6




                                                                                                                                    Figure 4. Encryption




                                                                                        131                                             http://sites.google.com/site/ijcsis/
                                                                                                                                        ISSN 1947-5500
                                                                                         (IJCSIS) International Journal of Computer Science and Information Security,
                                                                                                                                        Vol. 8, No. 6, September 2010
                                              Decryption
                                                                                                   algorithms. But MARS is one among the chosen algorithms

                       6000
                                                                                                   is some what better as considered reports.
                       5000                                                                                 It won't be an easy decision to choose one of the
                       4000
           Kbits/sec



                                                                        Encry128
                       3000                                             encry192
                                                                                                   finalists as AES. There is no known weakness in all these
                                                                        encry256
                       2000                                                                        algorithms, so other factors as performance, needed
                       1000

                          0
                                                                                                   hardware or flexibility must be used for the decision. MARS



                                          h
                                         nt
                                         el
                                          6
                             S




                                                                                                   cipher is for sure a good candidate. It has the largest
                                        is
                                        C
                            R




                                       da


                                      pe


                                      of
                                      R
                           A




                                   ijn




                                  Tw
                                    er
                          M




                                  S
                                  R




                                                                                                   available key length of all of them and it is expandable to

                                        Figure 5.    Decryption                                    larger block sizes than 128 bit. Another advantage of MARS
                                                                                                   is that it comes from a well known company that is in this

     c)                Fair Speed/ Security Comparisons                                            business for a long time which means they have a lot of
                                                                                                   experience and have proven their trustworthiness.
              TABLE VI.                 FAIR SPEED/ SECURITY COMPARISONS
                       Original                                           Time                     F. References
Cipher                 (cycles)     Rounds          Minimal Rounds       (Cycles)
                                                                                                   [1]  Cryptography and Network Security -“William Stallings” ,Third
MARS                    1600             32                  20             1000                        Edition.
                                                                                                   [2] The Laws of Cryptography with JAVA Code -“Neal R.Wagner”.
 RC6                    1436             20                  20             1436                   [3] MARS: C.Burwick, D.Coppersmith, E.D'Avignon, R.Gennaro,
                                                                                                        S.Halevi, C.Jutla, S.Matyas, L.O'Connor, M.Peyravian, D.Safford,
                                                                                                        N.Zunic, "MARS - a candidate cipher for AES", IBM Corporation,
Rijndael                1276             10                  8              1021                        September 1999.
                                                                                                   [4] TweakIBM99 - Shai Halevi, "Detailed discussion of the MARS
Serpent                 1800             32                  17               956                       "tweak" for Round 2", IBM Corporation, Mai 1999.
                                                                                                   [5] RC6: Ronald L. Rivest, M.J.B. Robshaw, R. Sidney, Y.L. Yin, "The
Twofish                 1254             16                  12               940                       RC6 Block Cipher", M.I.T. Laboratory for Computer Science, RSA
                                                                                                        Laboratories.
                                                                                                   [6] Rijndael: Joan Daemen, Vincent Rijmen, "AES Proposal: Rijndael",
                                                                                                        Proton World Int.l, Belgium, Katholieke Universiteit Leuven,
          2000                                                                                          Belgium, September 1999.
          1800                                                                                     [7] Serpent: Ross Anderson, Eli Biham, Lars Knudsen, "Serpent: A
          1600                                                                                          Proposal for the Advanced Encryption Standard", Cambridge
          1400                                                                                          University, England; Technion, Haifa, Israel; University of Bergen,
                                                                     Original (cycles)                  Norway.
          1200
                                                                     Rounds                        [8] Twofish: Bruce Schneier, John Kelsey, Doug Whiting, David
          1000
           800
                                                                     Minimal Rounds                     Wagner, Chris Hall, Niels Ferguson, "Two sh: A 128-Bit Block
                                                                     Time(Cycles)                       Cipher", Counterpane Systems, University of California Berkeley.
           600
                                                                                                   [9] E Biham, “ A Note Comparing AES Candidates, NIST,1999.
           400
           200
                                                                                                   [10] P. Preneel, V Rijmen and A Bosselaers, “ Principles and Performance
                                                                                                        of Cryptographic Algorithms”, Dr. Dobb’s journal.
                  0
                        MARS      RC6     Rijndael Serpent Twofish                                 [11] B. Schneier, J Kelsey, D. Whiting, D Wagner, C. Hall and N
                                                                                                        Ferguson, “Performance Comparison of the AES Candidate
                                                                                                        conference,1999.
                         Figure 6. Fair speed / security comparisons


E. Conclusion
   A performance comparison can be made among various                                                                   AUTHORS PROFILE
AES Algorithms such as MARS, RC6, Rijndael, Serpent,
                                                                                                                         Dr. B D C N Prasad, currently is a Professor & Head of
Twofish. The Performance analysis reports were presented                                                                 Department of Computer Applications at Prasad V. Potluri

in the specified contents. It is concluded that all the above                                                            Siddardha     Institute   of   Science   and   Technology,
                                                                                                                         Vijayawada, Andhra Pradesh, India. He received Ph.D. in
specified algorithms have almost similar speed rate and
                                                                                                                         Applied      Mathematics       from   Andhra    University,
timings while using java tool for execution of these                                                                     Visakhapatnam,India in 1984. His research interests




                                                                                             132                                   http://sites.google.com/site/ijcsis/
                                                                                                                                   ISSN 1947-5500
                                                                                      (IJCSIS) International Journal of Computer Science and Information Security,
                                                                                                                                     Vol. 8, No. 6, September 2010
includes Machine Intelligence, Data Mining, Rough Sets and Information Security in
Computer Science and Boundary value problems and Fluid Dynamics in Mathematics.
He has several publications in mathematics and computer science in reputed national
and international journals. He is a member of ISTAM , ISTE and also he is a national
executive member of Indian Society for Rough Sets.



                           Mr. P E S N Krishna Prasad, currently is a Research
                           Scholor under the guidance of Dr. BDCN Prasad in the
                           area of Machine Intelligence and Neural Networks. He is
                           working as Associate Professor in the Department of CSE,
                           Aditya Engineering College, Kakinada, Andhra pradesh,
                           India. He is a member of ISTE. He has presented and
published papers in several national and International conferences and journals. His
areas of interest are Artificial Intelligence, Neural Networks and Machine Intelligence.




                           Mr. P Sita Rama Murty, currently is a Research Scholor, in
                           the area of ATM networks and Information Secuirty. He is
                           working as Assistant Professor in the department of CSE,
                           Sri Sai Aditya Institute of Science and Technology,
                           Kakinada, Andhra Pradesh, India
                                                             .




                                                                                           133                             http://sites.google.com/site/ijcsis/
                                                                                                                           ISSN 1947-5500

				
DOCUMENT INFO
Description: IJCSIS is an open access publishing venue for research in general computer science and information security. Target Audience: IT academics, university IT faculties; industry IT departments; government departments; the mobile industry and computing industry. Coverage includes: security infrastructures, network security: Internet security, content protection, cryptography, steganography and formal methods in information security; computer science, computer applications, multimedia systems, software, information systems, intelligent systems, web services, data mining, wireless communication, networking and technologies, innovation technology and management. The average paper acceptance rate for IJCSIS issues is kept at 25-30% with an aim to provide selective research work of quality in the areas of computer science and engineering. Thanks for your contributions in September 2010 issue and we are grateful to the experienced team of reviewers for providing valuable comments.