cryptor

package
v0.0.0-...-3863e02 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBufferSize = 1 << 20
	AuthMSGLength     = 16
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cryptor

type Cryptor struct {
	cipher.AEAD `json:"-"`
	//types support now chacha20poly1305,xchacha20poly1305
	Type CryptorType `josn:"type"`
	Key  []byte      `josn:"key"`
}

func LoadFromJson

func LoadFromJson(fname string) (c *Cryptor, err error)

func NewChacha20Poly1305Cryptor

func NewChacha20Poly1305Cryptor() (c *Cryptor, err error)

func NewXChacha20Poly1305Cryptor

func NewXChacha20Poly1305Cryptor() (c *Cryptor, err error)

func (*Cryptor) DecryptDir

func (c *Cryptor) DecryptDir(dirName string, outDirName string) error

func (*Cryptor) DecryptFile

func (c *Cryptor) DecryptFile(fname string, outFName string) error

func (*Cryptor) EncryptDir

func (c *Cryptor) EncryptDir(dirName string, outDirName string) error

func (*Cryptor) EncryptFile

func (c *Cryptor) EncryptFile(fname string, outFName string) error

func (*Cryptor) Save

func (c *Cryptor) Save(fname string) error

type CryptorType

type CryptorType int
const (
	CryptorChacha20poly1305 CryptorType = iota
	CryptorXChacha20poly1305
)

Jump to

Keyboard shortcuts

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