1 .\" @(#)des_crypt.3 2.1 88/08/11 4.0 RPCSRC; from 1.16 88/03/02 SMI;
3 .\" Taken from libc4 sources, which say:
4 .\" Copyright (C) 1993 Eric Young - can be distributed under GPL.
6 .\" However, the above header line suggests that this file in fact is
7 .\" Copyright Sun Microsystems, Inc (and is provided for unrestricted use,
8 .\" see other Sun RPC sources).
10 .TH DES_CRYPT 3 "6 October 1987"
12 des_crypt, ecb_crypt, cbc_crypt, des_setparity, DES_FAILED \- fast
17 .\" .B #include <des_crypt.h>
18 .B #include <rpc/des_crypt.h>
20 .BI "int ecb_crypt(char *" key ", char *" data ", unsigned " datalen ,
21 .BI " unsigned " mode );
23 .BI "int cbc_crypt(char *" key ", char *" data ", unsigned " datalen ,
24 .BI " unsigned " mode ", char *" ivec );
26 .BI "void des_setparity(char *" key );
28 .BI "int DES_FAILED(int " status );
37 (Data Encryption Standard).
38 These routines are faster and more general purpose than
40 They also are able to utilize
42 hardware if it is available.
46 (Electronic Code Book)
47 mode, which encrypts blocks of data independently.
51 (Cipher Block Chaining)
52 mode, which chains together
55 mode protects against insertions, deletions and
56 substitutions of blocks. Also, regularities in the clear text will
57 not appear in the cipher text.
59 Here is how to use these routines. The first parameter,
61 is the 8-byte encryption key with parity.
62 To set the key's parity, which for
64 is in the low bit of each byte, use
68 contains the data to be encrypted or decrypted. The
71 is the length in bytes of
73 which must be a multiple of 8. The fourth parameter,
77 together some things. For the encryption direction 'or' in either
81 For software versus hardware
82 encryption, 'or' in either
88 is specified, and there is no hardware, then the encryption is performed
89 in software and the routine returns
90 .SM DESERR_NOHWDEVICE\s0.
95 is the 8-byte initialization
96 vector for the chaining. It is updated to the next initialization
110 .SM DESERR_NOHWDEVICE
111 Encryption succeeded, but done in software instead of the requested hardware.
114 An error occurred in the hardware or driver.
117 Bad parameter to routine.
120 Given a result status
125 .BI DES_FAILED( stat )
126 is false only for the first two statuses.
127 .\" So far the Sun page
128 .\" Some additions - aeb
130 These routines are present in libc 4.6.27 and later, and in
133 4.3BSD. Not in POSIX.1-2001.