
シンプルでモダンかつ安全な暗号化ツール(およびGoライブラリ)。小さな明示的な鍵を使用し、設定オプションはなく、UNIXスタイルのコンポーザビリティを備えています。
ageは、シンプルでモダンかつ安全なファイル暗号化ツール、フォーマット、そしてGoライブラリです。
小さく明示的な鍵、耐量子コンピュータ対応、設定オプションなし、UNIXスタイルのコンポーザビリティを特徴としています。
$ age-keygen -o key.txt
Public key: age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p
$ tar cvz ~/data | age -r age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p > data.tar.gz.age
$ age --decrypt -i key.txt data.tar.gz.age > data.tar.gz
📜 フォーマット仕様は age-encryption.org/v1 にあります。ageは @benjojo と @FiloSottile によって設計されました。
🦀 相互運用可能な代替Rust実装は github.com/str4d/rage にあります。
🌍 Typage はTypeScript実装です。ブラウザ、Node.js、Deno、Bunで動作します。
🔑 YubiKeyなどのハードウェアPIVトークンは、age-plugin-yubikey プラグインを通じてサポートされています。
✨ その他のプラグイン、実装、ツール、統合については、awesome age リストをチェックしてください。
💬 作者はこれを [aɡe̞] と発音し、硬い g でGIFのように発音します。また、常に小文字で表記されます。
Windows、Linux、macOS、FreeBSDでは、ビルド済みバイナリを使用できます。
ビルド済みバイナリをダウンロードした場合、そのSigsum証明を確認できます。
お使いのシステムにサポートされているバージョンのGoがある場合、ソースからビルドできます。
go install filippo.io/age/cmd/...@latest
新しいパッケージャーからの支援を歓迎します。
完全なドキュメントについては、age(1) manページをお読みください。
Usage:
age [--encrypt] (-r RECIPIENT | -R PATH)... [--armor] [-o OUTPUT] [INPUT]
age [--encrypt] --passphrase [--armor] [-o OUTPUT] [INPUT]
age --decrypt [-i PATH]... [-o OUTPUT] [INPUT]
Options:
-e, --encrypt Encrypt the input to the output. Default if omitted.
-d, --decrypt Decrypt the input to the output.
-o, --output OUTPUT Write the result to the file at path OUTPUT.
-a, --armor Encrypt to a PEM encoded format.
-p, --passphrase Encrypt with a passphrase.
-r, --recipient RECIPIENT Encrypt to the specified RECIPIENT. Can be repeated.
-R, --recipients-file PATH Encrypt to recipients listed at PATH. Can be repeated.
-i, --identity PATH Use the identity file at PATH. Can be repeated.
--version Print the version.
INPUT defaults to standard input, and OUTPUT defaults to standard output.
If OUTPUT exists, it will be overwritten.
RECIPIENT can be an age public key generated by age-keygen ("age1...")
or an SSH public key ("ssh-ed25519 AAAA...", "ssh-rsa AAAA...").
Recipient files contain one or more recipients, one per line. Empty lines
and lines starting with "#" are ignored as comments. "-" may be used to
read recipients from standard input.
Identity files contain one or more secret keys ("AGE-SECRET-KEY-1..."),
one per line, or an SSH key. Empty lines and lines starting with "#" are
ignored as comments. Passphrase encrypted age files can be used as
identity files. Multiple key files can be provided, and any unused ones
will be ignored. "-" may be used to read identities from standard input.
When --encrypt is specified explicitly, -i can also be used to encrypt to an
identity file symmetrically, instead or in addition to normal recipients.
-r/--recipient を繰り返すことで、ファイルを複数の受信者に対して暗号化できます。すべての受信者がファイルを復号化できます。
$ age -o example.jpg.age -r age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p \
-r age1lggyhqrw2nlhcxprm67z43rta597azn8gknawjehu9d9dl0jq3yqqvfafg example.jpg
複数の受信者は、-R/--recipients-file フラグで渡される1つ以上のファイルに1行につき1つずつリストすることもできます。
$ cat recipients.txt
# Alice
age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p
# Bob
age1lggyhqrw2nlhcxprm67z43rta597azn8gknawjehu9d9dl0jq3yqqvfafg
$ age -R recipients.txt example.jpg > example.jpg.age
-R(または -i)の引数が - の場合、ファイルは標準入力から読み込まれます。
将来の量子コンピュータ攻撃に対して安全なハイブリッド耐量子コンピュータ鍵を生成するには、age-keygen で -pq フラグを使用します。これは将来デフォルトになる可能性があります。
耐量子コンピュータIDは AGE-SECRET-KEY-PQ-1... で始まり、受信者は age1pq1... で始まります。受信者は残念ながら約2000文字の長さです。
$ age-keygen -pq -o key.txt
$ age-keygen -y key.txt > recipient.txt
$ age -R recipient.txt example.jpg > example.jpg.age
$ age -d -i key.txt example.jpg.age > example.jpg
耐量子コンピュータ鍵のサポートはage v1.3.0以降に組み込まれています。あるいは、age-plugin-pq バイナリをインストールして $PATH に配置することで、プラグインをサポートする任意のバージョンおよび実装のageにサポートを追加できます。受信者はそのまま動作しますが、IDは age-plugin-pq -identity でプラグインIDに変換する必要があります。
-p/--passphrase を使用することで、ファイルをパスフレーズで暗号化できます。デフォルトでは、ageは安全なパスフレーズを自動生成します。パスフレーズで保護されたファイルは、復号化時に自動的に検出されます。
$ age -p secrets.txt > secrets.txt.age
Enter passphrase (leave empty to autogenerate a secure one):
Using the autogenerated passphrase "release-response-step-brand-wrap-ankle-pair-unusual-sword-train".
$ age -d secrets.txt.age > secrets.txt
Enter passphrase:
-i に渡されるIDファイルがパスフレーズで暗号化されたageファイルの場合、自動的に復号化されます。
$ age-keygen | age -p > key.age
Public key: age1yhm4gctwfmrpz87tdslm550wrx6m79y9f2hdzt0lndjnehwj0ukqrjpyx5
Enter passphrase (leave empty to autogenerate a secure one):
Using the autogenerated passphrase "hip-roast-boring-snake-mention-east-wasp-honey-input-actress".
$ age -r age1yhm4gctwfmrpz87tdslm550wrx6m79y9f2hdzt0lndjnehwj0ukqrjpyx5 secrets.txt > secrets.txt.age
$ age -d -i key.age secrets.txt.age > secrets.txt
Enter passphrase for identity file "key.age":
パスフレーズで保護されたIDファイルは、暗号化されたIDファイルへのアクセスがシステム全体へのアクセスを意味するほとんどのユースケースでは必要ありません。ただし、IDファイルがリモートに保存されている場合には有用です。
利便性の機能として、ageは ssh-rsa および ssh-ed25519 SSH公開鍵への暗号化と、対応する秘密鍵ファイルでの復号化もサポートしています。(ssh-agent はサポートされていません。)
$ age -R ~/.ssh/id_ed25519.pub example.jpg > example.jpg.age
$ age -d -i ~/.ssh/id_ed25519 example.jpg.age > example.jpg
SSH鍵サポートはより複雑な暗号化を採用しており、暗号化ファイルに公開鍵タグを埋め込むため、特定の公開鍵に暗号化されたファイルを追跡することが可能になります。
SSH鍵サポートと -R を組み合わせることで、GitHubプロフィールにリストされているSSH鍵に対してファイルを簡単に暗号化できます。
$ curl https://github.com/benjojo.keys | age -R - example.jpg > example.jpg.age
SSH鍵は認証専用に使用される場合は失効可能であるため、長期的に保護されていない可能性があること、またYubiKeyに保持されているSSH鍵はファイルの復号化に使用できないことに注意してください。
age-inspect コマンドは、暗号化ファイルを復号化せずに、受信者タイプ、耐量子コンピュータ暗号化を使用しているかどうか、ペイロードサイズなどのメタデータを表示できます。
$ age-inspect secrets.age
secrets.age is an age file, version "age-encryption.org/v1".
This file is encrypted to the following recipient types:
- "mlkem768x25519"
This file uses post-quantum encryption.
Size breakdown (assuming it decrypts successfully):
Header 1627 bytes
Encryption overhead 32 bytes
Payload 42 bytes
-------------------
Total 1701 bytes
Tip: for machine-readable output, use --json.
| Homebrew (macOS または Linux) |
brew install age
|
| MacPorts |
port install age
|
| Windows |
winget install --id FiloSottile.age
|
| Alpine Linux v3.15+ |
apk add age
|
| Arch Linux |
pacman -S age
|
| Debian 12+ (Bookworm) |
apt install age
|
| Debian 11 (Bullseye) |
apt install age/bullseye-backports
(バックポートを有効化 age v1.0.0+ の場合)
|
| Fedora 33+ |
dnf install age
|
| Gentoo Linux |
emerge app-crypt/age
|
| Guix System |
guix package -i age
|
| NixOS / Nix |
nix-env -i age
|
| openSUSE Tumbleweed |
zypper install age
|
| Ubuntu 22.04+ |
apt install age
|
| Void Linux |
xbps-install age
|
| FreeBSD |
pkg install age (security/age)
|
| OpenBSD 6.7+ |
pkg_add age (security/age)
|
| Chocolatey (Windows) |
choco install age.portable
|
| Scoop (Windows) |
scoop bucket add extras && scoop install age
|