Password Utilities
hash(password, password_salt, password_pepper)
Hashes password with salt and pepper using Argon2id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
password
|
(SecretStr, required)
|
Password to hash. |
required |
password_salt
|
(SecretStr, required)
|
Salt to hash password with. |
required |
password_pepper
|
(SecretStr, required)
|
Pepper to hash password with. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Hashed password. |
Source code in src/potato_util/crypto/password.py
verify(hashed_password, password, password_salt, password_pepper)
Verifies password with salt and pepper against hashed password using Argon2id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hashed_password
|
(str, required)
|
Hashed password. |
required |
password
|
(SecretStr, required)
|
Raw password to verify. |
required |
password_salt
|
(SecretStr, required)
|
Salt to verify password with. |
required |
password_pepper
|
(SecretStr, required)
|
Pepper to verify password with. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if password is match, False otherwise. |