aged

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ChunkSize = 64 * 1024

Variables

This section is empty.

Functions

func DecryptWithPwd

func DecryptWithPwd(p Parameters, pwd string) ([]byte, error)

func EncryptWithPwd

func EncryptWithPwd(p Parameters, pwd string) ([]byte, error)

func GenKeypair

func GenKeypair() (*age.X25519Identity, error)

Types

type AgeV1Obf

type AgeV1Obf struct{}

AgeV1Obf is a obfuscation for age encryption header.

func (*AgeV1Obf) Deobfuscate

func (a *AgeV1Obf) Deobfuscate(payload []byte) ([]byte, error)

func (*AgeV1Obf) Obfuscate

func (a *AgeV1Obf) Obfuscate(payload []byte) ([]byte, error)

type Keychain

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

func SetupKeychain

func SetupKeychain(keychainSetup SetupKeychainParameters) (Keychain, error)

func (Keychain) Decrypt

func (k Keychain) Decrypt(p Parameters) ([]byte, error)

func (Keychain) Encrypt

func (k Keychain) Encrypt(p Parameters) ([]byte, error)

func (Keychain) KeychainExport

func (k Keychain) KeychainExport() []string

func (Keychain) KeychainExportSecretKey

func (k Keychain) KeychainExportSecretKey() string

type Obfuscation

type Obfuscation interface {
	Obfuscate([]byte) ([]byte, error)
	Deobfuscate([]byte) ([]byte, error)
}

type Parameters

type Parameters struct {
	Data        []byte
	Compressor  compression.Compressor
	Compress    bool
	Obfuscation bool
	Obfuscator  Obfuscation
}

type Reader

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

func NewReader

func NewReader(key []byte, src io.Reader) (*Reader, error)

func (*Reader) Read

func (r *Reader) Read(p []byte) (int, error)

type SetupKeychainParameters

type SetupKeychainParameters struct {
	SecretKey     string
	PublicKeys    []string
	SelfRecipient bool
}

type Writer

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

func NewWriter

func NewWriter(key []byte, dst io.Writer) (*Writer, error)

func (*Writer) Close

func (w *Writer) Close() error

Close flushes the last chunk. It does not close the underlying Writer.

func (*Writer) Write

func (w *Writer) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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