crypt

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKey

func GenerateKey(w io.Writer, size int) error

GenerateKey generates a random encryption key

func RunDecrypt

func RunDecrypt(w io.Writer, args []string, opts CryptOptions) error

RunDecrypt decrypts data using AES-256-GCM

func RunEncrypt

func RunEncrypt(w io.Writer, args []string, opts CryptOptions) error

RunEncrypt encrypts data using AES-256-GCM

Types

type CryptOptions

type CryptOptions struct {
	Password     string // -p: password for encryption
	PasswordFile string // -P: read password from file
	KeyFile      string // -k: use key file
	Salt         string // -s: salt for key derivation
	Iterations   int    // -i: PBKDF2 iterations (default 100000)
	Output       string // -o: output file
	Base64       bool   // -b: base64 encode/decode
	Armor        bool   // -a: ASCII armor output (same as -b)
}

CryptOptions configures the encrypt/decrypt command behavior

Jump to

Keyboard shortcuts

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