# keystone.common.password_hashers.pbkdf2 module

class keystone.common.password_hashers.pbkdf2.Sha512

  Bases: `PasswordHasher`

  passlib transition class for PBKDF2 Sha512 password hashing

  static hash(password: bytes, salt_size: int = 16, rounds: int = 25000) → str

    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

    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

this page last updated: 2026-06-11 21:52:50

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.

found an error? report a bug