Documentation
¶
Overview ¶
Package raw provides a raw implementation of the modular-crypt-wrapped Argon2i primitive.
Index ¶
Constants ¶
View Source
const ( RecommendedTime uint32 = 4 // Current recommended time value for interactive logins RecommendedMemory uint32 = 32 * 1024 // Current recommended memory for interactive logins RecommendedThreads uint8 = 4 // Current recommended number of threads for interactive logins. )
Variables ¶
View Source
var ( ErrInvalidStub = errors.New("invalid argon2 password stub") ErrMissingTime = errors.New("time parameter (t) is missing") ErrParseConfig = errors.New("hash config section has wrong number of parameters") ErrParseVersion = errors.New("version section has wrong number of parameters") ErrMissingMemory = errors.New("memory parameter (m) is missing") ErrMissingVersion = errors.New("version parameter (v) is missing") ErrMissingParallelism = errors.New("parallelism parameter (p) is missing") ErrInvalidKeyValuePair = errors.New("invalid argon2 key-value pair") )
Functions ¶
func Argon2 ¶
Wrapper for golang.org/x/crypto/argon2 that implements a sensible hashing interface.
password must be in UTF-8 format. salt must be a random salt value in binary form. time, memory and threads are parameters for argon2.
Returns hash in argon2 encoding.
func Parse ¶
func Parse(stub string) (salt, hash []byte, version int, time, memory uint32, parallelism uint8, err error)
Parse parses an argon2 encoded hash. The format is as follows:
$argon2i$v=version$m=memory,t=time,p=threads$salt$hash // hash $argon2i$v=version$m=memory,t=time,p=threads$salt // stub
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.