Skip to main content

PBKDF2SHA1PasswordHasher

Alternate PBKDF2 hasher which uses SHA1, the default PRF recommended by PKCS #5. This is compatible with other implementations of PBKDF2, such as openssl's PKCS5_PBKDF2_HMAC_SHA1().

Attributes

AttributeTypeDescription
algorithmstring = pbkdf2_sha1Unique identifier for the hashing algorithm used to label and identify password hashes in the database.
digestcallable = hashlib.sha1The HMAC digest algorithm used by PBKDF2 to derive the cryptographic key, specifically set to SHA1 for compatibility with PKCS #5.

Constructor

Signature

def PBKDF2SHA1PasswordHasher()

Methods


algorithm()

def algorithm() - > string

The unique identifier for the hashing algorithm used by this class, specifically 'pbkdf2_sha1'.

Returns

TypeDescription
stringThe string identifier for the PBKDF2-SHA1 algorithm.

digest()

def digest() - > callable

The cryptographic hash function used as the pseudo-random function (PRF) for the PBKDF2 process.

Returns

TypeDescription
callableThe hashlib.sha1 function used for generating the password hash.