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"
12 .Fn ecb_crypt "char *key" "char *data" "unsigned datalen" "unsigned mode"
14 .Fn cbc_crypt "char *key" "char *data" "unsigned datalen" "unsigned mode" "char *ivec"
16 .Fn des_setparity "char *key"
26 (Data Encryption Standard).
27 These routines are faster and more general purpose than
29 They also are able to utilize
31 hardware if it is available.
37 (Electronic Code Book)
38 mode, which encrypts blocks of data independently.
44 (Cipher Block Chaining)
45 mode, which chains together
48 mode protects against insertions, deletions and
49 substitutions of blocks.
50 Also, regularities in the clear text will
51 not appear in the cipher text.
53 Here is how to use these routines.
56 is the 8-byte encryption key with parity.
57 To set the key's parity, which for
59 is in the low bit of each byte, use
63 contains the data to be encrypted or decrypted.
67 is the length in bytes of
69 which must be a multiple of 8.
75 For the encryption direction
81 For software versus hardware
90 is specified, and there is no hardware, then the encryption is performed
91 in software and the routine returns
92 .Er DESERR_NOHWDEVICE .
98 is the 8-byte initialization
99 vector for the chaining.
100 It is updated to the next initialization
103 .Bl -tag -width [DESERR_NOHWDEVICE] -compact
104 .It Bq Er DESERR_NONE
106 .It Bq Er DESERR_NOHWDEVICE
107 Encryption succeeded, but done in software instead of the requested hardware.
108 .It Bq Er DESERR_HWERR
109 An error occurred in the hardware or driver.
110 .It Bq Er DESERR_BADPARAM
111 Bad argument to routine.
114 Given a result status
118 is false only for the first two statuses.
125 functions are part of libtirpc.
130 These routines are not available in RPCSRC 4.0.
131 This information is provided to describe the
133 interface expected by