Encrypts and decrypts files with age: key generation, recipient-based encryption, passphrase files, piping, and SSH-key conversion.
Agentic Workflow: Read -> Reason -> Act (age)
You are Age (api/general) — a sub-agent that Reads, Reasons, and Acts via allowed-tools.
1. Read — api context for age
- Domain: Encrypts and decrypts files with age: key generation, recipient-based encryption, passphrase files, piping, and SSH-key conversion.
- key-management: Generate age keypairs, derive public keys, and convert SSH keys. —
age-keygen -o key.txt
- encrypt-decrypt: Encrypt and decrypt files and streams with recipients or passphrases. —
age -r age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p -o secret.
- Check
knowledge and prerequisites: age, age-keygen, chmod, ssh-to-age
2. Reason — think for age
- For
key-management: Generate age keypairs, derive public keys, and convert SSH keys. — decide which checks to run
- For
encrypt-decrypt: Encrypt and decrypt files and streams with recipients or passphrases. — decide which checks to run
- Evaluate trust/policy:
kdesk trust + kdesk doctor patterns for your inputs
3. Act — execute with age tools
- Tools:
Glob, Grep, Read, Age-keygen, Chmod (see frontmatter tools/allowed-tools)
- Use
safe_path for any write; record evidence (paths, checksums)
- Fingerprint:
age:8ae71784
age
What this skill does
Encrypts and decrypts files with age: key generation, recipient-based encryption, passphrase mode, streaming/pipe usage, and converting SSH keys into age identities.
When to use
- Sealing env files, kubeconfigs, or backups before storing them
- Sharing encrypted files with a team without a KMS
- Reusing existing SSH keys for encryption
Real commands
# Generate a keypair
age-keygen -o key.txt
chmod 600 key.txt
# Encrypt to a recipient
age -r age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p -o secret.age secret.txt
# Decrypt with the identity file
age -d -i key.txt -o secret.txt secret.age
# Passphrase-protected file
age -p -o secret.age secret.txt
# Pipe archives through age
tar czf - ./data | age -r $(cat recipient.txt) > data.tar.gz.age
SSH key conversion
ssh-to-age -private-key -i ~/.ssh/id_ed25519 > key.txt
age-keygen -y -i key.txt # derive the recipient
Testing
- Round-trip: encrypt then decrypt and compare with sha256sum
- Test recipient mode with a freshly generated keypair
Best practices
- Always chmod 600 key files
- Prefer recipient files over pasting long keys in shell history
- Store recipient (public) keys in the repo, identity files outside
Capabilities
key-management
Generate age keypairs, derive public keys, and convert SSH keys.
Parameters:
output (string): Path to write the generated key file
identity (string): Private key file to derive the public key from
Commands:
age-keygen -o key.txt
age-keygen -y -i key.txt
chmod 600 key.txt
ssh-to-age -private-key -i ~/.ssh/id_ed25519 > key.txt
age-keygen -o ~/.config/age/keys.txt
Examples:
- age-keygen -y -i key.txt | tee recipient.txt
- ssh-to-age -private-key -i ~/.ssh/id_ed25519 > age-key.txt
- age-keygen -o key.txt && chmod 600 key.txt
encrypt-decrypt
Encrypt and decrypt files and streams with recipients or passphrases.
Parameters:
recipient (string): age1... recipient public key or --recipients-file
identity (string): Key file to decrypt with (-d -i)
passphrase (boolean): -p uses an interactive passphrase instead of keys
Commands:
age -r age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p -o secret.age secret.txt
age -d -i key.txt -o secret.txt secret.age
age -p -o secret.age secret.txt
age -d secret.age
tar czf - ./data | age -r $(cat recipient.txt) > data.tar.gz.age
Examples:
- age -r age1... -o secret.age secret.txt
- age -d -i key.txt secret.age
- age -p -o kubeconfig.age kubeconfig
References
1---2name: "age"3description: "Encrypts and decrypts files with age: key generation, recipient-based encryption, passphrase files, piping, and SSH-key conversion. Use when working with key management, encrypt decrypt, api or when the user mentions key management, encrypt decrypt, api."4license: "MIT"5compatibility: "Requires age, age-keygen, chmod, ssh-to-age, tar."6metadata:7 source: https://skillmd.com/skills/opknock/age8 author: Kdesk9 version: 2.0.010 category: api11allowed-tools: "Glob Grep Read Bash(age:*) Bash(age-keygen:*) Bash(chmod:*) Bash(ssh-to-age:*) Bash(tar:*)"12---1314Encrypts and decrypts files with age: key generation, recipient-based encryption, passphrase files, piping, and SSH-key conversion.1516## Agentic Workflow: Read -> Reason -> Act (age)1718You are **Age** (api/general) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.1920### 1. Read — api context for `age`21- Domain: Encrypts and decrypts files with age: key generation, recipient-based encryption, passphrase files, piping, and SSH-key conversion.22- **key-management**: Generate age keypairs, derive public keys, and convert SSH keys. — `age-keygen -o key.txt`23- **encrypt-decrypt**: Encrypt and decrypt files and streams with recipients or passphrases. — `age -r age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p -o secret.`24- Check `knowledge` and `prerequisites: age, age-keygen, chmod, ssh-to-age`2526### 2. Reason — think for `age`27- For `key-management`: Generate age keypairs, derive public keys, and convert SSH keys. — decide which checks to run28- For `encrypt-decrypt`: Encrypt and decrypt files and streams with recipients or passphrases. — decide which checks to run29- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs3031### 3. Act — execute with `age` tools32- Tools: `Glob`, `Grep`, `Read`, `Age-keygen`, `Chmod` (see frontmatter `tools`/`allowed-tools`)33- Use `safe_path` for any write; record evidence (paths, checksums)34- Fingerprint: `age:8ae71784`3536# age3738## What this skill does3940Encrypts and decrypts files with age: key generation, recipient-based encryption, passphrase mode, streaming/pipe usage, and converting SSH keys into age identities.4142## When to use4344- Sealing env files, kubeconfigs, or backups before storing them45- Sharing encrypted files with a team without a KMS46- Reusing existing SSH keys for encryption4748## Real commands4950```bash51# Generate a keypair52age-keygen -o key.txt53chmod 600 key.txt5455# Encrypt to a recipient56age -r age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p -o secret.age secret.txt5758# Decrypt with the identity file59age -d -i key.txt -o secret.txt secret.age6061# Passphrase-protected file62age -p -o secret.age secret.txt6364# Pipe archives through age65tar czf - ./data | age -r $(cat recipient.txt) > data.tar.gz.age66```6768## SSH key conversion6970```bash71ssh-to-age -private-key -i ~/.ssh/id_ed25519 > key.txt72age-keygen -y -i key.txt # derive the recipient73```7475## Testing7677- Round-trip: encrypt then decrypt and compare with sha256sum78- Test recipient mode with a freshly generated keypair7980## Best practices8182- Always chmod 600 key files83- Prefer recipient files over pasting long keys in shell history84- Store recipient (public) keys in the repo, identity files outside8586## Capabilities8788### key-management89Generate age keypairs, derive public keys, and convert SSH keys.9091**Parameters:**92- `output` (string): Path to write the generated key file93- `identity` (string): Private key file to derive the public key from9495**Commands:**96- `age-keygen -o key.txt`97- `age-keygen -y -i key.txt`98- `chmod 600 key.txt`99- `ssh-to-age -private-key -i ~/.ssh/id_ed25519 > key.txt`100- `age-keygen -o ~/.config/age/keys.txt`101102**Examples:**103- age-keygen -y -i key.txt | tee recipient.txt104- ssh-to-age -private-key -i ~/.ssh/id_ed25519 > age-key.txt105- age-keygen -o key.txt && chmod 600 key.txt106107### encrypt-decrypt108Encrypt and decrypt files and streams with recipients or passphrases.109110**Parameters:**111- `recipient` (string): age1... recipient public key or --recipients-file112- `identity` (string): Key file to decrypt with (-d -i)113- `passphrase` (boolean): -p uses an interactive passphrase instead of keys114115**Commands:**116- `age -r age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p -o secret.age secret.txt`117- `age -d -i key.txt -o secret.txt secret.age`118- `age -p -o secret.age secret.txt`119- `age -d secret.age`120- `tar czf - ./data | age -r $(cat recipient.txt) > data.tar.gz.age`121122**Examples:**123- age -r age1... -o secret.age secret.txt124- age -d -i key.txt secret.age125- age -p -o kubeconfig.age kubeconfig126127## References128- [age Specification](https://age-encryption.org/v1)129- [age GitHub](https://github.com/FiloSottile/age)130- [ssh-to-age](https://github.com/FiloSottile/age/tree/main/ssh-to-age)