Documentation ¶
Overview ¶
Package security provides crypto and hashing support
Index ¶
- Constants
- Variables
- func Decrypt(e, expected_sha256 string, key []byte) (string, error)
- func DerivePassword(password string, cfg argon2.Config) (string, error)
- func EncodedSHA256(s string) string
- func Encrypt(s string, key []byte) (string, error)
- func MakeKey(s string) ([]byte, error)
- func VerifyPassword(guess, derived string) (bool, error)
Constants ¶
View Source
const KeyLen = 32
KeyLen is the encryption key length
Variables ¶
View Source
var ErrDigest = errors.New("value does not have correct digest")
ErrDigest signals a checksum mismatch
Functions ¶
func Decrypt ¶
Decrypt reverses Encrypt e is the crypted+encoded string
MakeKey is the best way to derive a key
func DerivePassword ¶
DerivePassword performs a one-way hash on a password using argon2
func EncodedSHA256 ¶
EncodedSHA256 returns the encoded (base16) sha256sums
func Encrypt ¶
Encrypt returns the hex-encoded AES symmetric encryption of s with key
MakeKey is the best way to derive a key
func VerifyPassword ¶
VerifyPassword returns true if guess is the same as the password forming derived
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.