2 .\" @(#)des_crypt.3 2.1 88/08/11 4.0 RPCSRC; from 1.16 88/03/02 SMI;
4 .\" Taken from libc4 sources, which say:
5 .\" Copyright (C) 1993 Eric Young - can be distributed under GPL.
7 .\" However, the above header line suggests that this file in fact is
8 .\" Copyright Sun Microsystems, Inc (and is provided for unrestricted use,
9 .\" see other Sun RPC sources).
11 .\" SPDX-License-Identifier: GPL-1.0-or-later
13 .TH des_crypt 3 (date) "Linux man-pages (unreleased)"
15 des_crypt, ecb_crypt, cbc_crypt, des_setparity, DES_FAILED \- fast
19 .RI ( libc ", " \-lc )
23 .\" .B #include <des_crypt.h>
24 .B #include <rpc/des_crypt.h>
26 .BI "[[deprecated]] int ecb_crypt(char *" key ", char " data [. datalen ],
27 .BI " unsigned int " datalen ", \
28 unsigned int " mode );
29 .BI "[[deprecated]] int cbc_crypt(char *" key ", char " data [. datalen ],
30 .BI " unsigned int " datalen ", \
34 .BI "[[deprecated]] void des_setparity(char *" key );
36 .BI "[[deprecated]] int DES_FAILED(int " status );
45 (Data Encryption Standard).
46 These routines are faster and more general purpose than
48 They also are able to utilize
50 hardware if it is available.
54 (Electronic Code Book)
55 mode, which encrypts blocks of data independently.
59 (Cipher Block Chaining)
60 mode, which chains together
63 mode protects against insertions, deletions, and
64 substitutions of blocks.
65 Also, regularities in the clear text will
66 not appear in the cipher text.
68 Here is how to use these routines.
71 is the 8-byte encryption key with parity.
72 To set the key's parity, which for
74 is in the low bit of each byte, use
78 contains the data to be encrypted or decrypted.
82 is the length in bytes of
84 which must be a multiple of 8.
87 is formed by ORing together some things.
88 For the encryption direction OR in either
92 For software versus hardware
93 encryption, OR in either
99 is specified, and there is no hardware, then the encryption is performed
100 in software and the routine returns
101 .BR DESERR_NOHWDEVICE .
106 is the 8-byte initialization
107 vector for the chaining.
108 It is updated to the next initialization
116 Encryption succeeded, but done in software instead of the requested hardware.
119 An error occurred in the hardware or driver.
122 Bad argument to routine.
124 Given a result status
129 .BI DES_FAILED( stat )
130 is false only for the first two statuses.
131 .\" So far the Sun page
132 .\" Some additions - aeb
134 For an explanation of the terms used in this section, see
140 Interface Attribute Value
147 T} Thread safety MT-Safe
154 Removed in glibc 2.28.
156 Because they employ the DES block cipher,
157 which is no longer considered secure,
158 these functions were removed.
159 Applications should switch to a modern cryptography library, such as