Cryptography Reference
In-Depth Information
for the encryption of data streams, which means that rc5a works as a filter.
The user interface is Spartan: the command line
rc5a <plaintext >ciphertext
suffices for encryption. For decryption, you just add an optional argument:
rc5a a <ciphertext >plaintext.
The password is requested interactively, but it can also be told by using the
CRYPTKEY environment variable (which is a security risk, of course).
You can find shell scripts for easy encryption of single files and for the creation
of encrypted archives on our Web site. In general, rc5a is conceived as a
helper program to be embedded in other programs. The main function, which
is responsible for the Spartan interface, is only a few lines long. It is best to
have a look at the function rc5a() to see how components of the program, such
as password entry, key management, and the actual encryption and decryption,
are built into other software.
I tested the program on a number of different UNIX platforms (UnixWare 2.0,
ESIX V4.2MP, HP-UX 9.0, Sinix 5.42, SunOS 4.1, OSF/1 3.0, Ultrix 4.3,
SuSE-Linux 6.4 ... 9.0, ... ), and no problem arose when porting it to Windows
NT either (see Section 5.4.4). Using unsigned long as the data type for the
WORD macro (see below), I even managed a DOS porting of the decrypted
part for 16-bit compilers, though the input/output detour required some tricks.
The terminal control upon entering a password requires POSIX compatibility,
but the few machine-specific routines at the end of the program are marked as
such and easily replaced anyway.
The speed of rc5a ranges from 240 Kbytes per second on a PC 486-33 to
about 1.5 Mbytes per second on a 133-MHz Pentium PC (both computers run-
ning ESIX V4.2). The two macros ROTL and ROTR, which are responsible for
rotating 32-bit words, make the performance drop. The speed improves slightly
when using assembler commands instead of these macros, but not dramatically.
Notice that the speeds measured are gross indicative values, i.e., they corre-
spond to times actually required for encrypting files on the hard disk. Many
such benchmarks state only a theoretical data throughput!
Search WWH ::




Custom Search