crypt

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package crypt provides optional bundle encryption by shelling out to the `age` CLI (https://github.com/FiloSottile/age). It deliberately does not embed a crypto library: like the git integration, cct stays a single, dependency-free binary and reuses a well-known external tool when the user opts into encryption. If `age` is not installed, encryption simply errors with guidance and nothing else in cct is affected.

Index

Constants

View Source
const Extension = ".age"

Extension is the suffix used for encrypted bundles.

Variables

This section is empty.

Functions

func Available

func Available() bool

Available reports whether the `age` binary is on PATH.

func Decrypt

func Decrypt(in, out string, opts DecryptOptions) error

Decrypt decrypts the encrypted file in to the file out using age. age may prompt on the terminal for a passphrase or for an encrypted identity, so the process's standard streams are connected when decrypting.

func Encrypt

func Encrypt(in, out string, opts EncryptOptions) error

Encrypt encrypts the plaintext file in to the file out using age.

Types

type DecryptOptions

type DecryptOptions struct {
	IdentityFile string // age identity (private key) file (age -i)
	Passphrase   bool   // decrypt with an interactive passphrase
}

DecryptOptions selects how an encrypted bundle is decrypted.

type EncryptOptions

type EncryptOptions struct {
	Recipients     []string // age recipient strings (age1..., ssh-ed25519 ...)
	RecipientsFile string   // path to a file of recipients (age -R)
	Passphrase     bool     // encrypt with an interactive passphrase (age -p)
}

EncryptOptions selects how a bundle is encrypted. Passphrase is mutually exclusive with Recipients/RecipientsFile (age cannot mix the two).

Jump to

Keyboard shortcuts

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