1 .\" @(#)des_crypt.3 2.1 88/08/11 4.0 RPCSRC; from 1.16 88/03/02 SMI;
7 .Nm des_crypt , ecb_crypt , cbc_crypt , des_setparity
8 .Nd "fast DES encryption"
14 .Fn ecb_crypt "char *key" "char *data" "unsigned datalen" "unsigned mode"
16 .Fn cbc_crypt "char *key" "char *data" "unsigned datalen" "unsigned mode" "char *ivec"
18 .Fn des_setparity "char *key"
28 (Data Encryption Standard).
29 These routines are faster and more general purpose than
31 They also are able to utilize
33 hardware if it is available.
39 (Electronic Code Book)
40 mode, which encrypts blocks of data independently.
46 (Cipher Block Chaining)
47 mode, which chains together
50 mode protects against insertions, deletions and
51 substitutions of blocks.
52 Also, regularities in the clear text will
53 not appear in the cipher text.
55 Here is how to use these routines.
58 is the 8-byte encryption key with parity.
59 To set the key's parity, which for
61 is in the low bit of each byte, use
65 contains the data to be encrypted or decrypted.
69 is the length in bytes of
71 which must be a multiple of 8.
77 For the encryption direction
83 For software versus hardware
92 is specified, and there is no hardware, then the encryption is performed
93 in software and the routine returns
94 .Er DESERR_NOHWDEVICE .
100 is the 8-byte initialization
101 vector for the chaining.
102 It is updated to the next initialization
105 .Bl -tag -width [DESERR_NOHWDEVICE] -compact
106 .It Bq Er DESERR_NONE
108 .It Bq Er DESERR_NOHWDEVICE
109 Encryption succeeded, but done in software instead of the requested hardware.
110 .It Bq Er DESERR_HWERR
111 An error occurred in the hardware or driver.
112 .It Bq Er DESERR_BADPARAM
113 Bad argument to routine.
116 Given a result status
120 is false only for the first two statuses.
125 These routines are not available in RPCSRC 4.0.
126 This information is provided to describe the
128 interface expected by