k9crypt

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChunkSize        = 64 * 1024
	DefaultBatchSize = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchProgressInfo added in v1.0.2

type BatchProgressInfo struct {
	Current    int
	Total      int
	Percentage float64
}

type DecryptFileOptions added in v1.0.2

type DecryptFileOptions struct {
	OnProgress func(ProgressInfo)
}

type DecryptManyOptions added in v1.0.2

type DecryptManyOptions struct {
	SkipInvalid bool
	Parallel    bool
	BatchSize   int
	OnProgress  func(BatchProgressInfo)
}

type EncryptFileOptions added in v1.0.2

type EncryptFileOptions struct {
	CompressionLevel int
	OnProgress       func(ProgressInfo)
}

type EncryptManyOptions added in v1.0.2

type EncryptManyOptions struct {
	CompressionLevel int
	Parallel         bool
	BatchSize        int
	OnProgress       func(BatchProgressInfo)
}

type K9Crypt

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

func New

func New(secretKey string) *K9Crypt

func NewWithOptions added in v1.0.2

func NewWithOptions(secretKey string, compressionLevel int) *K9Crypt

func (*K9Crypt) Decrypt

func (k *K9Crypt) Decrypt(encryptedData string) (string, error)

func (*K9Crypt) DecryptFile added in v1.0.2

func (k *K9Crypt) DecryptFile(encryptedData string, options *DecryptFileOptions) ([]byte, error)

func (*K9Crypt) DecryptMany added in v1.0.2

func (k *K9Crypt) DecryptMany(ciphertextArray []string, options *DecryptManyOptions) ([]string, error)

func (*K9Crypt) Encrypt

func (k *K9Crypt) Encrypt(plaintext string) (string, error)

func (*K9Crypt) EncryptFile added in v1.0.2

func (k *K9Crypt) EncryptFile(plaintext []byte, options *EncryptFileOptions) (string, error)

func (*K9Crypt) EncryptMany added in v1.0.2

func (k *K9Crypt) EncryptMany(dataArray []string, options *EncryptManyOptions) ([]string, error)

func (*K9Crypt) GetCompressionLevel added in v1.0.2

func (k *K9Crypt) GetCompressionLevel() int

func (*K9Crypt) SetCompressionLevel added in v1.0.2

func (k *K9Crypt) SetCompressionLevel(level int) error

type Options added in v1.0.2

type Options struct {
	CompressionLevel int
}

type ProgressInfo added in v1.0.2

type ProgressInfo struct {
	ProcessedBytes int64
	TotalBytes     int64
	Percentage     float64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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