1 .\" @(#)des_crypt.3 2.1 88/08/11 4.0 RPCSRC; from 1.16 88/03/02 SMI;
8 .Nm des_crypt , ecb_crypt , cbc_crypt , des_setparity
9 .Nd "fast DES encryption"
15 .Fn ecb_crypt "char *key" "char *data" "unsigned datalen" "unsigned mode"
17 .Fn cbc_crypt "char *key" "char *data" "unsigned datalen" "unsigned mode" "char *ivec"
19 .Fn des_setparity "char *key"
29 (Data Encryption Standard).
30 These routines are faster and more general purpose than
32 They also are able to utilize
34 hardware if it is available.
40 (Electronic Code Book)
41 mode, which encrypts blocks of data independently.
47 (Cipher Block Chaining)
48 mode, which chains together
51 mode protects against insertions, deletions and
52 substitutions of blocks.
53 Also, regularities in the clear text will
54 not appear in the cipher text.
56 Here is how to use these routines.
59 is the 8-byte encryption key with parity.
60 To set the key's parity, which for
62 is in the low bit of each byte, use
66 contains the data to be encrypted or decrypted.
70 is the length in bytes of
72 which must be a multiple of 8.
78 For the encryption direction
84 For software versus hardware
93 is specified, and there is no hardware, then the encryption is performed
94 in software and the routine returns
95 .Er DESERR_NOHWDEVICE .
101 is the 8-byte initialization
102 vector for the chaining.
103 It is updated to the next initialization
106 .Bl -tag -width [DESERR_NOHWDEVICE] -compact
107 .It Bq Er DESERR_NONE
109 .It Bq Er DESERR_NOHWDEVICE
110 Encryption succeeded, but done in software instead of the requested hardware.
111 .It Bq Er DESERR_HWERR
112 An error occurred in the hardware or driver.
113 .It Bq Er DESERR_BADPARAM
114 Bad argument to routine.
117 Given a result status
121 is false only for the first two statuses.
126 These routines are not available in RPCSRC 4.0.
127 This information is provided to describe the
129 interface expected by