xref: /freebsd/crypto/openssl/doc/man3/DES_random_key.pod (revision c9cf7b5cb1693e44f8caa63f47bbb9ae85508687)
1e71b7053SJung-uk Kim=pod
2e71b7053SJung-uk Kim
3e71b7053SJung-uk Kim=head1 NAME
4e71b7053SJung-uk Kim
5e71b7053SJung-uk KimDES_random_key, DES_set_key, DES_key_sched, DES_set_key_checked,
6e71b7053SJung-uk KimDES_set_key_unchecked, DES_set_odd_parity, DES_is_weak_key,
7e71b7053SJung-uk KimDES_ecb_encrypt, DES_ecb2_encrypt, DES_ecb3_encrypt, DES_ncbc_encrypt,
8e71b7053SJung-uk KimDES_cfb_encrypt, DES_ofb_encrypt, DES_pcbc_encrypt, DES_cfb64_encrypt,
9e71b7053SJung-uk KimDES_ofb64_encrypt, DES_xcbc_encrypt, DES_ede2_cbc_encrypt,
10e71b7053SJung-uk KimDES_ede2_cfb64_encrypt, DES_ede2_ofb64_encrypt, DES_ede3_cbc_encrypt,
11e71b7053SJung-uk KimDES_ede3_cfb64_encrypt, DES_ede3_ofb64_encrypt,
12e71b7053SJung-uk KimDES_cbc_cksum, DES_quad_cksum, DES_string_to_key, DES_string_to_2keys,
13e71b7053SJung-uk KimDES_fcrypt, DES_crypt - DES encryption
14e71b7053SJung-uk Kim
15e71b7053SJung-uk Kim=head1 SYNOPSIS
16e71b7053SJung-uk Kim
17e71b7053SJung-uk Kim #include <openssl/des.h>
18e71b7053SJung-uk Kim
19e71b7053SJung-uk Kim void DES_random_key(DES_cblock *ret);
20e71b7053SJung-uk Kim
21e71b7053SJung-uk Kim int DES_set_key(const_DES_cblock *key, DES_key_schedule *schedule);
22e71b7053SJung-uk Kim int DES_key_sched(const_DES_cblock *key, DES_key_schedule *schedule);
23e71b7053SJung-uk Kim int DES_set_key_checked(const_DES_cblock *key, DES_key_schedule *schedule);
24e71b7053SJung-uk Kim void DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule);
25e71b7053SJung-uk Kim
26e71b7053SJung-uk Kim void DES_set_odd_parity(DES_cblock *key);
27e71b7053SJung-uk Kim int DES_is_weak_key(const_DES_cblock *key);
28e71b7053SJung-uk Kim
29e71b7053SJung-uk Kim void DES_ecb_encrypt(const_DES_cblock *input, DES_cblock *output,
30e71b7053SJung-uk Kim                      DES_key_schedule *ks, int enc);
31e71b7053SJung-uk Kim void DES_ecb2_encrypt(const_DES_cblock *input, DES_cblock *output,
32e71b7053SJung-uk Kim                       DES_key_schedule *ks1, DES_key_schedule *ks2, int enc);
33e71b7053SJung-uk Kim void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output,
34e71b7053SJung-uk Kim                       DES_key_schedule *ks1, DES_key_schedule *ks2,
35e71b7053SJung-uk Kim                       DES_key_schedule *ks3, int enc);
36e71b7053SJung-uk Kim
37e71b7053SJung-uk Kim void DES_ncbc_encrypt(const unsigned char *input, unsigned char *output,
38e71b7053SJung-uk Kim                       long length, DES_key_schedule *schedule, DES_cblock *ivec,
39e71b7053SJung-uk Kim                       int enc);
40e71b7053SJung-uk Kim void DES_cfb_encrypt(const unsigned char *in, unsigned char *out,
41e71b7053SJung-uk Kim                      int numbits, long length, DES_key_schedule *schedule,
42e71b7053SJung-uk Kim                      DES_cblock *ivec, int enc);
43e71b7053SJung-uk Kim void DES_ofb_encrypt(const unsigned char *in, unsigned char *out,
44e71b7053SJung-uk Kim                      int numbits, long length, DES_key_schedule *schedule,
45e71b7053SJung-uk Kim                      DES_cblock *ivec);
46e71b7053SJung-uk Kim void DES_pcbc_encrypt(const unsigned char *input, unsigned char *output,
47e71b7053SJung-uk Kim                       long length, DES_key_schedule *schedule, DES_cblock *ivec,
48e71b7053SJung-uk Kim                       int enc);
49e71b7053SJung-uk Kim void DES_cfb64_encrypt(const unsigned char *in, unsigned char *out,
50e71b7053SJung-uk Kim                        long length, DES_key_schedule *schedule, DES_cblock *ivec,
51e71b7053SJung-uk Kim                        int *num, int enc);
52e71b7053SJung-uk Kim void DES_ofb64_encrypt(const unsigned char *in, unsigned char *out,
53e71b7053SJung-uk Kim                        long length, DES_key_schedule *schedule, DES_cblock *ivec,
54e71b7053SJung-uk Kim                        int *num);
55e71b7053SJung-uk Kim
56e71b7053SJung-uk Kim void DES_xcbc_encrypt(const unsigned char *input, unsigned char *output,
57e71b7053SJung-uk Kim                       long length, DES_key_schedule *schedule, DES_cblock *ivec,
58e71b7053SJung-uk Kim                       const_DES_cblock *inw, const_DES_cblock *outw, int enc);
59e71b7053SJung-uk Kim
60e71b7053SJung-uk Kim void DES_ede2_cbc_encrypt(const unsigned char *input, unsigned char *output,
61e71b7053SJung-uk Kim                           long length, DES_key_schedule *ks1,
62e71b7053SJung-uk Kim                           DES_key_schedule *ks2, DES_cblock *ivec, int enc);
63e71b7053SJung-uk Kim void DES_ede2_cfb64_encrypt(const unsigned char *in, unsigned char *out,
64e71b7053SJung-uk Kim                             long length, DES_key_schedule *ks1,
65e71b7053SJung-uk Kim                             DES_key_schedule *ks2, DES_cblock *ivec,
66e71b7053SJung-uk Kim                             int *num, int enc);
67e71b7053SJung-uk Kim void DES_ede2_ofb64_encrypt(const unsigned char *in, unsigned char *out,
68e71b7053SJung-uk Kim                             long length, DES_key_schedule *ks1,
69e71b7053SJung-uk Kim                             DES_key_schedule *ks2, DES_cblock *ivec, int *num);
70e71b7053SJung-uk Kim
71e71b7053SJung-uk Kim void DES_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output,
72e71b7053SJung-uk Kim                           long length, DES_key_schedule *ks1,
73e71b7053SJung-uk Kim                           DES_key_schedule *ks2, DES_key_schedule *ks3,
74e71b7053SJung-uk Kim                           DES_cblock *ivec, int enc);
75e71b7053SJung-uk Kim void DES_ede3_cfb64_encrypt(const unsigned char *in, unsigned char *out,
76e71b7053SJung-uk Kim                             long length, DES_key_schedule *ks1,
77e71b7053SJung-uk Kim                             DES_key_schedule *ks2, DES_key_schedule *ks3,
78e71b7053SJung-uk Kim                             DES_cblock *ivec, int *num, int enc);
79e71b7053SJung-uk Kim void DES_ede3_ofb64_encrypt(const unsigned char *in, unsigned char *out,
80e71b7053SJung-uk Kim                             long length, DES_key_schedule *ks1,
81e71b7053SJung-uk Kim                             DES_key_schedule *ks2, DES_key_schedule *ks3,
82e71b7053SJung-uk Kim                             DES_cblock *ivec, int *num);
83e71b7053SJung-uk Kim
84e71b7053SJung-uk Kim DES_LONG DES_cbc_cksum(const unsigned char *input, DES_cblock *output,
85e71b7053SJung-uk Kim                        long length, DES_key_schedule *schedule,
86e71b7053SJung-uk Kim                        const_DES_cblock *ivec);
87e71b7053SJung-uk Kim DES_LONG DES_quad_cksum(const unsigned char *input, DES_cblock output[],
88e71b7053SJung-uk Kim                         long length, int out_count, DES_cblock *seed);
89e71b7053SJung-uk Kim void DES_string_to_key(const char *str, DES_cblock *key);
90e71b7053SJung-uk Kim void DES_string_to_2keys(const char *str, DES_cblock *key1, DES_cblock *key2);
91e71b7053SJung-uk Kim
92e71b7053SJung-uk Kim char *DES_fcrypt(const char *buf, const char *salt, char *ret);
93e71b7053SJung-uk Kim char *DES_crypt(const char *buf, const char *salt);
94e71b7053SJung-uk Kim
95e71b7053SJung-uk Kim=head1 DESCRIPTION
96e71b7053SJung-uk Kim
97e71b7053SJung-uk KimThis library contains a fast implementation of the DES encryption
98e71b7053SJung-uk Kimalgorithm.
99e71b7053SJung-uk Kim
100e71b7053SJung-uk KimThere are two phases to the use of DES encryption.  The first is the
101e71b7053SJung-uk Kimgeneration of a I<DES_key_schedule> from a key, the second is the
102*c9cf7b5cSJung-uk Kimactual encryption.  A DES key is of type I<DES_cblock>. This type
103e71b7053SJung-uk Kimconsists of 8 bytes with odd parity.  The least significant bit in
104e71b7053SJung-uk Kimeach byte is the parity bit.  The key schedule is an expanded form of
105e71b7053SJung-uk Kimthe key; it is used to speed the encryption process.
106e71b7053SJung-uk Kim
107e71b7053SJung-uk KimDES_random_key() generates a random key.  The PRNG must be seeded
108e71b7053SJung-uk Kimprior to using this function (see L<RAND_bytes(3)>).  If the PRNG
109e71b7053SJung-uk Kimcould not generate a secure key, 0 is returned.
110e71b7053SJung-uk Kim
111e71b7053SJung-uk KimBefore a DES key can be used, it must be converted into the
112e71b7053SJung-uk Kimarchitecture dependent I<DES_key_schedule> via the
113e71b7053SJung-uk KimDES_set_key_checked() or DES_set_key_unchecked() function.
114e71b7053SJung-uk Kim
115e71b7053SJung-uk KimDES_set_key_checked() will check that the key passed is of odd parity
116e71b7053SJung-uk Kimand is not a weak or semi-weak key.  If the parity is wrong, then -1
117e71b7053SJung-uk Kimis returned.  If the key is a weak key, then -2 is returned.  If an
118e71b7053SJung-uk Kimerror is returned, the key schedule is not generated.
119e71b7053SJung-uk Kim
120e71b7053SJung-uk KimDES_set_key() works like
121e71b7053SJung-uk KimDES_set_key_checked() if the I<DES_check_key> flag is non-zero,
122e71b7053SJung-uk Kimotherwise like DES_set_key_unchecked().  These functions are available
123e71b7053SJung-uk Kimfor compatibility; it is recommended to use a function that does not
124e71b7053SJung-uk Kimdepend on a global variable.
125e71b7053SJung-uk Kim
126e71b7053SJung-uk KimDES_set_odd_parity() sets the parity of the passed I<key> to odd.
127e71b7053SJung-uk Kim
128e71b7053SJung-uk KimDES_is_weak_key() returns 1 if the passed key is a weak key, 0 if it
129e71b7053SJung-uk Kimis ok.
130e71b7053SJung-uk Kim
131e71b7053SJung-uk KimThe following routines mostly operate on an input and output stream of
132e71b7053SJung-uk KimI<DES_cblock>s.
133e71b7053SJung-uk Kim
134e71b7053SJung-uk KimDES_ecb_encrypt() is the basic DES encryption routine that encrypts or
135e71b7053SJung-uk Kimdecrypts a single 8-byte I<DES_cblock> in I<electronic code book>
136e71b7053SJung-uk Kim(ECB) mode.  It always transforms the input data, pointed to by
137e71b7053SJung-uk KimI<input>, into the output data, pointed to by the I<output> argument.
138e71b7053SJung-uk KimIf the I<encrypt> argument is non-zero (DES_ENCRYPT), the I<input>
139e71b7053SJung-uk Kim(cleartext) is encrypted in to the I<output> (ciphertext) using the
140e71b7053SJung-uk Kimkey_schedule specified by the I<schedule> argument, previously set via
141e71b7053SJung-uk KimI<DES_set_key>. If I<encrypt> is zero (DES_DECRYPT), the I<input> (now
142e71b7053SJung-uk Kimciphertext) is decrypted into the I<output> (now cleartext).  Input
143e71b7053SJung-uk Kimand output may overlap.  DES_ecb_encrypt() does not return a value.
144e71b7053SJung-uk Kim
145e71b7053SJung-uk KimDES_ecb3_encrypt() encrypts/decrypts the I<input> block by using
146e71b7053SJung-uk Kimthree-key Triple-DES encryption in ECB mode.  This involves encrypting
147e71b7053SJung-uk Kimthe input with I<ks1>, decrypting with the key schedule I<ks2>, and
148e71b7053SJung-uk Kimthen encrypting with I<ks3>.  This routine greatly reduces the chances
149e71b7053SJung-uk Kimof brute force breaking of DES and has the advantage of if I<ks1>,
150e71b7053SJung-uk KimI<ks2> and I<ks3> are the same, it is equivalent to just encryption
151e71b7053SJung-uk Kimusing ECB mode and I<ks1> as the key.
152e71b7053SJung-uk Kim
153e71b7053SJung-uk KimThe macro DES_ecb2_encrypt() is provided to perform two-key Triple-DES
154e71b7053SJung-uk Kimencryption by using I<ks1> for the final encryption.
155e71b7053SJung-uk Kim
156e71b7053SJung-uk KimDES_ncbc_encrypt() encrypts/decrypts using the I<cipher-block-chaining>
157e71b7053SJung-uk Kim(CBC) mode of DES.  If the I<encrypt> argument is non-zero, the
158e71b7053SJung-uk Kimroutine cipher-block-chain encrypts the cleartext data pointed to by
159e71b7053SJung-uk Kimthe I<input> argument into the ciphertext pointed to by the I<output>
160e71b7053SJung-uk Kimargument, using the key schedule provided by the I<schedule> argument,
161e71b7053SJung-uk Kimand initialization vector provided by the I<ivec> argument.  If the
162e71b7053SJung-uk KimI<length> argument is not an integral multiple of eight bytes, the
163e71b7053SJung-uk Kimlast block is copied to a temporary area and zero filled.  The output
164e71b7053SJung-uk Kimis always an integral multiple of eight bytes.
165e71b7053SJung-uk Kim
166e71b7053SJung-uk KimDES_xcbc_encrypt() is RSA's DESX mode of DES.  It uses I<inw> and
167e71b7053SJung-uk KimI<outw> to 'whiten' the encryption.  I<inw> and I<outw> are secret
168e71b7053SJung-uk Kim(unlike the iv) and are as such, part of the key.  So the key is sort
169e71b7053SJung-uk Kimof 24 bytes.  This is much better than CBC DES.
170e71b7053SJung-uk Kim
171e71b7053SJung-uk KimDES_ede3_cbc_encrypt() implements outer triple CBC DES encryption with
172e71b7053SJung-uk Kimthree keys. This means that each DES operation inside the CBC mode is
173*c9cf7b5cSJung-uk KimC<C=E(ks3,D(ks2,E(ks1,M)))>.  This mode is used by SSL.
174e71b7053SJung-uk Kim
175e71b7053SJung-uk KimThe DES_ede2_cbc_encrypt() macro implements two-key Triple-DES by
176e71b7053SJung-uk Kimreusing I<ks1> for the final encryption.  C<C=E(ks1,D(ks2,E(ks1,M)))>.
177e71b7053SJung-uk KimThis form of Triple-DES is used by the RSAREF library.
178e71b7053SJung-uk Kim
179*c9cf7b5cSJung-uk KimDES_pcbc_encrypt() encrypts/decrypts using the propagating cipher block
180e71b7053SJung-uk Kimchaining mode used by Kerberos v4. Its parameters are the same as
181e71b7053SJung-uk KimDES_ncbc_encrypt().
182e71b7053SJung-uk Kim
183*c9cf7b5cSJung-uk KimDES_cfb_encrypt() encrypts/decrypts using cipher feedback mode.  This
184*c9cf7b5cSJung-uk Kimmethod takes an array of characters as input and outputs an array of
185e71b7053SJung-uk Kimcharacters.  It does not require any padding to 8 character groups.
186e71b7053SJung-uk KimNote: the I<ivec> variable is changed and the new changed value needs to
187e71b7053SJung-uk Kimbe passed to the next call to this function.  Since this function runs
188e71b7053SJung-uk Kima complete DES ECB encryption per I<numbits>, this function is only
189*c9cf7b5cSJung-uk Kimsuggested for use when sending a small number of characters.
190e71b7053SJung-uk Kim
191e71b7053SJung-uk KimDES_cfb64_encrypt()
192*c9cf7b5cSJung-uk Kimimplements CFB mode of DES with 64-bit feedback.  Why is this
193e71b7053SJung-uk Kimuseful you ask?  Because this routine will allow you to encrypt an
194*c9cf7b5cSJung-uk Kimarbitrary number of bytes, without 8 byte padding.  Each call to this
195e71b7053SJung-uk Kimroutine will encrypt the input bytes to output and then update ivec
196e71b7053SJung-uk Kimand num.  num contains 'how far' we are though ivec.  If this does
197*c9cf7b5cSJung-uk Kimnot make much sense, read more about CFB mode of DES.
198e71b7053SJung-uk Kim
199e71b7053SJung-uk KimDES_ede3_cfb64_encrypt() and DES_ede2_cfb64_encrypt() is the same as
200e71b7053SJung-uk KimDES_cfb64_encrypt() except that Triple-DES is used.
201e71b7053SJung-uk Kim
202e71b7053SJung-uk KimDES_ofb_encrypt() encrypts using output feedback mode.  This method
203*c9cf7b5cSJung-uk Kimtakes an array of characters as input and outputs an array of
204e71b7053SJung-uk Kimcharacters.  It does not require any padding to 8 character groups.
205e71b7053SJung-uk KimNote: the I<ivec> variable is changed and the new changed value needs to
206e71b7053SJung-uk Kimbe passed to the next call to this function.  Since this function runs
207*c9cf7b5cSJung-uk Kima complete DES ECB encryption per I<numbits>, this function is only
208*c9cf7b5cSJung-uk Kimsuggested for use when sending a small number of characters.
209e71b7053SJung-uk Kim
210e71b7053SJung-uk KimDES_ofb64_encrypt() is the same as DES_cfb64_encrypt() using Output
211e71b7053SJung-uk KimFeed Back mode.
212e71b7053SJung-uk Kim
213e71b7053SJung-uk KimDES_ede3_ofb64_encrypt() and DES_ede2_ofb64_encrypt() is the same as
214e71b7053SJung-uk KimDES_ofb64_encrypt(), using Triple-DES.
215e71b7053SJung-uk Kim
216e71b7053SJung-uk KimThe following functions are included in the DES library for
217e71b7053SJung-uk Kimcompatibility with the MIT Kerberos library.
218e71b7053SJung-uk Kim
219e71b7053SJung-uk KimDES_cbc_cksum() produces an 8 byte checksum based on the input stream
220e71b7053SJung-uk Kim(via CBC encryption).  The last 4 bytes of the checksum are returned
221e71b7053SJung-uk Kimand the complete 8 bytes are placed in I<output>. This function is
222e71b7053SJung-uk Kimused by Kerberos v4.  Other applications should use
223e71b7053SJung-uk KimL<EVP_DigestInit(3)> etc. instead.
224e71b7053SJung-uk Kim
225e71b7053SJung-uk KimDES_quad_cksum() is a Kerberos v4 function.  It returns a 4 byte
226e71b7053SJung-uk Kimchecksum from the input bytes.  The algorithm can be iterated over the
227e71b7053SJung-uk Kiminput, depending on I<out_count>, 1, 2, 3 or 4 times.  If I<output> is
228e71b7053SJung-uk Kimnon-NULL, the 8 bytes generated by each pass are written into
229e71b7053SJung-uk KimI<output>.
230e71b7053SJung-uk Kim
231e71b7053SJung-uk KimThe following are DES-based transformations:
232e71b7053SJung-uk Kim
233e71b7053SJung-uk KimDES_fcrypt() is a fast version of the Unix crypt(3) function.  This
234e71b7053SJung-uk Kimversion takes only a small amount of space relative to other fast
235*c9cf7b5cSJung-uk Kimcrypt() implementations.  This is different to the normal crypt() in
236e71b7053SJung-uk Kimthat the third parameter is the buffer that the return value is
237e71b7053SJung-uk Kimwritten into.  It needs to be at least 14 bytes long.  This function
238*c9cf7b5cSJung-uk Kimis thread safe, unlike the normal crypt().
239e71b7053SJung-uk Kim
240e71b7053SJung-uk KimDES_crypt() is a faster replacement for the normal system crypt().
241e71b7053SJung-uk KimThis function calls DES_fcrypt() with a static array passed as the
242e71b7053SJung-uk Kimthird parameter.  This mostly emulates the normal non-thread-safe semantics
243e71b7053SJung-uk Kimof crypt(3).
244e71b7053SJung-uk KimThe B<salt> must be two ASCII characters.
245e71b7053SJung-uk Kim
246e71b7053SJung-uk KimThe values returned by DES_fcrypt() and DES_crypt() are terminated by NUL
247e71b7053SJung-uk Kimcharacter.
248e71b7053SJung-uk Kim
249e71b7053SJung-uk KimDES_enc_write() writes I<len> bytes to file descriptor I<fd> from
250e71b7053SJung-uk Kimbuffer I<buf>. The data is encrypted via I<pcbc_encrypt> (default)
251e71b7053SJung-uk Kimusing I<sched> for the key and I<iv> as a starting vector.  The actual
252e71b7053SJung-uk Kimdata send down I<fd> consists of 4 bytes (in network byte order)
253e71b7053SJung-uk Kimcontaining the length of the following encrypted data.  The encrypted
254e71b7053SJung-uk Kimdata then follows, padded with random data out to a multiple of 8
255e71b7053SJung-uk Kimbytes.
256e71b7053SJung-uk Kim
257e71b7053SJung-uk Kim=head1 BUGS
258e71b7053SJung-uk Kim
259e71b7053SJung-uk KimDES_cbc_encrypt() does not modify B<ivec>; use DES_ncbc_encrypt()
260e71b7053SJung-uk Kiminstead.
261e71b7053SJung-uk Kim
262e71b7053SJung-uk KimDES_cfb_encrypt() and DES_ofb_encrypt() operates on input of 8 bits.
263e71b7053SJung-uk KimWhat this means is that if you set numbits to 12, and length to 2, the
264e71b7053SJung-uk Kimfirst 12 bits will come from the 1st input byte and the low half of
265e71b7053SJung-uk Kimthe second input byte.  The second 12 bits will have the low 8 bits
266e71b7053SJung-uk Kimtaken from the 3rd input byte and the top 4 bits taken from the 4th
267e71b7053SJung-uk Kiminput byte.  The same holds for output.  This function has been
268e71b7053SJung-uk Kimimplemented this way because most people will be using a multiple of 8
269e71b7053SJung-uk Kimand because once you get into pulling bytes input bytes apart things
270e71b7053SJung-uk Kimget ugly!
271e71b7053SJung-uk Kim
272e71b7053SJung-uk KimDES_string_to_key() is available for backward compatibility with the
273e71b7053SJung-uk KimMIT library.  New applications should use a cryptographic hash function.
274e71b7053SJung-uk KimThe same applies for DES_string_to_2key().
275e71b7053SJung-uk Kim
276e71b7053SJung-uk Kim=head1 NOTES
277e71b7053SJung-uk Kim
278e71b7053SJung-uk KimThe B<des> library was written to be source code compatible with
279e71b7053SJung-uk Kimthe MIT Kerberos library.
280e71b7053SJung-uk Kim
281e71b7053SJung-uk KimApplications should use the higher level functions
282e71b7053SJung-uk KimL<EVP_EncryptInit(3)> etc. instead of calling these
283e71b7053SJung-uk Kimfunctions directly.
284e71b7053SJung-uk Kim
285e71b7053SJung-uk KimSingle-key DES is insecure due to its short key size.  ECB mode is
286e71b7053SJung-uk Kimnot suitable for most applications; see L<des_modes(7)>.
287e71b7053SJung-uk Kim
288e71b7053SJung-uk Kim=head1 RETURN VALUES
289e71b7053SJung-uk Kim
290e71b7053SJung-uk KimDES_set_key(), DES_key_sched(), DES_set_key_checked() and DES_is_weak_key()
291e71b7053SJung-uk Kimreturn 0 on success or negative values on error.
292e71b7053SJung-uk Kim
293e71b7053SJung-uk KimDES_cbc_cksum() and DES_quad_cksum() return 4-byte integer representing the
294e71b7053SJung-uk Kimlast 4 bytes of the checksum of the input.
295e71b7053SJung-uk Kim
296e71b7053SJung-uk KimDES_fcrypt() returns a pointer to the caller-provided buffer and DES_crypt() -
297e71b7053SJung-uk Kimto a static buffer on success; otherwise they return NULL.
298e71b7053SJung-uk Kim
299e71b7053SJung-uk Kim=head1 HISTORY
300e71b7053SJung-uk Kim
301e71b7053SJung-uk KimThe requirement that the B<salt> parameter to DES_crypt() and DES_fcrypt()
302e71b7053SJung-uk Kimbe two ASCII characters was first enforced in
303e71b7053SJung-uk KimOpenSSL 1.1.0.  Previous versions tried to use the letter uppercase B<A>
304e71b7053SJung-uk Kimif both character were not present, and could crash when given non-ASCII
305e71b7053SJung-uk Kimon some platforms.
306e71b7053SJung-uk Kim
307e71b7053SJung-uk Kim=head1 SEE ALSO
308e71b7053SJung-uk Kim
309e71b7053SJung-uk KimL<des_modes(7)>,
310e71b7053SJung-uk KimL<EVP_EncryptInit(3)>
311e71b7053SJung-uk Kim
312e71b7053SJung-uk Kim=head1 COPYRIGHT
313e71b7053SJung-uk Kim
314e71b7053SJung-uk KimCopyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
315e71b7053SJung-uk Kim
316e71b7053SJung-uk KimLicensed under the OpenSSL license (the "License").  You may not use
317e71b7053SJung-uk Kimthis file except in compliance with the License.  You can obtain a copy
318e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at
319e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>.
320e71b7053SJung-uk Kim
321e71b7053SJung-uk Kim=cut
322