keystone.common.password_hashers.pbkdf2 模块¶
- class keystone.common.password_hashers.pbkdf2.Sha512[source]¶
基类:
PasswordHasher用于 PBKDF2 Sha512 密码哈希的 passlib 过渡类
- static hash(password: bytes, salt_size: int = 16, rounds: int = 25000) str[source]¶
生成带有 ident 和参数的密码哈希字符串
https://cryptography.io/en/stable/hazmat/primitives/key-derivation-functions/#pbkdf2
- 参数:
password (bytes) – 要哈希的密码。
salt (bytes) – 盐。
iterations (int) – 迭代次数
- 返回值:
格式为 $pbkdf2-sha512$ln=logN,r=R,p=P$salt$checksum 的字符串
- hash_algo = <cryptography.hazmat.primitives.hashes.SHA512 对象>¶
- ident:> str = '$pbkdf2-sha512$'¶
- name:> str = 'pbkdf2_sha512'¶