Files
tldr/pages.zh/common/age.md
2022-10-08 19:30:46 +05:30

29 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# age
> 一个简单、现代、安全的文件加密工具。
> 更多信息:<https://age-encryption.org>.
- 生成一个可以用密码短语passphrase解密的加密文件
`age --passphrase --output {{路径/到/已加密文件}} {{路径/到/未加密文件}}`
- 生成一个密钥对,将私钥保存到一个未加密的文件,并将公钥打印到标准输出:
`age-keygen --output {{路径/到/文件}}`
- 用一个或多个公钥加密一个文件,这些公钥以字面形式输入:
`age --recipient {{公钥_1}} --recipient {{公钥_2}} {{路径/到/未加密文件}} --output {{路径/到/已加密文件}}`
- 用收件人文件中指定的一个或多个公钥来加密一个文件:
`age --recipients-file {{路径/到/收件人文件}} {{路径/到/未加密文件}} --output {{路径/到/已加密文件}}`
- 用密码短语解密一个文件:
`age --decrypt --output {{路径/到/已解密文件}} {{路径/到/已加密文件}}`
- 用私钥文件解密一个文件:
`age --decrypt --identity {{路径/到/私钥文件}} --output {{路径/到/已解密文件}} {{路径/到/已加密文件}}`