Versions in this module Expand all Collapse all v1 v1.0.0 Dec 7, 2015 Changes in this version + var ErrKeyNotFound = errors.New("Key not found") + func CurrentHashes(prefix string, value []byte) ([][]byte, error) + func CurrentHashesString(prefix string, value string) ([]string, error) + func Decrypt(keyPrefix string, dst, src []byte) ([]byte, error) + func Encrypt(prefix string, dst, src []byte) ([]byte, error) + func EncryptWithVersion(keyPrefix string, keyVersion uint64, dst []byte, src []byte) ([]byte, error) + func Hash(prefix string, value []byte) ([]byte, error) + func HashString(prefix string, value string) (string, error) + func HashWithVersion(prefix string, version uint64, value []byte) ([]byte, error) + func Reencrypt(keyPrefix string, dst, src []byte) ([]byte, error) + func Sum256String(s string) string + type Cipher uint8 + const AES + type CipherBlockMode uint8 + const CFB + const CTR + const GCM + const OFB + type DevKeyProvider struct + DisableWarn bool + KeyVersion uint64 + func (kp *DevKeyProvider) CurrentKeyVersion(prefix string) (uint64, error) + func (kp *DevKeyProvider) GetKey(prefix string, version uint64) (*Key, error) + type DevSaltProvider struct + DisableWarn bool + SaltVersion uint64 + func (sp *DevSaltProvider) CurrentSaltVersion(prefix string) (uint64, error) + func (sp *DevSaltProvider) CurrentSalts(prefix string) ([]uint64, error) + func (sp *DevSaltProvider) GetSalt(prefix string, version uint64) ([]byte, error) + type Key struct + Cipher Cipher + CipherBlockMode CipherBlockMode + Version uint64 + func NewKey(version uint64, c Cipher, bm CipherBlockMode, key []byte) (*Key, error) + func (k *Key) Decrypt(dst, src []byte) ([]byte, error) + func (k *Key) Encrypt(dst, src []byte) ([]byte, error) + type KeyProvider interface + CurrentKeyVersion func(prefix string) (uint64, error) + GetKey func(prefix string, version uint64) (*Key, error) + var DefaultKeyProvider KeyProvider = new(DevKeyProvider) + type SaltProvider interface + CurrentSaltVersion func(prefix string) (uint64, error) + CurrentSalts func(prefix string) ([]uint64, error) + GetSalt func(prefix string, version uint64) ([]byte, error) + var DefaultSaltProvider SaltProvider = new(DevSaltProvider)