1 .\" @(#)des_crypt.3 2.1 88/08/11 4.0 RPCSRC; from 1.16 88/03/02 SMI;
2 .\" $FreeBSD: src/lib/libc/rpc/des_crypt.3,v 1.4.2.3 2001/12/14 18:33:56 ru Exp $
3 .\" $DragonFly: src/lib/libc/rpc/des_crypt.3,v 1.2 2003/06/17 04:26:44 dillon Exp $
9 .Nm des_crypt , ecb_crypt , cbc_crypt , des_setparity
10 .Nd "fast DES encryption"
16 .Fn ecb_crypt "char *key" "char *data" "unsigned datalen" "unsigned mode"
18 .Fn cbc_crypt "char *key" "char *data" "unsigned datalen" "unsigned mode" "char *ivec"
20 .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.
37 (Electronic Code Book)
38 mode, which encrypts blocks of data independently.
42 (Cipher Block Chaining)
43 mode, which chains together
46 mode protects against insertions, deletions and
47 substitutions of blocks.
48 Also, regularities in the clear text will
49 not appear in the cipher text.
51 Here is how to use these routines.
54 is the 8-byte encryption key with parity.
55 To set the key's parity, which for
57 is in the low bit of each byte, use
61 contains the data to be encrypted or decrypted.
65 is the length in bytes of
67 which must be a multiple of 8.
73 For the encryption direction
79 For software versus hardware
88 is specified, and there is no hardware, then the encryption is performed
89 in software and the routine returns
90 .Er DESERR_NOHWDEVICE .
95 is the 8-byte initialization
96 vector for the chaining.
97 It is updated to the next initialization
100 .Bl -tag -width [DESERR_NOHWDEVICE] -compact
101 .It Bq Er DESERR_NONE
103 .It Bq Er DESERR_NOHWDEVICE
104 Encryption succeeded, but done in software instead of the requested hardware.
105 .It Bq Er DESERR_HWERR
106 An error occurred in the hardware or driver.
107 .It Bq Er DESERR_BADPARAM
108 Bad parameter to routine.
111 Given a result status
115 is false only for the first two statuses.
120 These routines are not available in RPCSRC 4.0.
121 This information is provided to describe the
123 interface expected by