Judging from the return value of the hash
function in class PasswordHasher
from argon2-cffi
, it appears it can be concluded that the hybrid "flavour" is used by default.
from argon2 import PasswordHasher
PasswordHasher().hash("foo")
Returns:
"$argon2id$v=19$m=65536,t=3,p=4$xIu1KPUI7Ofe6HxYhmbNiA$6q7HjVOe6933Ogaw0f7pLodCdBgJsST8JAszTkv4Jh4"
This is confirmed by the comment in said class:
Uses Argon2\ **id** by default and always uses a random salt_ for hashing.
But it can verify any type of Argon2 as long as the hash is correctly
encoded.
Changing the "flavour" used by the module is done by assigning the variable type
of class PasswordHasher
to a Type
class defined in like so:
from argon2 import PasswordHasher, Type
PasswordHasher(type=Type.I).hash("foo") # lib.Argon2_i
PasswordHasher(type=Type.D).hash("foo") # lib.Argon2_d
PasswordHasher(type=Type.ID).hash("foo") # lib.Argon2_id
Each of these Type
variables reference a corresponding argon2 library, shown in comments.