Documentation
¶
Overview ¶
Package auth provides password hashing and verification utilities using the argon2id algorithm for secure credential storage.
Index ¶
Constants ¶
const ( Argon2Time = 2 Argon2Memory = 19 * 1024 // 19 MB — fits on 256MB VMs Argon2Threads = 1 Argon2KeyLen = 32 Argon2SaltLen = 16 )
Argon2 parameters (OWASP recommended second choice: m=19456, t=2, p=1)
Variables ¶
This section is empty.
Functions ¶
func CheckPassword ¶
CheckPassword verifies a password against an Argon2id hash.
func HashArgon2 ¶ added in v0.1.0
HashArgon2 creates an Argon2id hash of the input string. Returns encoded hash in format: $argon2id$v=19$m=19456,t=2,p=1$salt$hash
func HashPassword ¶
HashPassword creates an Argon2id hash of the password.
func NeedsRehash ¶ added in v0.7.0
NeedsRehash checks whether an encoded hash uses different parameters than the current defaults. Returns true if the hash should be re-created.
func VerifyArgon2 ¶ added in v0.1.0
VerifyArgon2 verifies an input string against an Argon2id hash. Uses constant-time comparison to prevent timing attacks.
Types ¶
This section is empty.