Documentation
¶
Overview ¶
Package algorithm contains cryptographic helpers used by GooseForum.
Index ¶
- func EncryptPassword(password string) (string, string, error)
- func GenerateRandomBytes(n int) ([]byte, error)
- func GenerateSigningKey(keyLength int) (string, error)
- func MakePassword(password string) (string, error)
- func SafeGenerateSigningKey(keyLength int) string
- func VerifyEncryptPassword(secretPassword, inputPassword string) error
- func VerifyPassword(encodedHash, encodedSalt, inputPassword string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncryptPassword ¶
EncryptPassword hashes password with a random salt.
func GenerateRandomBytes ¶ added in v0.0.2
GenerateRandomBytes returns n cryptographically secure random bytes.
func GenerateSigningKey ¶ added in v0.0.2
GenerateSigningKey returns a URL-safe base64 signing key with no padding.
func MakePassword ¶
MakePassword hashes password and returns a storable hash:salt string.
func SafeGenerateSigningKey ¶ added in v0.0.2
SafeGenerateSigningKey returns a signing key, falling back to math/rand on crypto errors.
func VerifyEncryptPassword ¶
VerifyEncryptPassword verifies inputPassword against a stored hash:salt value.
func VerifyPassword ¶
VerifyPassword verifies inputPassword against encodedHash and encodedSalt.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.