.\" @(#)des_crypt.3 2.1 88/08/11 4.0 RPCSRC; from 1.16 88/03/02 SMI;
.TH DES_CRYPT 3 "6 October 1987"
des_crypt, ecb_crypt, cbc_crypt, des_setparity \- fast DES encryption
.B #include <des_crypt.h>
.B int ecb_crypt(key, data, datalen, mode)
.B int cbc_crypt(key, data, datalen, mode, ivec)
.B void des_setparity(key)
.IX encryption cbc_crypt "" \fLcbc_crypt\fP
.IX "des encryption" cbc_crypt "DES encryption" \fLcbc_crypt\fP
.IX encryption des_setparity "" \fLdes_setparity\fP
.IX "des encryption" des_setparity "DES encryption" \fLdes_setparity\fP
(Data Encryption Standard).
These routines are faster and more general purpose than
They also are able to utilize
hardware if it is available.
mode, which encrypts blocks of data independently.
mode, which chains together
mode protects against insertions, deletions and
substitutions of blocks. Also, regularities in the clear text will
not appear in the cipher text.
Here is how to use these routines. The first parameter,
is the 8-byte encryption key with parity.
To set the key's parity, which for
is in the low bit of each byte, use
contains the data to be encrypted or decrypted. The
is the length in bytes of
which must be a multiple of 8. The fourth parameter,
together some things. For the encryption direction 'or' in either
For software versus hardware
encryption, 'or' in either
is specified, and there is no hardware, then the encryption is performed
in software and the routine returns
.SM DESERR_NOHWDEVICE\s0.
is the the 8-byte initialization
vector for the chaining. It is updated to the next initialization
Encryption succeeded, but done in software instead of the requested hardware.
An error occurred in the hardware or driver.
Bad parameter to routine.
is false only for the first two statuses.
These routines are not available in RPCSRC 4.0.
This information is provided to describe the DES interface expected by