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