PyDocs

Nav

Cryptographic Services

pbkdf2_hmac

hashlib

function · Added in 3.4
  • pbkdf2_hmac(hash_name, password, salt, iterations, dklen=None)
Password based key derivation function 2 (PKCS #5 v2.0) with HMAC as pseudorandom function.
Changed in 3.12
  • 3.12: Function now only available when Python is built with OpenSSL. The slow pure Python implementation has been removed.
1 Example
>>> from hashlib import pbkdf2_hmac
>>> our_app_iters = 500_000  # Application specific, read above.
>>> dk = pbkdf2_hmac('sha256', b'password', b'bad salt' * 2, our_app_iters)
>>> dk.hex()
'15530bba69924174860db778f2c6f8104d3aaf9d26241840c8c4a641c8d000a9'
from the Python docs
See Also
No see-alsos for hashlib/pbkdf2_hmac
0 Notes
No notes for pbkdf2_hmac