Argon2idPasswordHasher class

Argon2id password hashing policy backed by PointyCastle.

The encoded format is:

routed-argon2id$v=1$i=2$m=19456$p=1$l=32$s=<salt>$h=<derived-key>

Salt and derived-key values use unpadded base64url encoding. The format is self-describing so parameter upgrades can be detected during login.

Implemented types

Constructors

Argon2idPasswordHasher({int iterations = 2, int memoryKiB = 19456, int parallelism = 1, int saltLength = 16, int derivedKeyLength = 32, List<int> saltGenerator(int length)?})
Creates an Argon2id hasher with the current password-policy defaults.

Properties

derivedKeyLength int
Number of derived-key bytes stored in newly created hashes.
final
hashCode int
The hash code for this object.
no setterinherited
iterations int
Argon2 passes used for newly created hashes.
final
memoryKiB int
Argon2 memory cost in KiB for newly created hashes.
final
parallelism int
Argon2 lanes used for newly created hashes.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
saltLength int
Number of random salt bytes used for newly created hashes.
final

Methods

hash(String password) String
Hashes password with a salt from the configured generator into the self-describing format.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
verify(String password, String encodedHash) PasswordVerification
Verifies password against encodedHash using constant-time comparison.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited