Cryptography Reference
In-Depth Information
By default, the rc5a program works with 32-bit words, 12 rounds, a keybox size
of 16 (
2 4 ) , and passphrases with lengths of up to 255 bytes. This means that
it implements an RC5a(32,12,*) algorithm (the asterisk stands for passphrases
of virtually unlimited length). The number of rounds can easily be increased;
it is passed when main() invokes the function rc5a() . The program can easily
be ported to 64-bit machines. You just need to edit the following macros in the
program header:
=
#define WORD
unsigned long
#define WEXP
6
#define P32
0xb7e151628aed2a6b
#define Q32
0x9e3779b97f4a7c15
(The names P64 and Q64 would be better.) The last two constants are equal
to 2 64 (e
2 ) and 2 64 ( 5 1 )/ 2 ) , where e denotes the base of natural loga-
rithms: e
= 2 . 718281828 ...
With RC5a(64,*,*), however, you can no longer evaluate encrypted texts on
32-bit machines. I therefore recommend to use this modification only locally.
The 64-bit algorithm is twice as fast as the 32-bit algorithm with the same
number of rounds under OSF/1 on an Alpha machine. (I recommend 16 rounds
for RC5a(64,*,*); the effective speed increased only by 75 %.)
Byte Order
You probably know that different processors have different byte orders . This
means that the four bytes of the 32-bit hexadecimal number
0x04030201
can have this order inside a machine, but they could also be 0x01020304, or
even 0x02010403 on PDP-11 computers. This makes clear that the left rotation
of this number by, say, 17 bits, produces a different value on each machine.
An important feature of RC5a is that this program tests the byte order, and
always writes the cipher in the byte order of Intel processors (the so-called
little-endian representation).
Search WWH ::




Custom Search