crypto

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeKey

func DecodeKey(encodedKey string) ([]byte, error)

DecodeKey decodes a base64url encoded key from a URL fragment

func Decrypt

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

Decrypt decrypts ciphertext using AES-128-GCM with the provided key

func EncodeKey

func EncodeKey(key []byte) string

EncodeKey encodes a key to base64url for use in URL fragments

func Encrypt

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

Encrypt encrypts plaintext using AES-128-GCM with the provided key

func GenerateKey

func GenerateKey() ([]byte, error)

GenerateKey generates a random AES-128 key (16 bytes)

Types

This section is empty.

Jump to

Keyboard shortcuts

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