security

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryEncryption

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

func NewMemoryEncryption

func NewMemoryEncryption() *MemoryEncryption

func (*MemoryEncryption) DecodeKey

func (m *MemoryEncryption) DecodeKey(encoded string) ([]byte, error)

DecodeKey decodes a base64-encoded key

func (*MemoryEncryption) DecryptMemory

func (m *MemoryEncryption) DecryptMemory(encrypted []byte, key []byte) ([]byte, error)

DecryptMemory decrypts memory data for retrieval

func (*MemoryEncryption) DeriveKey

func (m *MemoryEncryption) DeriveKey(userSecret string, salt []byte) []byte

DeriveKey derives an encryption key from user secret

func (*MemoryEncryption) EncodeKey

func (m *MemoryEncryption) EncodeKey(key []byte) string

EncodeKey encodes a key to base64 for storage

func (*MemoryEncryption) EncryptMemory

func (m *MemoryEncryption) EncryptMemory(data []byte, key []byte) ([]byte, error)

EncryptMemory encrypts memory data before storage

func (*MemoryEncryption) GenerateSalt

func (m *MemoryEncryption) GenerateSalt() ([]byte, error)

GenerateSalt generates a random salt for key derivation

Jump to

Keyboard shortcuts

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