Documentation
¶
Index ¶
- type MemoryEncryption
- func (m *MemoryEncryption) DecodeKey(encoded string) ([]byte, error)
- func (m *MemoryEncryption) DecryptMemory(encrypted []byte, key []byte) ([]byte, error)
- func (m *MemoryEncryption) DeriveKey(userSecret string, salt []byte) []byte
- func (m *MemoryEncryption) EncodeKey(key []byte) string
- func (m *MemoryEncryption) EncryptMemory(data []byte, key []byte) ([]byte, error)
- func (m *MemoryEncryption) GenerateSalt() ([]byte, error)
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
Click to show internal directories.
Click to hide internal directories.