Documentation ¶
Overview ¶
Package argon2 provides salt generation, hashing and verification for x/crypto/argon2.
Index ¶
Constants ¶
View Source
const ( Identifier_i = "argon2i" Identifier_d = "argon2d" // Unsupported Identifier_id = "argon2id" Prefix = "$argon2" )
Argon2 identifiers
View Source
const Format = "$%s$v=%d$m=%d,t=%d,p=%d$%s$%s"
Format of the PHC string format for argon2. See https://github.com/P-H-C/phc-string-format/blob/master/phc-sf-spec.md.
Variables ¶
View Source
var ( RecommendedIParams = Params{ Time: 3, Memory: 32 * 1024, Threads: 4, KeyLen: 32, SaltLen: 16, } RecommendedIDParams = Params{ Time: 1, Memory: 64 * 1024, Threads: 4, KeyLen: 32, SaltLen: 16, } )
View Source
var ( ErrArgon2d = errors.New("argon2d is not supported") ErrArgon2Version = fmt.Errorf("argon2: version required %x", argon2.Version) )
View Source
var Verifier = verifier.VerifyFunc(Verify)
Functions ¶
func Verify ¶
Verify parses encoded and uses its argon2 parameters to verify password against its hash. Either the result of Fail or OK is returned, or an error if parsing fails.
Note that argon2d is not supported by upstream and therefore not by this package. ErrArgon2d is returned when an argon2d identifier is in the encoded string.
Types ¶
type Hasher ¶
type Hasher struct {
// contains filtered or unexported fields
}
func NewArgon2i ¶
func NewArgon2id ¶
Click to show internal directories.
Click to hide internal directories.