Versions in this module Expand all Collapse all v0 v0.10.1 Jul 30, 2018 v0.10.0 Jul 7, 2018 Changes in this version + var ErrPasswordEncoderIsNil = errors.New("security/crypto: password encoder is nil") + var ErrUnableToDecrypt = errors.New("security/crypto: unable to decrypt") + func AESDecrypt(block cipher.Block, value []byte) ([]byte, error) + func AESDecryptString(key, encryptedText string) (string, error) + func AESEncrypt(block cipher.Block, value []byte) []byte + func AESEncryptString(key, text string) (string, error) + func AddPasswordAlgorithm(name string, pe PasswordEncoder) error + func InitPasswordEncoders(cfg *config.Config) error + func Sign(key, value []byte, sha string) []byte + func SignString(key, text, sha string) string + func Verify(key, value, mac []byte, sha string) bool + func VerifyString(key, text, signedText, sha string) (bool, error) + type BcryptEncoder struct + func (be *BcryptEncoder) Compare(hash, password []byte) bool + func (be *BcryptEncoder) Generate(password []byte) ([]byte, error) + type PasswordEncoder interface + Compare func(hash, password []byte) bool + Generate func(password []byte) ([]byte, error) + func PasswordAlgorithm(alg string) PasswordEncoder + type Pbkdf2Encoder struct + func (pe *Pbkdf2Encoder) Compare(hash, password []byte) bool + func (pe *Pbkdf2Encoder) Generate(password []byte) ([]byte, error) + type ScryptEncoder struct + func (se *ScryptEncoder) Compare(hash, password []byte) bool + func (se *ScryptEncoder) Generate(password []byte) ([]byte, error)