The RC5 Encryption Algorithm?

The RC5 Encryption Algorithm?

? The RC5 Encryption Algorithm Ronald L. Rivest MIT Lab oratory for Computer Science 545 Technology Square, Cambridge, Mass. 02139 [email protected] Abstract. This do cument describ es the RC5 encryption algorithm. RC5 is a fast symmetric blo ck cipher suitable for hardware or software imple- mentations. A novel feature of RC5 is the heavy use of data-dependent rotations.RC5 has a variable word size, a variable numb er of rounds, and a variable-len gth secret key. 1 AParameterized Family of Encryption Algorithms RC5 is word-oriented: all of the primitive op erations work on w -bit words as their basic unit of information. Here we assume w = 32, although the formal sp eci cation of RC5 admits variants for other word lengths, suchasw = 64 bits. RC5 has two-word (64-bit) input (plaintext) and output (ciphertext) blo cksizes. RC5 uses an \expanded key table," S , derived from the user's supplied secret key. The size t of table S dep ends on the number r of rounds: S has t =2(r +1) words. There are thus several distinct \RC5" algorithms, dep ending on the choice of parameters w and r .We summarize these parameters b elow: w This is the word size, in bits; eachword contains u =(w=8) 8-bit bytes. The standard value of w is 32 bits; allowable values of w are 16, 32, and 64. RC5 encrypts two-word blo cks: plaintext and ciphertext blo cks are each 2w bits long. r This is the numb er of rounds. Also, the expanded key table S contains t =2(r +1)words. Allowable values of r are 0, 1, ..., 255. In addition to w and r ,RC5 has a variable-length secret cryptographic key, sp eci ed parameters b and K : b The number of bytes in the secret key K . Allowable values of b are 0, 1, ..., 255. K The b-byte secret key: K [0], K [1], ..., K [b 1] . A particular RC5 algorithm is designated as RC5-w=r=b .For example, RC5- 32/16/10 has 32-bit words, 16 rounds, a 10-byte (80-bit) secret key variable, and an expanded key table of 2(16 + 1) = 34 words, Parameters may b e dropp ed, ? RC5 is a trademark of RSA Data Security.Patent p ending. from last to rst, to talk ab out RC5 with the dropp ed parameters unsp eci ed. (So, for example: howmany rounds should one use in RC5-32?) All of the parameters given ab ove are packaged together to form a RC5 control block,containing the following elds: v 1byte version number; 10 (hex) for version 1.0 here. w 1byte. r 1byte. b 1byte. Kbbytes. A control blo ckisthus represented using b +4 bytes. It is exp ected that RC5 key-managementschemes would typically manage and transmit entire RC5 control blo cks. As an example, the control blo ck 10 20 10 0A 20 33 7D 83 05 5F 62 51 BB 09 (in hexadecimal) sp eci es an RC5 algorithm (version 1.0) with 32-bit words, 16 rounds, and a 10-byte (80-bit) key \20 33 ... 09". 2 Parameter Values { Philosophy It is not intended that RC5 b e secure for all p ossible parameter values. For example, r =0provides essentially no encryption, and r = 1 is easily broken. And cho osing b = 0 clearly gives no security. On the other hand, cho osing the maximum parameter values would b e overkill for most applications. Weprovide a variety of parameter settings so that users may select an en- cryption algorithm whose security and sp eed are optimized for their application, while providing an evolutionary path for adjusting their parameters as necessary in the future. As an example, consider the problem of replacing DES with an \equivalent" RC5 algorithm, suchasRC5-32/16/7. The input/output blo cks are 2w = 64 bits long, just as in DES. The numb er of rounds is also the same, although eachRC5 round is similar to two DES rounds since all data registers, rather than just half of them, are up dated in one round. Finally,thenumberofkey bits, 7 8 = 56, is identical. Unlike unparameterized DES, however, RC5 p ermits upgrades as necessary. For example, an RC5 user can upgrade the ab ovechoice for a DES replacementto an 80-bit key, for example, bymoving to RC5-32/16/10. As technology improves, and as the true strength of RC5 algorithms b ecomes b etter understo o d through analysis, the most appropriate parameters can b e chosen. The choice of r a ects b oth encryption sp eed and security.For some ap- plications, high sp eed may b e the most critical requirement|one wishes for the b est security obtainable within a given encryption time requirement. Cho osing a smallish value of r (say r =6)mayprovide some security, alb eit mo dest, within the given sp eed constraint. In other applications, suchaskey-management, security is the primary con- cern, and sp eed is relatively unimp ortant. Here, cho osing 32 rounds mightbe appropriate for such applications. Since RC5 is a new design, the securitypro- vided byvarious values of r is still op en to study. Similarly, the word size w also a ects sp eed and security.For example, cho os- ing a value of w larger than the register size of the CPU can degrade encryption sp eed. The word size w = 16 is primarily for researchers who wish to examine the security prop erties of a natural \scaled-down" RC5. As 64-bit pro cessors b ecome common, one can movetoRC5-64 as a natural extension of RC5-32. It may also b e convenient to sp ecify w =64ifRC5 is to b e used as the basis for a hash function, in order to have 128-bit input/output blo cks. It may b e considered unusual and risky to sp ecify an encryption algorithm that p ermits insecure parameter choices. Wehavetwo resp onses to this criticism: 1. A xed set of parameters may b e at least as dangerous, since the parameters can not b e increased when necessary. Consider the problem DES has now: its key size is to o short, and there is no easy way to increase it. 2. It is exp ected that implementors will provide implementations that ensure that suitably large parameters are chosen. While unsafe choices mightbe usable in principle, in practice they would b e forbidden. It is not exp ected that a typical RC5 implementation will work with any RC5 control blo ck. Rather, it may only work for certain parameter values, or parameters in a certain range. The parameters w , r ,and b in a received or trans- mitted RC5 control blo ck are then merely used for type-checking|values other than those supp orted by the implementation will b e disallowed. The exibility of RC5 is thus utilized at the system design stage, when the appropriate param- eters are chosen, rather than at run time, when unsuitable parameters mightbe chosen byanunwary user. We prop ose RC5-32/12/16 as providing a \nominal" choice of parameters. Further analysis is needed to analyze the securityofthischoice. 3 Notation and RC5 Primitive Op erations We use lg(x) to denote the base-two logarithm of x. RC5 uses only the following three primitive op erations (and their inverses). w 1. Two's complement addition of words, denoted by \+". This is mo dulo-2 addition. The inverse op eration, subtraction, is denoted \". 2. Bit-wise exclusive-OR of words, denoted by . 3. A left-rotation (or \left-spin") of words: the rotation of word x left by y bits is denoted x<<<y. Only the lg(w )low-order bits of y are used to determine the rotation amount, so that y is interpreted mo dulo w .Theinverse op eration, right-rotation, is denoted x>>>y. These op erations are directly and eciently supp orted by most pro cessors. A distinguishing feature of RC5 is that the rotations are rotations by\vari- able" (plaintext-dep endent) amounts. We note that on mo dern micropro cessors, avariable-rotation x<<<y takes an amount of time that is indep endent of the shift amount y .We also note that rotations are the only non-linear op erator in RC5; there are no nonlinear substitution tables or other nonlinear op erators. The strength of RC5 dep ends heavily on the cryptographic prop erties of data- dep endent rotations. 4 The RC5 Algorithm The plaintext input to RC5 consists of two w -bit words, denoted A and B . The algorithm uses an expanded key table, S [0:::t 1], consisting of t =2(r +1) w -bit words. The key-expansion algorithm initializes S from the user's given secret key parameter K . (Note that S is not used like a DES S-b ox.) RC5 consists of three comp onents: a key expansion algorithm, an encryption algorithm, and a decryption algorithm. 4.1 Key Expansion The purp ose of the key-expansion routine is to expand the user's key K to ll the expanded key array S ,soS resembles an arrayoft random binary words determined by the user's secret key K . De nition of the Magic Constants The key-expansion algorithm uses two word-sized binary constants P and Q . They are de ned for arbitrary w as w w follows: w P = Odd((e 2)2 ) (1) w w Q = Odd(( 1)2 ) (2) w where e =2:718281828459::: (base of natural logarithms) =1:618033988749::: (golden ratio) ; and where Odd(x) is the least o dd integer greater than or equal to bxc.For w = 16, 32, and 64, each constantisgiven b elow in binary and in hexadecimal.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    7 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us