Chapter 3 Cryptography 39
Cryptography Overview
it is proprietary to RSA Security. The RC2 cipher has an eight-byte block size.
Therefore, the input must be a multiple of eight bytes, or be padded to be a multiple
of eight bytes, for the RC2 cipher to operate properly in CBC or ECB modes.
The RC2 input key can be of any length from 1 to 128 bytes. The algorithm uses the
input key to generate an effective key that is actually used for encryptio n purposes.
Internally, the algorithm builds a key table based on the bits of the key data; the
chosen number of effective key bits limits the number of possible key tables. The
effective key size is variable and takes values from one bit up to 1024 bits.
Note: Control over your effective key size benefits you, because you can generate
up to 128 bytes of key data and set the algorithm to use a smaller number of
effective bits, such as 80. Then, in the future, if you want to increase the
number of effective key bits, you do not have to change the code that
generates the key data, only the effective key bit parameter.
RC5
The RC5 cipher was developed by Ronald Rivest as an alternative to DES encryption;
it is proprietary to RSA Security. It is a block cipher with the block being either 4
bytes, 8 bytes, or 16 bytes, depending on the word size. The input must be a multiple
of the block size, or it must be padded to a multiple of the block size for the RC5
cipher to operate properly. The RC5 ciphers speed and security are dependent on
input parameters determined by the user. These parameters are:
word size
rounds
key size (in bytes)
Word size generally refers to the size of a hardware register. For hardware
implementations of the RC5 cipher, developers can take advantage of larger registers
to increase speed. On chips with smaller registers, the word size can be emulated in
software. Version 1.0 of the RC5 cipher accepts word sizes of 16, 32, or 64 bits. Crypto-
C accepts a word size of 32 or 64 bits. The block size is twice the word size. For a word
size of 32 bits, the block size is 64 bits, or 8 bytes, the same as for DES and the RC2
cipher. For a word size of 64 bits, the block size is 128 bits, or 16 bytes.
The number of rounds is the number of times the operation employs the inner
encryption function. Varying the number of rounds allows developers to make a
tradeoff between speed and security. The greater the number of rounds, the greater
the security, but the slower the execution. The number of rounds can be anywhere
from 0 (zero) to 255. For the RC5 cipher with a 32-bit word size, RSA Security
recommends at least 16 rounds for applications; while no practical attacks are known