You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.2 KiB
59 lines
1.2 KiB
# SPDX-License-Identifier: MIT
|
|
|
|
"""
|
|
This module offers access to standardized parameters that you can load using
|
|
:meth:`PasswordHasher.from_parameters()`. See the `source code
|
|
<https://github.com/hynek/argon2-cffi/blob/main/src/argon2/profiles.py>`_ for
|
|
concrete values and :doc:`parameters` for more information.
|
|
|
|
.. versionadded:: 21.2.0
|
|
"""
|
|
|
|
from ._utils import Parameters
|
|
from .low_level import Type
|
|
|
|
|
|
# FIRST RECOMMENDED option per RFC 9106.
|
|
RFC_9106_HIGH_MEMORY = Parameters(
|
|
type=Type.ID,
|
|
version=19,
|
|
salt_len=16,
|
|
hash_len=32,
|
|
time_cost=1,
|
|
memory_cost=2097152, # 2 GiB
|
|
parallelism=4,
|
|
)
|
|
|
|
# SECOND RECOMMENDED option per RFC 9106.
|
|
RFC_9106_LOW_MEMORY = Parameters(
|
|
type=Type.ID,
|
|
version=19,
|
|
salt_len=16,
|
|
hash_len=32,
|
|
time_cost=3,
|
|
memory_cost=65536, # 64 MiB
|
|
parallelism=4,
|
|
)
|
|
|
|
# The pre-RFC defaults in argon2-cffi 18.2.0 - 21.1.0.
|
|
PRE_21_2 = Parameters(
|
|
type=Type.ID,
|
|
version=19,
|
|
salt_len=16,
|
|
hash_len=16,
|
|
time_cost=2,
|
|
memory_cost=102400, # 100 MiB
|
|
parallelism=8,
|
|
)
|
|
|
|
# Only for testing!
|
|
CHEAPEST = Parameters(
|
|
type=Type.ID,
|
|
version=19,
|
|
salt_len=8,
|
|
hash_len=4,
|
|
time_cost=1,
|
|
memory_cost=8,
|
|
parallelism=1,
|
|
)
|