crypto

package
v0.0.0-...-95c80d3 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeriveKeyFromMasterKey

func DeriveKeyFromMasterKey(masterKey, salt []byte) []byte

DeriveKeyFromPassphrase derives a cryptographic key from the provided passphrase using Argon2.

func SaltLen

func SaltLen() int

Types

type Decryptor

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

func NewDecryptor

func NewDecryptor(w io.Writer, key, iv []byte) (*Decryptor, error)

Decrytor wrap io.CryptStreamWriter and create ciper.Stream automatically

func (*Decryptor) Write

func (d *Decryptor) Write(p []byte) (int, error)

type Encryptor

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

func NewEncryptor

func NewEncryptor(r io.ReadSeeker, key, iv []byte, hasHeader bool) (*Encryptor, error)

Encrytor wrap io.CryptStreamReader and create ciper.Stream automatically

func (*Encryptor) GetHashEncrypt

func (e *Encryptor) GetHashEncrypt() []byte

func (*Encryptor) GetHashOrig

func (e *Encryptor) GetHashOrig() []byte

func (*Encryptor) Read

func (e *Encryptor) Read(p []byte) (int, error)

func (*Encryptor) Seek

func (e *Encryptor) Seek(offset int64, whence int) (int64, error)

type MasterDecryptor

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

MasterDecryptor will on-the-fly decrypt nonce

func NewMasterDecryptor

func NewMasterDecryptor(w io.Writer, key []byte) *MasterDecryptor

The Decrytor wrap io.CryptStreamWriter and create ciper.Stream automatically

func (*MasterDecryptor) Write

func (md *MasterDecryptor) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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