Documentation ¶
Index ¶
- func Decrypt(key, ciphertext []byte) ([]byte, error)
- func DecryptString(key []byte, encodedtext string) (string, error)
- func DecryptValue(key []byte, encodedtext string, v any) error
- func Encrypt(key, plaintext []byte) ([]byte, error)
- func EncryptString(key []byte, plaintext string) (string, error)
- func EncryptValue(key []byte, v any) (string, error)
- func RandomBytes(n int) ([]byte, error)
- func RandomString(n int) (string, error)
- type Crypt
- func (c *Crypt) Decrypt(ciphertext []byte) ([]byte, error)
- func (c *Crypt) DecryptString(encodedtext string) (string, error)
- func (c *Crypt) DecryptValue(encodedtext string, v any) error
- func (c *Crypt) Encrypt(plaintext []byte) ([]byte, error)
- func (c *Crypt) EncryptString(plaintext string) (string, error)
- func (c *Crypt) EncryptValue(v any) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decrypt ¶
Decrypt decrypts data encrypted with Encrypt using 256-bit AES-GCM and checks that the data wasn't altered.
func Encrypt ¶
Encrypt encrypts data using 256-bit AES-GCM. The resulting ciphertext provides a check that the data hasn't been altered.
func RandomBytes ¶
func RandomString ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.