layercrypt

package
v0.0.0-...-30e74d6 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: CC0-1.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilContent       = errors.New("content pointer is nil")
	ErrDataTooShort     = errors.New("data too short")
	ErrInsufficientData = errors.New("insufficient data for payload, hint, or RemainingLayers")
)
View Source
var (
	ErrInvalidCiphertext = errors.New("invalid ciphertext format")
	ErrInvalidPrefix     = errors.New("invalid ciphertext prefix")
	ErrEmptyData         = errors.New("empty data")
	ErrInvalidPadding    = errors.New("invalid padding")
)
View Source
var (
	ErrGeneratingSalt    = errors.New("error generating salt")
	ErrCreatingCipher    = errors.New("error creating cipher")
	ErrInvalidBlockSize  = errors.New("ciphertext is not a multiple of the block size")
	ErrInvalidPaddingLen = errors.New("invalid padding length")
)

Functions

func Deserialize

func Deserialize(data []byte, content *Content) error

Types

type Content

type Content struct {
	Payload         []byte
	Hint            string
	RemainingLayers int
}

func (*Content) Serialize

func (c *Content) Serialize() []byte

type Decryptor

type Decryptor struct{}

Decryptor handles core decryption operations

func (*Decryptor) Decrypt

func (d *Decryptor) Decrypt(ciphertext []byte, password string) ([]byte, error)

Decrypt performs the decryption operation

type Encryptor

type Encryptor struct{}

Encryptor handles core encryption operations

func (*Encryptor) Decrypt

func (e *Encryptor) Decrypt(ciphertext []byte, password string) ([]byte, error)

Decrypt performs the decryption operation

func (*Encryptor) Encrypt

func (e *Encryptor) Encrypt(plaintext []byte, password string) ([]byte, error)

Encrypt performs the encryption operation

Jump to

Keyboard shortcuts

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