Skip to main content

pbkdf2

Return the hash of password using pbkdf2.

def pbkdf2(
password: string|bytes,
salt: string|bytes,
iterations: integer,
dklen: integer = 0,
digest: callable = None
) - > bytes

Return the hash of password using pbkdf2.

Parameters

NameTypeDescription
password`stringbytes`
salt`stringbytes`
iterationsintegerThe number of times the hashing algorithm is applied to slow down brute-force attempts.
dkleninteger = 0The desired length of the derived key in bytes; if 0 or None, the digest's default length is used.
digestcallable = NoneA hash constructor or function (defaults to hashlib.sha256) used as the underlying HMAC algorithm.

Returns

TypeDescription
bytesThe derived binary key of the specified length generated from the password and salt.