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
| Attribute | Type | Description |
|---|---|---|
| algorithm | string = pbkdf2_sha1 | Unique identifier for the hashing algorithm used to label and identify password hashes in the database. |
| digest | callable = hashlib.sha1 | The 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
| Type | Description |
|---|---|
string | The 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
| Type | Description |
|---|---|
callable | The hashlib.sha1 function used for generating the password hash. |