1 | =pod
|
---|
2 |
|
---|
3 | =head1 NAME
|
---|
4 |
|
---|
5 | EVP_KDF-PBKDF2 - The PBKDF2 EVP_KDF implementation
|
---|
6 |
|
---|
7 | =head1 DESCRIPTION
|
---|
8 |
|
---|
9 | Support for computing the B<PBKDF2> password-based KDF through the B<EVP_KDF>
|
---|
10 | API.
|
---|
11 |
|
---|
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.
|
---|
15 |
|
---|
16 | The output is considered to be a cryptographic key.
|
---|
17 |
|
---|
18 | =head2 Identity
|
---|
19 |
|
---|
20 | "PBKDF2" is the name for this implementation; it
|
---|
21 | can be used with the EVP_KDF_fetch() function.
|
---|
22 |
|
---|
23 | =head2 Supported parameters
|
---|
24 |
|
---|
25 | The supported parameters are:
|
---|
26 |
|
---|
27 | =over 4
|
---|
28 |
|
---|
29 | =item "pass" (B<OSSL_KDF_PARAM_PASSWORD>) <octet string>
|
---|
30 |
|
---|
31 | =item "salt" (B<OSSL_KDF_PARAM_SALT>) <octet string>
|
---|
32 |
|
---|
33 | =item "iter" (B<OSSL_KDF_PARAM_ITER>) <unsigned integer>
|
---|
34 |
|
---|
35 | This parameter has a default value of 2048.
|
---|
36 |
|
---|
37 | =item "properties" (B<OSSL_KDF_PARAM_PROPERTIES>) <UTF8 string>
|
---|
38 |
|
---|
39 | =item "digest" (B<OSSL_KDF_PARAM_DIGEST>) <UTF8 string>
|
---|
40 |
|
---|
41 | These parameters work as described in L<EVP_KDF(3)/PARAMETERS>.
|
---|
42 |
|
---|
43 | =item "pkcs5" (B<OSSL_KDF_PARAM_PKCS5>) <integer>
|
---|
44 |
|
---|
45 | This parameter can be used to enable or disable SP800-132 compliance checks.
|
---|
46 | Setting the mode to 0 enables the compliance checks.
|
---|
47 |
|
---|
48 | The checks performed are:
|
---|
49 |
|
---|
50 | =over 4
|
---|
51 |
|
---|
52 | =item - the iteration count is at least 1000.
|
---|
53 |
|
---|
54 | =item - the salt length is at least 128 bits.
|
---|
55 |
|
---|
56 | =item - the derived key length is at least 112 bits.
|
---|
57 |
|
---|
58 | =back
|
---|
59 |
|
---|
60 | The default provider uses a default mode of 1 for backwards compatibility,
|
---|
61 | and the FIPS provider uses a default mode of 0.
|
---|
62 | This option breaks FIPS compliance if it causes the approved "fips-indicator"
|
---|
63 | to return 0.
|
---|
64 |
|
---|
65 | =item "fips-indicator" (B<OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR>) <integer>
|
---|
66 |
|
---|
67 | This option is used by the OpenSSL FIPS provider.
|
---|
68 |
|
---|
69 | A getter that returns 1 if the operation is FIPS approved, or 0 otherwise.
|
---|
70 | This may be used after calling EVP_KDF_derive. It returns 0 if "pkcs5"
|
---|
71 | is set to 1 and the derived key length, salt length or iteration count test
|
---|
72 | fails.
|
---|
73 |
|
---|
74 | =back
|
---|
75 |
|
---|
76 | =head1 NOTES
|
---|
77 |
|
---|
78 | A typical application of this algorithm is to derive keying material for an
|
---|
79 | encryption algorithm from a password in the "pass", a salt in "salt",
|
---|
80 | and an iteration count.
|
---|
81 |
|
---|
82 | Increasing the "iter" parameter slows down the algorithm which makes it
|
---|
83 | harder for an attacker to perform a brute force attack using a large number
|
---|
84 | of candidate passwords.
|
---|
85 |
|
---|
86 | No assumption is made regarding the given password; it is simply treated as a
|
---|
87 | byte sequence.
|
---|
88 |
|
---|
89 | =head1 CONFORMING TO
|
---|
90 |
|
---|
91 | SP800-132
|
---|
92 |
|
---|
93 | =head1 SEE ALSO
|
---|
94 |
|
---|
95 | L<EVP_KDF(3)>,
|
---|
96 | L<EVP_KDF_CTX_new(3)>,
|
---|
97 | L<EVP_KDF_CTX_free(3)>,
|
---|
98 | L<EVP_KDF_CTX_set_params(3)>,
|
---|
99 | L<EVP_KDF_derive(3)>,
|
---|
100 | L<EVP_KDF(3)/PARAMETERS>
|
---|
101 |
|
---|
102 | =head1 HISTORY
|
---|
103 |
|
---|
104 | This functionality was added in OpenSSL 3.0.
|
---|
105 |
|
---|
106 | =head1 COPYRIGHT
|
---|
107 |
|
---|
108 | Copyright 2018-2024 The OpenSSL Project Authors. All Rights Reserved.
|
---|
109 |
|
---|
110 | Licensed under the Apache License 2.0 (the "License"). You may not use
|
---|
111 | this file except in compliance with the License. You can obtain a copy
|
---|
112 | in the file LICENSE in the source distribution or at
|
---|
113 | L<https://www.openssl.org/source/license.html>.
|
---|
114 |
|
---|
115 | =cut
|
---|