store

package
v0.0.0-...-84be8b5 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(encrypted []byte, passphrase []byte) ([]byte, error)

Decrypt decrypts the given encrypted data and returns the plaintext.

func Encrypt

func Encrypt(plaintext []byte, passphrase []byte) ([]byte, error)

Encrypt encrypts the given plaintext and returns the encrypted data

func EncryptAndSave

func EncryptAndSave(filePath string, passphrase []byte, data []byte) (merr error)

func ReadAndDecrypt

func ReadAndDecrypt(filePath string, passphrase []byte) ([]byte, error)

func ReadPassphrase

func ReadPassphrase() []byte

Types

type CipherParams

type CipherParams struct {
	Nonce string `json:"nonce"`
}

type EncryptionParams

type EncryptionParams struct {
	Cipher       string       `json:"cipher"`
	Ciphertext   string       `json:"ciphertext"`
	CipherParams CipherParams `json:"cipher_params"`
	Kdf          string       `json:"kdf"`
	KdfParams    KdfParams    `json:"kdf_params"`
}

type KdfParams

type KdfParams struct {
	Memory      uint32 `json:"memory"`
	Iterations  uint32 `json:"iterations"`
	Parallelism uint8  `json:"parallelism"`
	Salt        string `json:"salt"`
	KeyLength   uint32 `json:"key_length"`
}

Jump to

Keyboard shortcuts

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