crypto

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(key []byte, encoded string) (string, error)

Decrypt decrypts a base64-encoded AES-256-GCM ciphertext with the given key.

func Encrypt

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

Encrypt encrypts plaintext using AES-256-GCM with the given key. Returns a base64-encoded string containing the nonce prepended to the ciphertext.

func ValidateKey

func ValidateKey(key []byte) error

ValidateKey checks that the key is exactly 32 bytes (AES-256).

Types

This section is empty.

Jump to

Keyboard shortcuts

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