security

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRandomKey

func GenerateRandomKey() (string, error)

GenerateRandomKey generates a random 32-byte key for AES-256

Types

type EncryptionService

type EncryptionService interface {
	// Encrypt encrypts plaintext using AES-GCM
	Encrypt(plaintext string) (string, error)

	// Decrypt decrypts ciphertext using AES-GCM
	Decrypt(ciphertext string) (string, error)

	// Hash creates a one-way hash of the input value using SHA-256
	Hash(value string) string
}

EncryptionService defines the interface for encryption and hashing operations

func NewEncryptionService

func NewEncryptionService(cfg *config.Configuration, logger *logger.Logger) (EncryptionService, error)

NewEncryptionService creates a new encryption service using the master key from config

Jump to

Keyboard shortcuts

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