# OpenPGP

**OpenPGP** 是 IETF 的一项建议标准，定义于 RFC 9580，规定了使用公钥或对称密码算法进行加密、数字签名、压缩以及密钥管理的消息格式。它源自 [菲尔·齐默尔曼](https://www.edgepedia.org/zh/phil-zimmermann)（Phil Zimmermann）的 PGP 应用程序，由 IETF 的“良好隐私开放规范”（OPENPGP）工作组维护，以使各独立实现之间能够交换加密消息、密钥和签名。<sup>[1](https://www.rfc-editor.org/info/rfc9580/)</sup><sup> • </sup><sup>[2](https://datatracker.ietf.org/doc/rfc9580/)</sup>

| 关键事实 | 详情 |
|---|---|
| 现行格式标准 | RFC 9580，2024 年 7 月发布；废止 RFC 4880（OpenPGP 消息格式）、RFC 5581（Camellia 密码）和 RFC 6637（ECC）<sup>[1](https://www.rfc-editor.org/info/rfc9580/)</sup> |
| 编辑与作者 | P. Wouters（Aiven，编辑）、D. Huigens（Proton AG）、J. Winter（Sequoia PGP）、Y. Niibe（FSIJ）<sup>[2](https://datatracker.ietf.org/doc/rfc9580/)</sup> |
| 工作组 | 良好隐私开放规范（OPENPGP），IETF 安全领域；以 draft-ietf-openpgp-crypto-refresh 为草案开发<sup>[2](https://datatracker.ietf.org/doc/rfc9580/)</sup> |
| 后量子扩展 | RFC 9980 增加了与 ECC 结合的复合 ML-KEM 和 ML-DSA，以及独立的 SLH-DSA<sup>[3](https://datatracker.ietf.org/doc/rfc9980/)</sup> |
| 电子邮件集成 | RFC 3156（2001 年 8 月）定义了 MIME 内容类型 application/pgp-encrypted、application/pgp-signature 和 application/pgp-keys<sup>[4](https://datatracker.ietf.org/doc/rfc3156/)</sup> |
| 密钥版本分裂 | 2022 年 9 月的“OpenPGP 分裂”之后，RFC 9580 将若干版本号从 5 递增到 6；GnuPG 实现的是较早的 RFC，仅实现 RFC 9580 的一部分<sup>[5](https://www.openpgp.org/about/gnupg/)</sup> |
| 已知签名缺口 | 签名哈希不包含字面数据包的格式八位组、文件名和日期字段，因此这些字段不受篡改保护<sup>[1](https://www.rfc-editor.org/info/rfc9580/)</sup> |

## 标准的范围

RFC 9580 描述了跨任意网络读取、检查、生成和写入符合规范的包所需的格式与方法。它刻意不是一本应用手册：不涉及存储或实现问题，但讨论了为避免安全缺陷所必需的实现问题。<sup>[1](https://www.rfc-editor.org/info/rfc9580/)</sup> 数据以包的形式承载；例如，字面数据包保存实际消息内容，并附带一个格式八位组、一个文件名和一个四八位组日期。文本数据必须以 UTF-8 编码，并以网络标准化的 \<CR\>\<LF\> 行尾存储。<sup>[1](https://www.rfc-editor.org/info/rfc9580/)</sup>

规范列出了可供实现使用的算法。IANA 的 OpenPGP 公钥算法注册表将 RSA（加密或签名）列为算法 1，其签名和加密机制定义于 RFC 9580 的各节中；该 RFC 的规范性引用包括 EdDSA（RFC 8032）、用于安全性的椭圆曲线（RFC 7748）、AES 密钥封装算法、HKDF，以及用于基于口令的密钥推导的 Argon2 内存硬函数。<sup>[6](https://www.iana.org/assignments/openpgp)</sup><sup> • </sup><sup>[2](https://datatracker.ietf.org/doc/rfc9580/)</sup>

## RFC 的历史

消息格式历经多次修订。RFC 2440 是最早的 OpenPGP 消息格式，于 1998 年 11 月发布；RFC 4880 于 2007 年 11 月取而代之。此后的独立 RFC 分别增加了 Camellia 密码（RFC 5581，2009 年 6 月）和椭圆曲线密码学（RFC 6637，2012 年 6 月）。由工作组产出的“加密刷新”RFC 9580 于 2024 年 7 月将这三者一并废止，从而完成整合。<sup>[2](https://datatracker.ietf.org/doc/rfc9580/)</sup>

**2022 年的分裂。** 2022 年 9 月 6 日，GnuPG 宣布将实现最终成为 RFC 9580 的草案规范的较早版本，而非 OpenPGP 工作组其余成员所商定的版本。为尽量减少对生态系统的损害，RFC 9580 将若干版本号从 5 递增到 6，并更改了其他代码点以避免定义冲突。结果，GnuPG 实现了 RFC 4880、RFC 5581、RFC 6637 以及 Brainpool 和 25519Legacy 曲线，但仅实现现行规范的部分内容。<sup>[5](https://www.openpgp.org/about/gnupg/)</sup>

## 电子邮件及相关标准

OpenPGP 最引人注目的应用是电子邮件。RFC 3156 于 2001 年 8 月发布，更新了 RFC 2015，定义了 OpenPGP 消息格式如何与 MIME 安全多部分配合使用——后者将已签名的正文与签名分离。它定义了三种内容类型：application/pgp-encrypted、application/pgp-signature 和 application/pgp-keys。<sup>[4](https://datatracker.ietf.org/doc/rfc3156/)</sup> 相关 RFC 涵盖将 OpenPGP 密钥用于 TLS 认证（RFC 6091）以及 DNS 中 OpenPGP 的 DANE 绑定（RFC 7929）。<sup>[7](https://www.openpgp.org/about/standard/)</sup> RFC 9787 是 2025 年 8 月发布的端到端电子邮件安全指南，将 PGP/MIME 与 S/MIME 并列视为为电子邮件提供完整性、认证和机密性的一种方式，并警告邮件用户代理必须以防御性方式解释受保护的消息，因为这些保护可被篡改绕过。<sup>[8](https://www.rfc-editor.org/rfc/rfc9787.html)</sup>

**攻击。** 第 27 届 USENIX 安全研讨会（2018 年）上的 Efail 研究利用基于 CBC 和 CFB 加密模式的可塑性攻击组件，将明文片段注入加密电子邮件，并滥用 HTML 图片加载等回传信道来窃取解密内容。在测试的 28 个 OpenPGP 邮件客户端中有 10 个、35 个 S/MIME 客户端中有 23 个存在可用的窃取信道。<sup>[9](https://www.usenix.org/system/files/conference/usenixsecurity18/sec18-poddebniak.pdf)</sup> 2019 年的后续论文《约翰尼，你被解雇了！》演示了电子邮件中 OpenPGP 和 S/MIME 签名的伪造。<sup>[8](https://www.rfc-editor.org/rfc/rfc9787.html)</sup>

## 后量子扩展

RFC 9980 以后量子公钥算法扩展了 RFC 9580，这些算法选自 2016 年启动的 NIST 后量子密码标准化进程。它定义了基于 ML-KEM（原 [CRYSTALS-Kyber](https://www.edgepedia.org/zh/crystals-kyber)）的复合公钥加密和基于 ML-DSA（原 CRYSTALS-Dilithium）的复合签名，两者各自与椭圆曲线密码学结合，另加 SLH-DSA（原 SPHINCS+）作为独立的基于哈希的签名方案。ML-KEM 和 ML-DSA 方案遵循保守的后量子/传统（PQ/T）混合策略，即使组合中除一种之外的所有方案均被攻破，安全性仍得以保留；而 SLH-DSA 被认为已得到充分理解，可以独立使用。<sup>[3](https://datatracker.ietf.org/doc/rfc9980/)</sup> 在过渡期间，实现可以同时向后量子和传统密钥加密，但使用多个 PKESK 的消息除非全部使用 PQ(/T) 方案，否则不具备后量子安全性。<sup>[3](https://datatracker.ietf.org/doc/rfc9980/)</sup>

## 实现

GnuPG 的 gpg 是一个完整的 OpenPGP 实现，提供数字加密、签名和完整的密钥管理；它支持标准的许多可选部分，如 SHA-512 以及 ZLIB 和 BZIP2 压缩，并警告强制使用此类选项可能产生预期接收者无法读取的有效消息。<sup>[10](https://gnupg.org/documentation/manuals/gnupg26/gpg.1.html)</sup> 密钥管理包括主密钥和子密钥、过期日期、存储在 openpgp-revocs.d 目录中的吊销证书、签名子密钥的交叉认证，以及将秘密密钥传输到智能卡或 TPM。<sup>[11](https://gnupg.org/documentation/manuals/gnupg/OpenPGP-Key-Management.html)</sup> GPGME 库在 GnuPG 之上提供高级 API，用于加密、解密、签名、验证和密钥管理。<sup>[12](https://gnupg.org/documentation/manuals/gpgme/Introduction.html)</sup> 现代 OpenPGP 密钥通常至少包含两对密钥，不鼓励将同一对密钥同时用于加密和签名，因为这样一来解密消息就等同于生成签名。<sup>[13](https://gnupg.org/ftp/people/neal/an-advanced-introduction-to-gnupg/openpgp/openpgp.pdf)</sup>

## 可用性记录

可用性研究一再发现密钥管理是主要障碍。2015 年一项针对基于浏览器的 PGP 客户端 Mailvelope 的实验室研究中，十对参与者中只有一对在分配的一小时内完成了加密电子邮件交换，综合[系统可用性量表](https://www.edgepedia.org/zh/system-usability-scale)得分为 34.5，被评为“差”。<sup>[14](https://arxiv.org/abs/1510.08555)</sup> 2022 年的一项研究发现，无法用 PGP 发送加密电子邮件的参与者始终被密钥管理问题所阻碍。<sup>[15](https://cs.ru.nl/bachelors-theses/2022/Niels_Starren___1020246___Johnny_can_Encrypt_-_A_Usability_Study_of_IRMAseal.pdf)</sup> 2021 年的一项领域综述得出结论：封闭式和基于 Web 的系统比 PGP 和 S/MIME 更易用，后者需要附加组件或插件解决方案来实现安全的密钥管理。<sup>[16](https://www.frontiersin.org/journals/big-data/articles/10.3389/fdata.2021.568284/full)</sup>

## References

1. [RFC 9580: OpenPGP, RFC Editor](https://www.rfc-editor.org/info/rfc9580/)
2. [RFC 9580 - OpenPGP, IETF Datatracker](https://datatracker.ietf.org/doc/rfc9580/)
3. [RFC 9980 - Post-Quantum Cryptography in OpenPGP, IETF Datatracker](https://datatracker.ietf.org/doc/rfc9980/)
4. [RFC 3156 - MIME Security with OpenPGP, IETF Datatracker](https://datatracker.ietf.org/doc/rfc3156/)
5. [GnuPG and OpenPGP, openpgp.org](https://www.openpgp.org/about/gnupg/)
6. [OpenPGP parameters, IANA](https://www.iana.org/assignments/openpgp)
7. [Standard - OpenPGP, openpgp.org](https://www.openpgp.org/about/standard/)
8. [RFC 9787: Guidance on End-to-End Email Security, RFC Editor](https://www.rfc-editor.org/rfc/rfc9787.html)
9. [Poddebniak et al. (2018). Efail: Breaking S/MIME and OpenPGP Email Encryption using Exfiltration Channels. USENIX Security 18.](https://www.usenix.org/system/files/conference/usenixsecurity18/sec18-poddebniak.pdf)
10. [GPG(1) manual, GnuPG](https://gnupg.org/documentation/manuals/gnupg26/gpg.1.html)
11. [OpenPGP Key Management, GnuPG manual](https://gnupg.org/documentation/manuals/gnupg/OpenPGP-Key-Management.html)
12. [Introduction, GPGME Reference Manual](https://gnupg.org/documentation/manuals/gpgme/Introduction.html)
13. [An Advanced Introduction to GnuPG, Neal Walfield](https://gnupg.org/ftp/people/neal/an-advanced-introduction-to-gnupg/openpgp/openpgp.pdf)
14. [Ruoti, Andersen, Zappala, Seamons (2015). Why Johnny Still, Still Can't Encrypt. arXiv:1510.08555](https://arxiv.org/abs/1510.08555)
15. [Starren (2022). Johnny can Encrypt: A Usability Study of IRMAseal](https://cs.ru.nl/bachelors-theses/2022/Niels_Starren___1020246___Johnny_can_Encrypt_-_A_Usability_Study_of_IRMAseal.pdf)
16. [Usability of End-to-End Encryption in E-Mail Communication, Frontiers in Big Data (2021)](https://www.frontiersin.org/journals/big-data/articles/10.3389/fdata.2021.568284/full)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 网络与安全 › Security governance and internet policy › Cryptographic protocols › Secure messaging and email protocols

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/openpgp

English original: https://www.edgepedia.org/openpgp
