v1

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyLength = 32 // aes256

	ArgonTime    = 1
	ArgonMemory  = 64 * 1024
	ArgonThreads = 4
)
View Source
const (
	NonceLength = 16
	LenLength   = 4  // uint32
	MACLength   = 32 // sha256
)

Variables

View Source
var (
	ErrEmptyPassword    = errors.New("password is empty")
	ErrBadPassword      = errors.New("bad password")
	ErrShortData        = errors.New("encrypted data is short")
	ErrIncorrectPadding = errors.New("data is incorrectly padded")
)
View Source
var ConstantIV [16]byte

constant IV is fine because we rotate keys each time, keys is defined by a password and KDF nonce. Since KDF nonce is regenerated, we do not have a persistent key. Thus, an attack on a first block is not relevan for us. it means, we can skip storing and generating IV https://stackoverflow.com/a/2648345

Functions

This section is empty.

Types

type Vault

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

func NewVault

func NewVault(password string) (*Vault, error)

func (*Vault) Delete

func (v *Vault) Delete(key string)

func (*Vault) Get

func (v *Vault) Get(key string) (string, bool)

func (*Vault) List

func (v *Vault) List() []string

func (*Vault) MarshalBinary

func (v *Vault) MarshalBinary() ([]byte, error)

func (*Vault) Set

func (v *Vault) Set(key, value string)

func (*Vault) UnmarshalBinary

func (v *Vault) UnmarshalBinary(data []byte) error

func (*Vault) Version

func (v *Vault) Version() uint8

Jump to

Keyboard shortcuts

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