EVP_KDF-PBKDF2.pod 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. =pod
  2. =head1 NAME
  3. EVP_KDF-PBKDF2 - The PBKDF2 EVP_KDF implementation
  4. =head1 DESCRIPTION
  5. Support for computing the B<PBKDF2> password-based KDF through the B<EVP_KDF>
  6. API.
  7. The EVP_KDF-PBKDF2 algorithm implements the PBKDF2 password-based key
  8. derivation function, as described in SP800-132; it derives a key from a password
  9. using a salt and iteration count.
  10. The output is considered to be a cryptographic key.
  11. =head2 Identity
  12. "PBKDF2" is the name for this implementation; it
  13. can be used with the EVP_KDF_fetch() function.
  14. =head2 Supported parameters
  15. The supported parameters are:
  16. =over 4
  17. =item "pass" (B<OSSL_KDF_PARAM_PASSWORD>) <octet string>
  18. =item "salt" (B<OSSL_KDF_PARAM_SALT>) <octet string>
  19. =item "iter" (B<OSSL_KDF_PARAM_ITER>) <unsigned integer>
  20. This parameter has a default value of 2048.
  21. =item "properties" (B<OSSL_KDF_PARAM_PROPERTIES>) <UTF8 string>
  22. =item "digest" (B<OSSL_KDF_PARAM_DIGEST>) <UTF8 string>
  23. These parameters work as described in L<EVP_KDF(3)/PARAMETERS>.
  24. =item "pkcs5" (B<OSSL_KDF_PARAM_PKCS5>) <integer>
  25. This parameter can be used to enable or disable SP800-132 compliance checks.
  26. Setting the mode to 0 enables the compliance checks.
  27. The checks performed are:
  28. =over 4
  29. =item - the iteration count is at least 1000.
  30. =item - the salt length is at least 128 bits.
  31. =item - the derived key length is at least 112 bits.
  32. =back
  33. The default provider uses a default mode of 1 for backwards compatibility,
  34. and the FIPS provider uses a default mode of 0.
  35. The value string is expected to be a decimal number 0 or 1.
  36. =back
  37. =head1 NOTES
  38. A typical application of this algorithm is to derive keying material for an
  39. encryption algorithm from a password in the "pass", a salt in "salt",
  40. and an iteration count.
  41. Increasing the "iter" parameter slows down the algorithm which makes it
  42. harder for an attacker to perform a brute force attack using a large number
  43. of candidate passwords.
  44. No assumption is made regarding the given password; it is simply treated as a
  45. byte sequence.
  46. =head1 CONFORMING TO
  47. SP800-132
  48. =head1 SEE ALSO
  49. L<EVP_KDF(3)>,
  50. L<EVP_KDF_CTX_new(3)>,
  51. L<EVP_KDF_CTX_free(3)>,
  52. L<EVP_KDF_CTX_set_params(3)>,
  53. L<EVP_KDF_derive(3)>,
  54. L<EVP_KDF(3)/PARAMETERS>
  55. =head1 HISTORY
  56. This functionality was added in OpenSSL 3.0.
  57. =head1 COPYRIGHT
  58. Copyright 2018-2020 The OpenSSL Project Authors. All Rights Reserved.
  59. Licensed under the Apache License 2.0 (the "License"). You may not use
  60. this file except in compliance with the License. You can obtain a copy
  61. in the file LICENSE in the source distribution or at
  62. L<https://www.openssl.org/source/license.html>.
  63. =cut