Help us shape the future of Go! Take the 2026 Go Developer Survey

crypto

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package crypto provides AES-256-GCM encryption for sensitive configuration values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encryptor

type Encryptor struct {
	// contains filtered or unexported fields
}

Encryptor provides AES-256-GCM encryption and decryption.

func NewEncryptor

func NewEncryptor(keyHex string) (*Encryptor, error)

NewEncryptor creates an Encryptor from a 64-character hex string (32 bytes).

func (*Encryptor) Decrypt

func (e *Encryptor) Decrypt(ciphertext, nonce []byte) ([]byte, error)

Decrypt decrypts ciphertext using AES-256-GCM with the given nonce.

func (*Encryptor) Encrypt

func (e *Encryptor) Encrypt(plaintext []byte) (ciphertext, nonce []byte, err error)

Encrypt encrypts plaintext using AES-256-GCM. Returns ciphertext and nonce.

Jump to

Keyboard shortcuts

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