v1

package
v0.32.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateKey added in v0.3.15

func CreateKey(password string, salt []byte) [32]byte

CreateKey derives a key from a password and salt

func CreateKeySalt added in v0.3.15

func CreateKeySalt(password string) ([32]byte, [128]byte, error)

CreateKeySalt derives a key and salt from a password: returns key, salt, err

func DecryptFile added in v0.3.15

func DecryptFile(ciphertext []byte, key [32]byte) ([]byte, error)

DecryptFile decrypts the passed ciphertext with the supplied key.

func EncryptFileData added in v0.3.15

func EncryptFileData(data []byte, key [32]byte) ([]byte, error)

EncryptFileData encrypts the data with the supplied key

func ReadEncryptedFile added in v0.3.15

func ReadEncryptedFile(directory, filename string, key [32]byte) ([]byte, error)

ReadEncryptedFile reads data from an encrypted file in directory with key

Types

type FileStore

type FileStore interface {
	Write([]byte) error
	Read() ([]byte, error)
	Delete()
	ChangeKey(newkey [32]byte)
}

FileStore is a primitive around storing encrypted files

func NewFileStore

func NewFileStore(directory string, filename string, key [32]byte) FileStore

NewFileStore instantiates a fileStore given a filename and a password

Jump to

Keyboard shortcuts

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