Module sodiumoxide::crypto::pwhash::argon2id13[][src]

Expand description

Argon2 summarizes the state of the art in the design of memory-hard functions.

It aims at the highest memory filling rate and effective use of multiple computing units, while still providing defense against tradeoff attacks.

It prevents ASICs from having a significant advantage over software implementations.

Argon2id provides a hybrid implementation, selecting the best features of Argon2i (with resistance to side-channel attackes) and Argon2d (with resistance to time-memory tradeoff (TMTO) attacks). If you are unsure of which Argon2 variant to use, use this one.

Note: libsodium provides a limited version of the Argon2 function. The salt parameter is fixed at 128 bits and the parallelism parameter is fixed to 1.

Structs

HashedPassword

HashedPasswordis a password verifier generated from a password

MemLimit

MemLimit represents the maximum amount of RAM that the functions in this module will use, in bytes.

OpsLimit

OpsLimit represents the maximum number of computations to perform when using the functions in this module.

Salt

Salt used for password hashing

Constants

HASHEDPASSWORDBYTES

Number of bytes in a HashedPassword.

MEMLIMIT_INTERACTIVE

Safe base line for MemLimit for interactive password hashing.

MEMLIMIT_MODERATE

MemLimit for moderately sensitive data.

MEMLIMIT_SENSITIVE

MemLimit for highly sensitive data.

OPSLIMIT_INTERACTIVE

Safe base line for OpsLimit for interactive password hashing.

OPSLIMIT_MODERATE

OpsLimit for moderately sensitive data.

OPSLIMIT_SENSITIVE

OpsLimit for highly sensitive data.

SALTBYTES

Number of bytes in a Salt.

STRPREFIX

All HashedPasswords start with this string.

VARIANT

Variant id for the Argon2i13 algorithm

Functions

derive_key

The derive_key() function derives a key from a password and a Salt

gen_salt

gen_salt() randomly generates a new Salt for key derivation

pwhash

The pwhash() returns a HashedPassword which includes:

pwhash_verify

pwhash_verify() verifies that the password str_ is a valid password verification string (as generated by pwhash()) for passwd