age — Simple Modern Encryption Tool
age is a simple, modern, and secure file encryption tool. It replaces GPG for everyday encryption with a clean CLI, small explicit keys, no configuration options, and UNIX-style composability. Designed by Filippo Valsorda, a Go security lead.
Agent 可直接安装
这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。
npx -y tokrepo@latest install f8d6637f-3712-11f1-9bc6-00163e2b0d79 --target codex先 dry-run 确认安装计划,再运行此命令。
What it is
age (pronounced 'ah-geh', from Italian) is a modern file encryption tool designed as a simpler replacement for GPG. Created by Filippo Valsorda, formerly the Go security lead at Google, age focuses on doing one thing well: encrypting and decrypting files. There are no key servers, no web of trust, no configuration files, and no surprising defaults.
age targets developers and system administrators who need to encrypt files, secrets, and backups without the complexity of GPG. It is used as the encryption backend by tools like sops and chezmoi.
How it saves time or tokens
age eliminates GPG's configuration overhead entirely. Key generation is a single command that produces a small, readable key file. Encryption and decryption each take one command with obvious flags. The key format is compact (a single line starting with 'age1...') and easy to share via chat or configuration management tools.
How to use
- Install age:
brew install ageon macOS orsudo apt install ageon Debian/Ubuntu. - Generate a key pair:
age-keygen -o key.txt(outputs the public key to stdout). - Encrypt a file:
age -r age1recipient... -o secret.txt.age secret.txt. Decrypt withage -d -i key.txt secret.txt.age.
Example
# Generate a key pair
age-keygen -o key.txt
# Output: public key: age1ql3z7hjy54pw3hyww5ayf...
# Encrypt for a recipient
age -r age1ql3z7hjy54pw3hyww5ayf... -o secret.txt.age secret.txt
# Decrypt with private key
age -d -i key.txt -o secret.txt secret.txt.age
# Encrypt with passphrase (no keys needed)
age -p -o backup.tar.age backup.tar
# Pipe-friendly (UNIX composability)
tar czf - ./secrets | age -r age1... > secrets.tar.gz.age
Related on TokRepo
- AI Tools for Security -- explore security tools for encryption, auditing, and secret management
- AI Tools for DevOps -- discover DevOps workflows that integrate secret encryption
Common pitfalls
- age does not support signing or verification; it only encrypts and decrypts. Use a separate tool like minisign for digital signatures.
- Losing the private key means losing access to encrypted files permanently; back up key.txt securely.
- age encrypts individual files but does not manage encrypted repositories; pair it with sops or git-crypt for repository-level secret management.
常见问题
age is dramatically simpler: no configuration, no key servers, no trust model. GPG supports signing, verification, and key management that age deliberately omits. Use age for file encryption and GPG when you need the full PGP ecosystem.
age uses X25519 for key agreement and ChaCha20-Poly1305 for authenticated encryption. Passphrase mode uses scrypt for key derivation.
Yes. Specify multiple -r flags with different public keys. Each recipient can decrypt the file independently using their own private key.
Yes. age can encrypt to SSH public keys (ed25519 and RSA) using the -R flag, so recipients do not need to generate separate age keys.
The age specification and the Go implementation (filippo.io/age) have received security review. The format was designed by a cryptography expert with a focus on simplicity to minimize attack surface.
引用来源 (3)
- age GitHub— age is a simple modern encryption tool designed by Filippo Valsorda
- age Spec— age specification and format design
- RFC 7748— X25519 key agreement and ChaCha20-Poly1305 AEAD
讨论
相关资产
Task — Fast Cross-Platform Build Tool for Modern Workflows
Task is a task runner and build tool written in Go. It uses simple YAML configuration as a modern, cross-platform alternative to Make — with better syntax, built-in variables, watch mode, and no platform-specific quirks.
Motion (Framer Motion) — Modern Animation Library for React & JS
Motion (formerly Framer Motion) is a modern animation library for React and JavaScript with a simple declarative API. Hardware-accelerated transforms, gestures, layout animations, and SVG morphing — all in a tiny package.
sops — Simple and Flexible Secrets Management
sops (Secrets OPerationS) encrypts values in YAML, JSON, ENV, and INI files while keeping keys in plaintext. This lets you version-control encrypted secrets in Git, using age, AWS KMS, GCP KMS, Azure Key Vault, or PGP as encryption backends.
Ghost — Professional Publishing Platform for Modern Journalism
Ghost is an open-source publishing platform built for professional publishers. It bundles a blazing-fast Node.js CMS, Substack-style paid memberships, email newsletters, and SEO — everything a modern publication needs, self-hosted.