5 EVP_KDF_PBKDF2 - The PBKDF2 EVP_KDF implementation
9 Support for computing the B<PBKDF2> password-based KDF through the B<EVP_KDF>
12 The EVP_KDF_PBKDF2 algorithm implements the PBKDF2 password-based key
13 derivation function, as described in SP800-132; it derives a key from a password
14 using a salt and iteration count.
16 =head2 Numeric identity
18 B<EVP_KDF_PBKDF2> is the numeric identity for this implementation; it
19 can be used with the EVP_KDF_CTX_new_id() function.
21 =head2 Supported controls
23 The supported controls are:
27 =item B<EVP_KDF_CTRL_SET_PASS>
29 =item B<EVP_KDF_CTRL_SET_SALT>
31 =item B<EVP_KDF_CTRL_SET_ITER>
33 This control has a default value of 2048.
35 =item B<EVP_KDF_CTRL_SET_MD>
37 These controls work as described in L<EVP_KDF_CTX(3)/CONTROLS>.
39 =item B<EVP_KDF_CTRL_SET_PBKDF2_PKCS5_MODE>
41 This control expects one argument: C<int mode>
43 This control can be used to enable or disable SP800-132 compliance checks.
45 Setting the mode to 0 enables the compliance checks.
47 The checks performed are:
51 =item - the iteration count is at least 1000.
53 =item - the salt length is at least 128 bits.
55 =item - the derived key length is at least 112 bits.
59 The default provider uses a default mode of 1 for backwards compatibility,
60 and the fips provider uses a default mode of 0.
62 EVP_KDF_ctrl_str() type string: "pkcs5"
64 The value string is expected to be a decimal number 0 or 1.
70 A typical application of this algorithm is to derive keying material for an
71 encryption algorithm from a password in the B<pass>, a salt in B<salt>,
72 and an iteration count.
74 Increasing the B<iter> parameter slows down the algorithm which makes it
75 harder for an attacker to perform a brute force attack using a large number
76 of candidate passwords.
78 No assumption is made regarding the given password; it is simply treated as a
88 L<EVP_KDF_CTX_new_id(3)>,
89 L<EVP_KDF_CTX_free(3)>,
92 L<EVP_KDF_CTX(3)/CONTROLS>
96 This functionality was added to OpenSSL 3.0.0.
100 Copyright 2018-2019 The OpenSSL Project Authors. All Rights Reserved.
102 Licensed under the Apache License 2.0 (the "License"). You may not use
103 this file except in compliance with the License. You can obtain a copy
104 in the file LICENSE in the source distribution or at
105 L<https://www.openssl.org/source/license.html>.