keystone.common.password_hashers.pbkdf2 module¶
- class keystone.common.password_hashers.pbkdf2.Sha512[source]¶
Bases:
PasswordHasher
passlib transition class for PBKDF2 Sha512 password hashing
- static hash(password: bytes, salt_size: int = 16, rounds: int = 25000) str [source]¶
Generate password hash string with ident and params
https://cryptography.io/en/stable/hazmat/primitives/key-derivation-functions/#pbkdf2
- Parameters:
password (bytes) – Password to be hashed.
salt (bytes) – Salt.
iterations (int) – Iterations count
- Returns:
String in format $pbkdf2-sha512$ln=logN,r=R,p=P$salt$checksum
- hash_algo = <cryptography.hazmat.primitives.hashes.SHA512 object>¶
- ident: str = '$pbkdf2-sha512$'¶
- name: str = 'pbkdf2_sha512'¶
- static verify(password: bytes, hashed: str) bool [source]¶
Verify hashing password would be equal to the hashed value
- Parameters:
password (bytes) – Password to verify
hashed (string) – Hashed password. Used to extract hashing parameters
- Returns:
boolean whether hashing password with the same parameters would match hashed value