Documentation
¶
Overview ¶
Package encrypt provides reversible AES-256-GCM encryption and decryption utilities for securing sensitive data like API keys and credentials.
Index ¶
- Variables
- func CompareHash(hash string, password string) (bool, error)
- func Decrypt(ciphertext string) (string, error)
- func Encrypt(plaintext string) (string, error)
- func Hash(password string) (string, error)
- func HashSHA256(value string) string
- func Init(key string, _logger schemas.Logger)
- func IsEnabled() bool
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEncryptionKeyNotInitialized = errors.New("encryption key is not initialized")
Functions ¶
func CompareHash ¶
CompareHash compares a hash and a password
func Decrypt ¶
Decrypt decrypts a base64-encoded ciphertext using AES-256-GCM and returns the plaintext
func Encrypt ¶
Encrypt encrypts a plaintext string using AES-256-GCM and returns a base64-encoded ciphertext
func HashSHA256 ¶
HashSHA256 returns a deterministic hex-encoded SHA-256 hash of the input. Used for hash-based lookups on encrypted columns (e.g., virtual key value, session token).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.