c3d3f275f8102a0e76fac9f96978812498a64f56
[openssl.git] / doc / man7 / EVP_KDF_PBKDF2.pod
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 Numeric identity
17
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.
20
21 =head2 Supported controls
22
23 The supported controls are:
24
25 =over 4
26
27 =item B<EVP_KDF_CTRL_SET_PASS>
28
29 =item B<EVP_KDF_CTRL_SET_SALT>
30
31 =item B<EVP_KDF_CTRL_SET_ITER>
32
33 This control has a default value of 2048.
34
35 =item B<EVP_KDF_CTRL_SET_MD>
36
37 These controls work as described in L<EVP_KDF_CTX(3)/CONTROLS>.
38
39 =item B<EVP_KDF_CTRL_SET_PBKDF2_PKCS5_MODE>
40
41 This control expects one argument: C<int mode>
42
43 This control can be used to enable or disable SP800-132 compliance checks.
44
45 Setting the mode to 0 enables the compliance checks.
46
47 The checks performed are:
48
49 =over 4
50
51 =item - the iteration count is at least 1000.
52
53 =item - the salt length is at least 128 bits.
54
55 =item - the derived key length is at least 112 bits.
56
57 =back
58
59 The default provider uses a default mode of 1 for backwards compatibility,
60 and the fips provider uses a default mode of 0.
61
62 EVP_KDF_ctrl_str() type string: "pkcs5"
63
64 The value string is expected to be a decimal number 0 or 1.
65
66 =back
67
68 =head1 NOTES
69
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.
73
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.
77
78 No assumption is made regarding the given password; it is simply treated as a
79 byte sequence.
80
81 =head1 CONFORMING TO
82
83 SP800-132
84
85 =head1 SEE ALSO
86
87 L<EVP_KDF_CTX>,
88 L<EVP_KDF_CTX_new_id(3)>,
89 L<EVP_KDF_CTX_free(3)>,
90 L<EVP_KDF_ctrl(3)>,
91 L<EVP_KDF_derive(3)>,
92 L<EVP_KDF_CTX(3)/CONTROLS>
93
94 =head1 HISTORY
95
96 This functionality was added to OpenSSL 3.0.0.
97
98 =head1 COPYRIGHT
99
100 Copyright 2018-2019 The OpenSSL Project Authors. All Rights Reserved.
101
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>.
106
107 =cut