]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - secure/lib/libcrypto/man/DES_random_key.3
Update clang, llvm, lld, lldb, compiler-rt and libc++ version number to
[FreeBSD/FreeBSD.git] / secure / lib / libcrypto / man / DES_random_key.3
1 .\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35)
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sp \" Vertical space (when we can't use .PP)
6 .if t .sp .5v
7 .if n .sp
8 ..
9 .de Vb \" Begin verbatim text
10 .ft CW
11 .nf
12 .ne \\$1
13 ..
14 .de Ve \" End verbatim text
15 .ft R
16 .fi
17 ..
18 .\" Set up some character translations and predefined strings.  \*(-- will
19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
20 .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
21 .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
22 .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
23 .\" nothing in troff, for use with C<>.
24 .tr \(*W-
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
26 .ie n \{\
27 .    ds -- \(*W-
28 .    ds PI pi
29 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
31 .    ds L" ""
32 .    ds R" ""
33 .    ds C` ""
34 .    ds C' ""
35 'br\}
36 .el\{\
37 .    ds -- \|\(em\|
38 .    ds PI \(*p
39 .    ds L" ``
40 .    ds R" ''
41 .    ds C`
42 .    ds C'
43 'br\}
44 .\"
45 .\" Escape single quotes in literal strings from groff's Unicode transform.
46 .ie \n(.g .ds Aq \(aq
47 .el       .ds Aq '
48 .\"
49 .\" If the F register is >0, we'll generate index entries on stderr for
50 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
51 .\" entries marked with X<> in POD.  Of course, you'll have to process the
52 .\" output yourself in some meaningful fashion.
53 .\"
54 .\" Avoid warning from groff about undefined register 'F'.
55 .de IX
56 ..
57 .if !\nF .nr F 0
58 .if \nF>0 \{\
59 .    de IX
60 .    tm Index:\\$1\t\\n%\t"\\$2"
61 ..
62 .    if !\nF==2 \{\
63 .        nr % 0
64 .        nr F 2
65 .    \}
66 .\}
67 .\"
68 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
70 .    \" fudge factors for nroff and troff
71 .if n \{\
72 .    ds #H 0
73 .    ds #V .8m
74 .    ds #F .3m
75 .    ds #[ \f1
76 .    ds #] \fP
77 .\}
78 .if t \{\
79 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80 .    ds #V .6m
81 .    ds #F 0
82 .    ds #[ \&
83 .    ds #] \&
84 .\}
85 .    \" simple accents for nroff and troff
86 .if n \{\
87 .    ds ' \&
88 .    ds ` \&
89 .    ds ^ \&
90 .    ds , \&
91 .    ds ~ ~
92 .    ds /
93 .\}
94 .if t \{\
95 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101 .\}
102 .    \" troff and (daisy-wheel) nroff accents
103 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110 .ds ae a\h'-(\w'a'u*4/10)'e
111 .ds Ae A\h'-(\w'A'u*4/10)'E
112 .    \" corrections for vroff
113 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115 .    \" for low resolution devices (crt and lpr)
116 .if \n(.H>23 .if \n(.V>19 \
117 \{\
118 .    ds : e
119 .    ds 8 ss
120 .    ds o a
121 .    ds d- d\h'-1'\(ga
122 .    ds D- D\h'-1'\(hy
123 .    ds th \o'bp'
124 .    ds Th \o'LP'
125 .    ds ae ae
126 .    ds Ae AE
127 .\}
128 .rm #[ #] #H #V #F C
129 .\" ========================================================================
130 .\"
131 .IX Title "DES_RANDOM_KEY 3"
132 .TH DES_RANDOM_KEY 3 "2018-11-20" "1.1.1a" "OpenSSL"
133 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
134 .\" way too many mistakes in technical documents.
135 .if n .ad l
136 .nh
137 .SH "NAME"
138 DES_random_key, DES_set_key, DES_key_sched, DES_set_key_checked, DES_set_key_unchecked, DES_set_odd_parity, DES_is_weak_key, DES_ecb_encrypt, DES_ecb2_encrypt, DES_ecb3_encrypt, DES_ncbc_encrypt, DES_cfb_encrypt, DES_ofb_encrypt, DES_pcbc_encrypt, DES_cfb64_encrypt, DES_ofb64_encrypt, DES_xcbc_encrypt, DES_ede2_cbc_encrypt, DES_ede2_cfb64_encrypt, DES_ede2_ofb64_encrypt, DES_ede3_cbc_encrypt, DES_ede3_cfb64_encrypt, DES_ede3_ofb64_encrypt, DES_cbc_cksum, DES_quad_cksum, DES_string_to_key, DES_string_to_2keys, DES_fcrypt, DES_crypt \- DES encryption
139 .SH "SYNOPSIS"
140 .IX Header "SYNOPSIS"
141 .Vb 1
142 \& #include <openssl/des.h>
143 \&
144 \& void DES_random_key(DES_cblock *ret);
145 \&
146 \& int DES_set_key(const_DES_cblock *key, DES_key_schedule *schedule);
147 \& int DES_key_sched(const_DES_cblock *key, DES_key_schedule *schedule);
148 \& int DES_set_key_checked(const_DES_cblock *key, DES_key_schedule *schedule);
149 \& void DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule);
150 \&
151 \& void DES_set_odd_parity(DES_cblock *key);
152 \& int DES_is_weak_key(const_DES_cblock *key);
153 \&
154 \& void DES_ecb_encrypt(const_DES_cblock *input, DES_cblock *output,
155 \&                      DES_key_schedule *ks, int enc);
156 \& void DES_ecb2_encrypt(const_DES_cblock *input, DES_cblock *output,
157 \&                       DES_key_schedule *ks1, DES_key_schedule *ks2, int enc);
158 \& void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output,
159 \&                       DES_key_schedule *ks1, DES_key_schedule *ks2,
160 \&                       DES_key_schedule *ks3, int enc);
161 \&
162 \& void DES_ncbc_encrypt(const unsigned char *input, unsigned char *output,
163 \&                       long length, DES_key_schedule *schedule, DES_cblock *ivec,
164 \&                       int enc);
165 \& void DES_cfb_encrypt(const unsigned char *in, unsigned char *out,
166 \&                      int numbits, long length, DES_key_schedule *schedule,
167 \&                      DES_cblock *ivec, int enc);
168 \& void DES_ofb_encrypt(const unsigned char *in, unsigned char *out,
169 \&                      int numbits, long length, DES_key_schedule *schedule,
170 \&                      DES_cblock *ivec);
171 \& void DES_pcbc_encrypt(const unsigned char *input, unsigned char *output,
172 \&                       long length, DES_key_schedule *schedule, DES_cblock *ivec,
173 \&                       int enc);
174 \& void DES_cfb64_encrypt(const unsigned char *in, unsigned char *out,
175 \&                        long length, DES_key_schedule *schedule, DES_cblock *ivec,
176 \&                        int *num, int enc);
177 \& void DES_ofb64_encrypt(const unsigned char *in, unsigned char *out,
178 \&                        long length, DES_key_schedule *schedule, DES_cblock *ivec,
179 \&                        int *num);
180 \&
181 \& void DES_xcbc_encrypt(const unsigned char *input, unsigned char *output,
182 \&                       long length, DES_key_schedule *schedule, DES_cblock *ivec,
183 \&                       const_DES_cblock *inw, const_DES_cblock *outw, int enc);
184 \&
185 \& void DES_ede2_cbc_encrypt(const unsigned char *input, unsigned char *output,
186 \&                           long length, DES_key_schedule *ks1,
187 \&                           DES_key_schedule *ks2, DES_cblock *ivec, int enc);
188 \& void DES_ede2_cfb64_encrypt(const unsigned char *in, unsigned char *out,
189 \&                             long length, DES_key_schedule *ks1,
190 \&                             DES_key_schedule *ks2, DES_cblock *ivec,
191 \&                             int *num, int enc);
192 \& void DES_ede2_ofb64_encrypt(const unsigned char *in, unsigned char *out,
193 \&                             long length, DES_key_schedule *ks1,
194 \&                             DES_key_schedule *ks2, DES_cblock *ivec, int *num);
195 \&
196 \& void DES_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output,
197 \&                           long length, DES_key_schedule *ks1,
198 \&                           DES_key_schedule *ks2, DES_key_schedule *ks3,
199 \&                           DES_cblock *ivec, int enc);
200 \& void DES_ede3_cfb64_encrypt(const unsigned char *in, unsigned char *out,
201 \&                             long length, DES_key_schedule *ks1,
202 \&                             DES_key_schedule *ks2, DES_key_schedule *ks3,
203 \&                             DES_cblock *ivec, int *num, int enc);
204 \& void DES_ede3_ofb64_encrypt(const unsigned char *in, unsigned char *out,
205 \&                             long length, DES_key_schedule *ks1,
206 \&                             DES_key_schedule *ks2, DES_key_schedule *ks3,
207 \&                             DES_cblock *ivec, int *num);
208 \&
209 \& DES_LONG DES_cbc_cksum(const unsigned char *input, DES_cblock *output,
210 \&                        long length, DES_key_schedule *schedule,
211 \&                        const_DES_cblock *ivec);
212 \& DES_LONG DES_quad_cksum(const unsigned char *input, DES_cblock output[],
213 \&                         long length, int out_count, DES_cblock *seed);
214 \& void DES_string_to_key(const char *str, DES_cblock *key);
215 \& void DES_string_to_2keys(const char *str, DES_cblock *key1, DES_cblock *key2);
216 \&
217 \& char *DES_fcrypt(const char *buf, const char *salt, char *ret);
218 \& char *DES_crypt(const char *buf, const char *salt);
219 .Ve
220 .SH "DESCRIPTION"
221 .IX Header "DESCRIPTION"
222 This library contains a fast implementation of the \s-1DES\s0 encryption
223 algorithm.
224 .PP
225 There are two phases to the use of \s-1DES\s0 encryption.  The first is the
226 generation of a \fIDES_key_schedule\fR from a key, the second is the
227 actual encryption.  A \s-1DES\s0 key is of type \fIDES_cblock\fR. This type
228 consists of 8 bytes with odd parity.  The least significant bit in
229 each byte is the parity bit.  The key schedule is an expanded form of
230 the key; it is used to speed the encryption process.
231 .PP
232 \&\fIDES_random_key()\fR generates a random key.  The \s-1PRNG\s0 must be seeded
233 prior to using this function (see \fIRAND_bytes\fR\|(3)).  If the \s-1PRNG\s0
234 could not generate a secure key, 0 is returned.
235 .PP
236 Before a \s-1DES\s0 key can be used, it must be converted into the
237 architecture dependent \fIDES_key_schedule\fR via the
238 \&\fIDES_set_key_checked()\fR or \fIDES_set_key_unchecked()\fR function.
239 .PP
240 \&\fIDES_set_key_checked()\fR will check that the key passed is of odd parity
241 and is not a weak or semi-weak key.  If the parity is wrong, then \-1
242 is returned.  If the key is a weak key, then \-2 is returned.  If an
243 error is returned, the key schedule is not generated.
244 .PP
245 \&\fIDES_set_key()\fR works like
246 \&\fIDES_set_key_checked()\fR if the \fIDES_check_key\fR flag is non-zero,
247 otherwise like \fIDES_set_key_unchecked()\fR.  These functions are available
248 for compatibility; it is recommended to use a function that does not
249 depend on a global variable.
250 .PP
251 \&\fIDES_set_odd_parity()\fR sets the parity of the passed \fIkey\fR to odd.
252 .PP
253 \&\fIDES_is_weak_key()\fR returns 1 if the passed key is a weak key, 0 if it
254 is ok.
255 .PP
256 The following routines mostly operate on an input and output stream of
257 \&\fIDES_cblock\fRs.
258 .PP
259 \&\fIDES_ecb_encrypt()\fR is the basic \s-1DES\s0 encryption routine that encrypts or
260 decrypts a single 8\-byte \fIDES_cblock\fR in \fIelectronic code book\fR
261 (\s-1ECB\s0) mode.  It always transforms the input data, pointed to by
262 \&\fIinput\fR, into the output data, pointed to by the \fIoutput\fR argument.
263 If the \fIencrypt\fR argument is non-zero (\s-1DES_ENCRYPT\s0), the \fIinput\fR
264 (cleartext) is encrypted in to the \fIoutput\fR (ciphertext) using the
265 key_schedule specified by the \fIschedule\fR argument, previously set via
266 \&\fIDES_set_key\fR. If \fIencrypt\fR is zero (\s-1DES_DECRYPT\s0), the \fIinput\fR (now
267 ciphertext) is decrypted into the \fIoutput\fR (now cleartext).  Input
268 and output may overlap.  \fIDES_ecb_encrypt()\fR does not return a value.
269 .PP
270 \&\fIDES_ecb3_encrypt()\fR encrypts/decrypts the \fIinput\fR block by using
271 three-key Triple-DES encryption in \s-1ECB\s0 mode.  This involves encrypting
272 the input with \fIks1\fR, decrypting with the key schedule \fIks2\fR, and
273 then encrypting with \fIks3\fR.  This routine greatly reduces the chances
274 of brute force breaking of \s-1DES\s0 and has the advantage of if \fIks1\fR,
275 \&\fIks2\fR and \fIks3\fR are the same, it is equivalent to just encryption
276 using \s-1ECB\s0 mode and \fIks1\fR as the key.
277 .PP
278 The macro \fIDES_ecb2_encrypt()\fR is provided to perform two-key Triple-DES
279 encryption by using \fIks1\fR for the final encryption.
280 .PP
281 \&\fIDES_ncbc_encrypt()\fR encrypts/decrypts using the \fIcipher-block-chaining\fR
282 (\s-1CBC\s0) mode of \s-1DES.\s0  If the \fIencrypt\fR argument is non-zero, the
283 routine cipher-block-chain encrypts the cleartext data pointed to by
284 the \fIinput\fR argument into the ciphertext pointed to by the \fIoutput\fR
285 argument, using the key schedule provided by the \fIschedule\fR argument,
286 and initialization vector provided by the \fIivec\fR argument.  If the
287 \&\fIlength\fR argument is not an integral multiple of eight bytes, the
288 last block is copied to a temporary area and zero filled.  The output
289 is always an integral multiple of eight bytes.
290 .PP
291 \&\fIDES_xcbc_encrypt()\fR is \s-1RSA\s0's \s-1DESX\s0 mode of \s-1DES.\s0  It uses \fIinw\fR and
292 \&\fIoutw\fR to 'whiten' the encryption.  \fIinw\fR and \fIoutw\fR are secret
293 (unlike the iv) and are as such, part of the key.  So the key is sort
294 of 24 bytes.  This is much better than \s-1CBC DES.\s0
295 .PP
296 \&\fIDES_ede3_cbc_encrypt()\fR implements outer triple \s-1CBC DES\s0 encryption with
297 three keys. This means that each \s-1DES\s0 operation inside the \s-1CBC\s0 mode is
298 \&\f(CW\*(C`C=E(ks3,D(ks2,E(ks1,M)))\*(C'\fR.  This mode is used by \s-1SSL.\s0
299 .PP
300 The \fIDES_ede2_cbc_encrypt()\fR macro implements two-key Triple-DES by
301 reusing \fIks1\fR for the final encryption.  \f(CW\*(C`C=E(ks1,D(ks2,E(ks1,M)))\*(C'\fR.
302 This form of Triple-DES is used by the \s-1RSAREF\s0 library.
303 .PP
304 \&\fIDES_pcbc_encrypt()\fR encrypts/decrypts using the propagating cipher block
305 chaining mode used by Kerberos v4. Its parameters are the same as
306 \&\fIDES_ncbc_encrypt()\fR.
307 .PP
308 \&\fIDES_cfb_encrypt()\fR encrypts/decrypts using cipher feedback mode.  This
309 method takes an array of characters as input and outputs an array of
310 characters.  It does not require any padding to 8 character groups.
311 Note: the \fIivec\fR variable is changed and the new changed value needs to
312 be passed to the next call to this function.  Since this function runs
313 a complete \s-1DES ECB\s0 encryption per \fInumbits\fR, this function is only
314 suggested for use when sending a small number of characters.
315 .PP
316 \&\fIDES_cfb64_encrypt()\fR
317 implements \s-1CFB\s0 mode of \s-1DES\s0 with 64\-bit feedback.  Why is this
318 useful you ask?  Because this routine will allow you to encrypt an
319 arbitrary number of bytes, without 8 byte padding.  Each call to this
320 routine will encrypt the input bytes to output and then update ivec
321 and num.  num contains 'how far' we are though ivec.  If this does
322 not make much sense, read more about \s-1CFB\s0 mode of \s-1DES.\s0
323 .PP
324 \&\fIDES_ede3_cfb64_encrypt()\fR and \fIDES_ede2_cfb64_encrypt()\fR is the same as
325 \&\fIDES_cfb64_encrypt()\fR except that Triple-DES is used.
326 .PP
327 \&\fIDES_ofb_encrypt()\fR encrypts using output feedback mode.  This method
328 takes an array of characters as input and outputs an array of
329 characters.  It does not require any padding to 8 character groups.
330 Note: the \fIivec\fR variable is changed and the new changed value needs to
331 be passed to the next call to this function.  Since this function runs
332 a complete \s-1DES ECB\s0 encryption per \fInumbits\fR, this function is only
333 suggested for use when sending a small number of characters.
334 .PP
335 \&\fIDES_ofb64_encrypt()\fR is the same as \fIDES_cfb64_encrypt()\fR using Output
336 Feed Back mode.
337 .PP
338 \&\fIDES_ede3_ofb64_encrypt()\fR and \fIDES_ede2_ofb64_encrypt()\fR is the same as
339 \&\fIDES_ofb64_encrypt()\fR, using Triple-DES.
340 .PP
341 The following functions are included in the \s-1DES\s0 library for
342 compatibility with the \s-1MIT\s0 Kerberos library.
343 .PP
344 \&\fIDES_cbc_cksum()\fR produces an 8 byte checksum based on the input stream
345 (via \s-1CBC\s0 encryption).  The last 4 bytes of the checksum are returned
346 and the complete 8 bytes are placed in \fIoutput\fR. This function is
347 used by Kerberos v4.  Other applications should use
348 \&\fIEVP_DigestInit\fR\|(3) etc. instead.
349 .PP
350 \&\fIDES_quad_cksum()\fR is a Kerberos v4 function.  It returns a 4 byte
351 checksum from the input bytes.  The algorithm can be iterated over the
352 input, depending on \fIout_count\fR, 1, 2, 3 or 4 times.  If \fIoutput\fR is
353 non-NULL, the 8 bytes generated by each pass are written into
354 \&\fIoutput\fR.
355 .PP
356 The following are DES-based transformations:
357 .PP
358 \&\fIDES_fcrypt()\fR is a fast version of the Unix \fIcrypt\fR\|(3) function.  This
359 version takes only a small amount of space relative to other fast
360 \&\fIcrypt()\fR implementations.  This is different to the normal \fIcrypt()\fR in
361 that the third parameter is the buffer that the return value is
362 written into.  It needs to be at least 14 bytes long.  This function
363 is thread safe, unlike the normal \fIcrypt()\fR.
364 .PP
365 \&\fIDES_crypt()\fR is a faster replacement for the normal system \fIcrypt()\fR.
366 This function calls \fIDES_fcrypt()\fR with a static array passed as the
367 third parameter.  This mostly emulates the normal non-thread-safe semantics
368 of \fIcrypt\fR\|(3).
369 The \fBsalt\fR must be two \s-1ASCII\s0 characters.
370 .PP
371 The values returned by \fIDES_fcrypt()\fR and \fIDES_crypt()\fR are terminated by \s-1NUL\s0
372 character.
373 .PP
374 \&\fIDES_enc_write()\fR writes \fIlen\fR bytes to file descriptor \fIfd\fR from
375 buffer \fIbuf\fR. The data is encrypted via \fIpcbc_encrypt\fR (default)
376 using \fIsched\fR for the key and \fIiv\fR as a starting vector.  The actual
377 data send down \fIfd\fR consists of 4 bytes (in network byte order)
378 containing the length of the following encrypted data.  The encrypted
379 data then follows, padded with random data out to a multiple of 8
380 bytes.
381 .SH "BUGS"
382 .IX Header "BUGS"
383 \&\fIDES_cbc_encrypt()\fR does not modify \fBivec\fR; use \fIDES_ncbc_encrypt()\fR
384 instead.
385 .PP
386 \&\fIDES_cfb_encrypt()\fR and \fIDES_ofb_encrypt()\fR operates on input of 8 bits.
387 What this means is that if you set numbits to 12, and length to 2, the
388 first 12 bits will come from the 1st input byte and the low half of
389 the second input byte.  The second 12 bits will have the low 8 bits
390 taken from the 3rd input byte and the top 4 bits taken from the 4th
391 input byte.  The same holds for output.  This function has been
392 implemented this way because most people will be using a multiple of 8
393 and because once you get into pulling bytes input bytes apart things
394 get ugly!
395 .PP
396 \&\fIDES_string_to_key()\fR is available for backward compatibility with the
397 \&\s-1MIT\s0 library.  New applications should use a cryptographic hash function.
398 The same applies for \fIDES_string_to_2key()\fR.
399 .SH "NOTES"
400 .IX Header "NOTES"
401 The \fBdes\fR library was written to be source code compatible with
402 the \s-1MIT\s0 Kerberos library.
403 .PP
404 Applications should use the higher level functions
405 \&\fIEVP_EncryptInit\fR\|(3) etc. instead of calling these
406 functions directly.
407 .PP
408 Single-key \s-1DES\s0 is insecure due to its short key size.  \s-1ECB\s0 mode is
409 not suitable for most applications; see \fIdes_modes\fR\|(7).
410 .SH "RETURN VALUES"
411 .IX Header "RETURN VALUES"
412 \&\fIDES_set_key()\fR, \fIDES_key_sched()\fR, \fIDES_set_key_checked()\fR and \fIDES_is_weak_key()\fR
413 return 0 on success or negative values on error.
414 .PP
415 \&\fIDES_cbc_cksum()\fR and \fIDES_quad_cksum()\fR return 4\-byte integer representing the
416 last 4 bytes of the checksum of the input.
417 .PP
418 \&\fIDES_fcrypt()\fR returns a pointer to the caller-provided buffer and \fIDES_crypt()\fR \-
419 to a static buffer on success; otherwise they return \s-1NULL.\s0
420 .SH "HISTORY"
421 .IX Header "HISTORY"
422 The requirement that the \fBsalt\fR parameter to \fIDES_crypt()\fR and \fIDES_fcrypt()\fR
423 be two \s-1ASCII\s0 characters was first enforced in
424 OpenSSL 1.1.0.  Previous versions tried to use the letter uppercase \fBA\fR
425 if both character were not present, and could crash when given non-ASCII
426 on some platforms.
427 .SH "SEE ALSO"
428 .IX Header "SEE ALSO"
429 \&\fIdes_modes\fR\|(7),
430 \&\fIEVP_EncryptInit\fR\|(3)
431 .SH "COPYRIGHT"
432 .IX Header "COPYRIGHT"
433 Copyright 2000\-2018 The OpenSSL Project Authors. All Rights Reserved.
434 .PP
435 Licensed under the OpenSSL license (the \*(L"License\*(R").  You may not use
436 this file except in compliance with the License.  You can obtain a copy
437 in the file \s-1LICENSE\s0 in the source distribution or at
438 <https://www.openssl.org/source/license.html>.