crypt#

Application cryptography configuration

app.lib.crypt.get_encryption_key(secret: str) bytes[source]#

Get Encryption Key.

Parameters:

secret (str) – Secret key used for encryption

Returns:

a URL safe encoded version of secret

Return type:

bytes

async app.lib.crypt.get_password_hash(password: str | bytes) str[source]#

Get password hash.

Parameters:

password – Plain password

Returns:

Hashed password

Return type:

str

async app.lib.crypt.verify_password(plain_password: str | bytes, hashed_password: str) bool[source]#

Verify Password.

Parameters:
  • plain_password (str | bytes) – The string or byte password

  • hashed_password (str) – the hash of the password

Returns:

True if password matches hash.

Return type:

bool