encryption

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package encryption provides data encryption at rest

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash

func Hash(input string) string

Hash creates a SHA-256 hash of the input

Types

type Encryptor

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

Encryptor provides AES-GCM encryption

func NewEncryptor

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

NewEncryptor creates a new encryptor

func (*Encryptor) Decrypt

func (e *Encryptor) Decrypt(ciphertext string) (string, error)

Decrypt decrypts ciphertext

func (*Encryptor) DecryptMap

func (e *Encryptor) DecryptMap(data map[string]string) (map[string]string, error)

DecryptMap decrypts all values in a map

func (*Encryptor) Encrypt

func (e *Encryptor) Encrypt(plaintext string) (string, error)

Encrypt encrypts plaintext

func (*Encryptor) EncryptMap

func (e *Encryptor) EncryptMap(data map[string]string) (map[string]string, error)

EncryptMap encrypts all values in a map

Jump to

Keyboard shortcuts

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