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 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
11 .\" can be distributed under GPL.
14 .TH DES_CRYPT 3 2021-03-22 "" "Linux Programmer's Manual"
16 des_crypt, ecb_crypt, cbc_crypt, des_setparity, DES_FAILED \- fast
21 .\" .B #include <des_crypt.h>
22 .B #include <rpc/des_crypt.h>
24 .BI "int ecb_crypt(char *" key ", char *" data ", unsigned int " datalen ,
25 .BI " unsigned int " mode );
26 .BI "int cbc_crypt(char *" key ", char *" data ", unsigned int " datalen ,
27 .BI " unsigned int " mode ", char *" ivec );
29 .BI "void des_setparity(char *" key );
31 .BI "int DES_FAILED(int " status );
40 (Data Encryption Standard).
41 These routines are faster and more general purpose than
43 They also are able to utilize
45 hardware if it is available.
49 (Electronic Code Book)
50 mode, which encrypts blocks of data independently.
54 (Cipher Block Chaining)
55 mode, which chains together
58 mode protects against insertions, deletions, and
59 substitutions of blocks.
60 Also, regularities in the clear text will
61 not appear in the cipher text.
63 Here is how to use these routines.
66 is the 8-byte encryption key with parity.
67 To set the key's parity, which for
69 is in the low bit of each byte, use
73 contains the data to be encrypted or decrypted.
77 is the length in bytes of
79 which must be a multiple of 8.
82 is formed by ORing together some things.
83 For the encryption direction OR in either
87 For software versus hardware
88 encryption, OR in either
94 is specified, and there is no hardware, then the encryption is performed
95 in software and the routine returns
96 .BR DESERR_NOHWDEVICE .
101 is the 8-byte initialization
102 vector for the chaining.
103 It is updated to the next initialization
110 .BR 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 argument to routine.
119 Given a result status
124 .BI DES_FAILED( stat )
125 is false only for the first two statuses.
126 .\" So far the Sun page
127 .\" Some additions - aeb
129 These functions were added to glibc in version 2.1.
131 Because they employ the DES block cipher,
132 which is no longer considered secure,
138 were removed in glibc 2.28.
139 Applications should switch to a modern cryptography library, such as
142 For an explanation of the terms used in this section, see
150 Interface Attribute Value
155 T} Thread safety MT-Safe