from quart_imp.auth import encrypt_password
encrypt_password(
password: str,
salt: str,
encryption_level: int = 512,
pepper_length: int = 1,
pepper_position: t.Literal["start", "end"] = "end"
) -> str
For use in password hashing.
To be used alongside the quart_imp.auth / authenticate_password function.
Takes the plain password, applies a pepper, salts it, then produces a digested sha512 or sha256 if specified.
Can set the encryption level to 256 or 512, defaults to 512.
Can set the pepper length, defaults to 1. Max is 3.
Can set the pepper position, "start" or "end", defaults to "end".
Note:
Plain password: "password"
Generated salt: "^%$*" (randomly generated)
Generated pepper (length 1): "A" (randomly generated)
Pepper position: "end"