agecrypt

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package agecrypt is lore's encryption boundary for portable artifacts: it wraps a whole serialized artifact byte stream in an age envelope (and reverses it), so the exported file is encrypted at rest and in transit. It deliberately does nothing clever — age (filippo.io/age) owns the header, nonce, KDF, and AEAD framing, and the artifacts it writes are ordinary age files decryptable by the standalone `age` tool. The whole stream is encrypted, vectors included (vectors are invertible to approximate plaintext, so encrypting text but not vectors would leak the corpus).

Index

Constants

This section is empty.

Variables

View Source
var ErrDecrypt = errors.New("could not decrypt")

ErrDecrypt means the artifact could not be decrypted: a wrong passphrase, an identity matching no recipient, or a tampered/corrupt ciphertext. age's AEAD makes these indistinguishable by design — all mean "you do not have the key, or the bytes changed" — so they share one sentinel the CLI maps to exit 1.

Functions

func DecryptIdentities

func DecryptIdentities(ciphertext, identityFile []byte) ([]byte, error)

DecryptIdentities decrypts using the identities parsed from an age identity file's contents; a non-matching identity or tampered ciphertext is ErrDecrypt.

func DecryptPassphrase

func DecryptPassphrase(ciphertext []byte, passphrase string) ([]byte, error)

DecryptPassphrase decrypts an age passphrase stream; a wrong passphrase or tampered ciphertext is ErrDecrypt.

func EncryptPassphrase

func EncryptPassphrase(plaintext []byte, passphrase string) ([]byte, error)

EncryptPassphrase wraps plaintext in an age passphrase (scrypt) stream.

func EncryptRecipients

func EncryptRecipients(plaintext []byte, recipients []string) ([]byte, error)

EncryptRecipients wraps plaintext encrypted to the given age recipients (age1... X25519 public keys); any can later decrypt with their identity.

func IsEncrypted

func IsEncrypted(data []byte) bool

IsEncrypted reports whether data looks like an age stream (binary or armored), so import detects encryption from the artifact itself.

Types

This section is empty.

Jump to

Keyboard shortcuts

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