crypto

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const MasterKeySize = 32

Variables

This section is empty.

Functions

This section is empty.

Types

type MasterKey

type MasterKey [MasterKeySize]byte

func GenerateMasterKey

func GenerateMasterKey(path string) (MasterKey, error)

GenerateMasterKey creates a new key with exclusive file creation. It never replaces an existing key.

func LoadMasterKey

func LoadMasterKey(path string) (MasterKey, error)

type Sealer

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

func NewSealer

func NewSealer(key MasterKey) (*Sealer, error)

func (*Sealer) Decrypt

func (s *Sealer) Decrypt(envelope string, purpose string) ([]byte, error)

func (*Sealer) Encrypt

func (s *Sealer) Encrypt(plaintext []byte, purpose string) (string, error)

Jump to

Keyboard shortcuts

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