Documentation
¶
Overview ¶
services/auth/authn/passwords/passwords.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultArgon2idParams = &Argon2idParams{
Memory: 64 * 1024,
Iterations: 3,
Parallelism: 4,
SaltLength: 16,
KeyLength: 32,
}
DefaultArgon2idParams provides recommended default parameters. OWASP recommendations suggest t>=2, m>=19MiB (19456 KiB). Adjust these based on performance testing on your hardware.
Functions ¶
func HashPassword ¶
HashPassword securely hashes a password using Argon2id and returns a PHC string.
Types ¶
type Argon2idParams ¶
type Argon2idParams struct {
Memory uint32 // Memory cost in KiB
Iterations uint32 // Time cost (number of passes)
Parallelism uint8 // Parallelism factor (threads)
SaltLength uint32 // Length of the salt in bytes
KeyLength uint32 // Length of the derived key (hash) in bytes
}
Argon2idParams holds the parameters for Argon2id hashing. These parameters can be tuned based on your security requirements and server resources.
Click to show internal directories.
Click to hide internal directories.