Documentation ¶
Overview ¶
Package crypt provides a UNIX crypt-style API for password hashing using structured hashes in PHC format.
Built-in functions ¶
This package provides the built-in implementations for widely used password hashing algorithms with reasonable default parameter values.
## Argon2
Argon2 implementation supports Argon2i and Argon2id variants, and requires explicit memory, iterations and parallelism parameters.
$argon2<variant>[$v=<version>]$m=<memory>,t=<iterations>,p=<parallelism>[$<salt>[$<hash>]]
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Crypter ¶
type Crypter interface { // Crypt computes the hash of password string k using the given hash // parameters. Applying Crypt to the returned hash is deterministic, // that is, it always returns the same result that is equal to the // returned hash. // // If h contains a salt string without output, then Crypt computes a // hash output whose length is the default output length for the // specified hash algorithm. The resulting hash contains a strict, // deterministic encoding of the used parameters, salt and output. // // If h does not contain salt (and therefore output), then it generates // a new new appropriate salt value as mandated by the specified hash // algorithm using the defined default salt length, and then proceeds // as in the previous case. // // If h contains hash function output, then it computes an output with // exactly the same length as the one provided in the input. It returns // the exact parameters and salt as they were received, and the newly // computed output. Basically, it recomputes hash output for password // verification. Crypt(k, h string) (string, error) }
Crypter is a UNIX crypt-like API that can be used both for password registration, and for password verification.
Directories ¶
Path | Synopsis |
---|---|
Package crypterrors defines errors that can be returned from crypt.Crypter implementations.
|
Package crypterrors defines errors that can be returned from crypt.Crypter implementations. |
Click to show internal directories.
Click to hide internal directories.