sentry.hashers.pbkdf2 – sentry.hashers.pbkdf2 module reference

PBKDF2 hash

class sentry.hashers.pbkdf2.PBKDF2Hasher(iterations, dkLen, mac=None, digest=None)

Bases: sentry.hashers.BaseHasher

iterations is how many times to hash the password

dkLen is how many bytes to retrieve from the key derived from the password

mac is a module to use to generate message authentication codes. If unset it defaults to the standard hmac module

digest is which hash algorithm to use. If unset it default to the standard sha1 digest.

>>> h = PBKDF2Hasher(1200, 42)
>>> h.hsh("hello", "NaCl")
'NaCl:a2ZywAK8emy0AmTK+8YoVI7er/4EiHMkQLWjnj+O7h0EB0rTnbbx9+ce'
hsh(clear, salt)