crypto

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(key, ciphertext []byte) ([]byte, error)

Decrypt reverses Encrypt. Returns an error if the tag check fails.

func Encrypt

func Encrypt(key, plaintext []byte) ([]byte, error)

Encrypt encrypts plaintext with AES-GCM-256. Output layout: [12-byte nonce][ciphertext][16-byte GCM tag].

func LoadKeyFromEnv

func LoadKeyFromEnv(envVar string) ([]byte, error)

LoadKeyFromEnv reads a 32-byte AES-256 key from the named environment variable. Accepts standard base64, URL-safe base64, hex, or raw 32 bytes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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