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"
27 (Data Encryption Standard).
28 These routines are faster and more general purpose than
30 They also are able to utilize
32 hardware if it is available.
36 (Electronic Code Book)
37 mode, which encrypts blocks of data independently.
41 (Cipher Block Chaining)
42 mode, which chains together
45 mode protects against insertions, deletions and
46 substitutions of blocks.
47 Also, regularities in the clear text will
48 not appear in the cipher text.
50 Here is how to use these routines.
53 is the 8-byte encryption key with parity.
54 To set the key's parity, which for
56 is in the low bit of each byte, use
60 contains the data to be encrypted or decrypted.
64 is the length in bytes of
66 which must be a multiple of 8.
72 For the encryption direction
78 For software versus hardware
87 is specified, and there is no hardware, then the encryption is performed
88 in software and the routine returns
89 .Er DESERR_NOHWDEVICE .
94 is the 8-byte initialization
95 vector for the chaining.
96 It is updated to the next initialization
99 .Bl -tag -width [DESERR_NOHWDEVICE] -compact
100 .It Bq Er DESERR_NONE
102 .It Bq Er DESERR_NOHWDEVICE
103 Encryption succeeded, but done in software instead of the requested hardware.
104 .It Bq Er DESERR_HWERR
105 An error occurred in the hardware or driver.
106 .It Bq Er DESERR_BADPARAM
107 Bad parameter to routine.
110 Given a result status
114 is false only for the first two statuses.
119 These routines are not available in RPCSRC 4.0.
120 This information is provided to describe the
122 interface expected by