Documentation ¶
Index ¶
- func DecodeValue(s string) ([]byte, error)
- func DecryptValue(encryptionKey string, text string) (string, error)
- func DeriveKey(password, salt []byte) (string, string, error)
- func EncodeValue(b []byte) string
- func EncryptValue(encryptionKey string, text string) (string, error)
- func GenerateKey() (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeValue ¶
DecodeValue decodes a base64 encoded string into a byte slice.
func DecryptValue ¶
DecryptValue decrypts a string using AES-256 and returns the decrypted value as a base64 encoded string. The master key used for decryption must be a base64 encoded string.
func DeriveKey ¶
DeriveKey derives a 32 byte key from the provided password and salt and returns the key and salt as base64 encoded strings. If salt is nil, a random salt will be generated.
func EncodeValue ¶
EncodeValue encodes a byte slice as a base64 encoded string.
func EncryptValue ¶
EncryptValue encrypts a string using AES-256 and returns the encrypted value as a base64 encoded string. The encryption key used for encryption must be a base64 encoded string.
func GenerateKey ¶
GenerateKey generates a random 32 byte key and returns it as a base64 encoded string.
Types ¶
This section is empty.