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.4 2008/05/25 18:11:47 swildner Exp $
13 .Nd "fast DES encryption"
19 .Fn ecb_crypt "char *key" "char *data" "unsigned datalen" "unsigned mode"
21 .Fn cbc_crypt "char *key" "char *data" "unsigned datalen" "unsigned mode" "char *ivec"
23 .Fn des_setparity "char *key"
31 (Data Encryption Standard).
32 These routines are faster and more general purpose than
34 They also are able to utilize
36 hardware if it is available.
40 (Electronic Code Book)
41 mode, which encrypts blocks of data independently.
45 (Cipher Block Chaining)
46 mode, which chains together
49 mode protects against insertions, deletions and
50 substitutions of blocks.
51 Also, regularities in the clear text will
52 not appear in the cipher text.
54 Here is how to use these routines.
57 is the 8-byte encryption key with parity.
58 To set the key's parity, which for
60 is in the low bit of each byte, use
64 contains the data to be encrypted or decrypted.
68 is the length in bytes of
70 which must be a multiple of 8.
76 For the encryption direction
82 For software versus hardware
91 is specified, and there is no hardware, then the encryption is performed
92 in software and the routine returns
93 .Dv 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 ".Dv DESERR_NOHWDEVICE" -compact
106 .It Dv DESERR_NOHWDEVICE
107 Encryption succeeded, but done in software instead of the requested hardware.
109 An error occurred in the hardware or driver.
110 .It Dv DESERR_BADPARAM
111 Bad parameter to routine.
114 Given a result status
118 is false only for the first two statuses.
123 These routines are not available in RPCSRC 4.0.
124 This information is provided to describe the
126 interface expected by