crypto

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(data []byte, key ...interface{}) ([]byte, error)

Decrypt decrypts data using AES-GCM with a 256-bit key. If no key is provided, it will use the STDEXT_ENC_KEY environment variable. If that is not set, it will return an error.

Parameters:

  • data: the data to decrypt
  • key: the key to use for decryption

Returns:

  • the decrypted data
  • an error if one occurred

func Encrypt

func Encrypt(data []byte, key ...interface{}) ([]byte, error)

Encrypt encrypts data using AES-GCM with a 256-bit key. If no key is provided, it will use the STDEXT_ENC_KEY environment variable. If that is not set, it will return an error.

Parameters:

  • data: the data to encrypt
  • key: the key to use for encryption

Returns:

  • the encrypted data
  • an error if one occurred

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL