Versions in this module Expand all Collapse all v1 v1.0.4 Mar 3, 2024 v1.0.3 Aug 20, 2021 v1.0.2 Jun 20, 2021 Changes in this version + var Encryption = struct{ ... } + var Hashing = struct{ ... } + type EncryptionAES256GCM struct + func (t EncryptionAES256GCM) Decrypt(data []byte, passphrase string) ([]byte, error) + func (t EncryptionAES256GCM) DecryptKey(data []byte, key []byte) ([]byte, error) + func (t EncryptionAES256GCM) Encrypt(data []byte, passphrase string) ([]byte, error) + func (t EncryptionAES256GCM) EncryptKey(data []byte, key []byte) ([]byte, error) + func (t EncryptionAES256GCM) PassphraseToKey(passphrase string) []byte + type EncryptionChaCha20Poly1305 struct + func (t EncryptionChaCha20Poly1305) Decrypt(data []byte, passphrase string) ([]byte, error) + func (t EncryptionChaCha20Poly1305) DecryptKey(data []byte, key []byte) ([]byte, error) + func (t EncryptionChaCha20Poly1305) Encrypt(data []byte, passphrase string) ([]byte, error) + func (t EncryptionChaCha20Poly1305) EncryptKey(data []byte, key []byte) ([]byte, error) + func (t EncryptionChaCha20Poly1305) PassphraseToKey(passphrase string) []byte + type HashingBLAKE2 struct + Len int + func (t HashingBLAKE2) Hash(in []byte) []byte + func (t HashingBLAKE2) HashString(in string) string + type HashingSHA struct + Len int + func (t HashingSHA) Hash(in []byte) []byte + func (t HashingSHA) HashString(in string) string + type IEncryption interface + Decrypt func(data []byte, passphrase string) ([]byte, error) + DecryptKey func(data []byte, key []byte) ([]byte, error) + Encrypt func(data []byte, passphrase string) ([]byte, error) + EncryptKey func(data []byte, key []byte) ([]byte, error) + PassphraseToKey func(passphrase string) []byte + type IHashing interface + Hash func(in []byte) []byte + HashString func(in string) string v1.0.1 Mar 25, 2021 v1.0.0 Feb 9, 2021 Changes in this version + const HashingAlgorithmArgon2id + const HashingAlgorithmBCrypt + const HashingAlgorithmPBKDF2 + func Decrypt(data []byte, passphrase string) ([]byte, error) + func DecryptKey(data []byte, key []byte) ([]byte, error) + func Encrypt(data []byte, passphrase string) ([]byte, error) + func EncryptKey(data []byte, key []byte) ([]byte, error) + func HashSHA256(raw []byte) []byte + func HashSHA256String(raw string) string + func HashSHA512(raw []byte) []byte + func HashSHA512String(raw string) string + func PassphraseToEncryptionKey(raw string) []byte + func RandomBytes(length uint16) []byte + func RandomNumber(min int, max int) int + func RandomString(randomLength uint16) string + type HashedPassword []byte + func HashPassword(password []byte) (*HashedPassword, error) + func HashPasswordAlgorithm(password []byte, alg HashingAlgorithm) (*HashedPassword, error) + func (p HashedPassword) Algorithm() HashingAlgorithm + func (p HashedPassword) Compare(password []byte) bool + func (p HashedPassword) Upgrade(password []byte) *HashedPassword + type Hasher struct + type HashingAlgorithm string