# 公钥密码学

**公钥密码学**（也称非对称密码学）是一类密码系统：每个用户持有两把在数学上相互关联的密钥——一把可自由分发的公钥，一把须严格保密的私钥，其性质是：由公钥推导出私钥在计算上不可行。<sup>[1](https://csrc.nist.gov/glossary/term/public_key_cryptography)</sup> 它使从未事先共享过秘密的双方也能安全通信，是数字签名、密钥建立以及用于保护网络流量的公钥基础设施（PKI）的基础。<sup>[1](https://csrc.nist.gov/glossary/term/public_key_cryptography)</sup><sup> • </sup><sup>[2](https://nvlpubs.nist.gov/nistpubs/legacy/sp/nistspecialpublication800-32.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 核心性质 | 每个用户两把相关联的密钥；已知公钥，推导私钥在计算上不可行<sup>[1](https://csrc.nist.gov/glossary/term/public_key_cryptography)</sup> |
| 主要操作 | 数字签名（用私钥签名、用公钥验证）、密钥传输、密钥协商<sup>[2](https://nvlpubs.nist.gov/nistpubs/legacy/sp/nistspecialpublication800-32.pdf)</sup> |
| 首次公开发表 | 惠特菲尔德·迪菲（Whitfield Diffie）与马丁·赫尔曼（Martin Hellman）的《密码学的新方向》，1976年11月<sup>[3](https://computerhistory.org/profile/whitfield-diffie/)</sup> |
| 更早的秘密发现 | 英国政府通信总部（GCHQ）的詹姆斯·埃利斯（James Ellis）、克利福德·科克斯（Clifford Cocks）与马尔科姆·威廉森（Malcolm Williamson）于1970年代初发现了公钥技术；GCHQ于1997年公开此事<sup>[4](https://www.gchq.gov.uk/person/james-ellis)</sup><sup> • </sup><sup>[5](https://www.nsa.gov/History/Cryptologic-History/Historical-Figures/Historical-Figures-View/Article/3006218/clifford-cocks-james-ellis-and-malcolm-williamson/)</sup> |
| 量子威胁 | 肖尔算法（Shor's algorithm）可在多项式时间内分解整数并求解离散对数，从而攻破RSA、Diffie-Hellman与椭圆曲线方案<sup>[6](https://csrc.nist.gov/CSRC/media/Presentations/NIST-Cryptography-Transition-Update/images-media/Transition02132018%20-%20L%20Chen.pdf)</sup> |
| 后量子标准 | FIPS 203（ML-KEM）、FIPS 204（ML-DSA）与FIPS 205（SLH-DSA），2024年8月发布<sup>[7](https://csrc.nist.gov/projects/post-quantum-cryptography?nt=1)</sup> |
| 迁移期限 | NIST计划到2030年弃用量子脆弱算法，到2035年将其从标准中移除<sup>[7](https://csrc.nist.gov/projects/post-quantum-cryptography?nt=1)</sup> |

## 工作原理

公钥系统同时生成公钥与私钥；用于加密时，用公钥加密的数据由对应的私钥解密。<sup>[23](https://developer.mozilla.org/en-US/docs/Glossary/Public-key_cryptography)</sup> 任何人都可以用接收者的公钥加密消息，而只有持匹配私钥的人才能读出它。<sup>[2](https://nvlpubs.nist.gov/nistpubs/legacy/sp/nistspecialpublication800-32.pdf)</sup> 其安全性依赖于一些数学问题，例如RSA所依赖的整数分解，或Diffie-Hellman与椭圆曲线系统所依赖的离散对数问题——这些问题被认为对常规计算机而言是困难的。<sup>[8](https://csrc.nist.gov/pubs/ir/8105/final)</sup>

**数字签名。** 签名者计算消息摘要并用私钥对其签名；任何持有公钥的人都能验证该签名。由于改动数据会改变摘要、从而改变签名，数字签名同时也验证了数据的完整性，在某些情形下还能确立不可否认性，即签名者无法否认自己曾经签名。<sup>[2](https://nvlpubs.nist.gov/nistpubs/legacy/sp/nistspecialpublication800-32.pdf)</sup> NIST 将数字签名描述为提供真实性、完整性与不可否认性支持，但不提供机密性。<sup>[9](https://pages.nist.gov/800-63-4/sp800-63b.html)</sup>

**密钥建立。** 非对称算法不太适合加密大段消息，因为速度相对较慢，所以实践中它们只用来保护对称密钥这类小载荷。在密钥传输中，发送方生成一把对称密钥（例如AES密钥），用它加密消息，再用接收者的公钥加密这把密钥本身。在密钥协商中，例如Diffie-Hellman，双方各自用自己的私钥和对方的公钥计算出同一个秘密值，而同时掌握两把公钥的旁观者无法算出它。<sup>[2](https://nvlpubs.nist.gov/nistpubs/legacy/sp/nistspecialpublication800-32.pdf)</sup>

## 历史

这一构想于1976年11月公开问世：[惠特菲尔德·迪菲](https://www.edgepedia.org/zh/whitfield-diffie)与马丁·E·赫尔曼（Martin E. Hellman）——[拉尔夫·默克尔](https://www.edgepedia.org/zh/ralph-merkle)（Ralph Merkle）当年也参与了相关工作——在《IEEE信息论汇刊》（*IEEE Transactions on Information Theory*）上发表了《密码学的新方向》。<sup>[10](https://cr.yp.to/bib/1976/diffie.pdf)</sup> 该文提出了公钥密码系统的构想：由E和D两把不同的密钥分别控制加密与解密，且由E推导D在计算上不可行。<sup>[3](https://computerhistory.org/profile/whitfield-diffie/)</sup><sup> • </sup><sup>[10](https://cr.yp.to/bib/1976/diffie.pdf)</sup> 麻省理工学院（MIT）的[罗恩·里维斯特](https://www.edgepedia.org/zh/ron-rivest)（Ron Rivest）、阿迪·沙米尔（Adi Shamir）与伦·阿德尔曼（Len Adleman）随后于1977年4月提出了RSA算法。<sup>[11](https://www.cs.cornell.edu/courses/cs513/2000SP/L26.html)</sup>

与此并行，英国信号情报机构GCHQ也秘密地做出了发现。1952年加入GCHQ的詹姆斯·埃利斯在读到贝尔实验室（Bell Laboratories）战时一篇关于保护语音通信的论文后，构想出“非秘密加密”。他与克利福德·科克斯合作，发展出了后来被称为RSA的非对称加密算法，马尔科姆·威廉森则推导出一种密钥交换过程。1973年的这项发现一直属于机密，起初只可用于政府官方通信；GCHQ于1997年公开了这一成就，时在埃利斯于1997年11月25日去世一个月之后。<sup>[4](https://www.gchq.gov.uk/person/james-ellis)</sup> 美国国家安全局（NSA）的历史记述称，埃利斯、科克斯与威廉森的协作使公钥密码学在1970年代初被发明出来，而GCHQ直到1997年才公开他们曾“抢先”于外部研究者的事实。<sup>[5](https://www.nsa.gov/History/Cryptologic-History/Historical-Figures/Historical-Figures-View/Article/3006218/clifford-cocks-james-ellis-and-malcolm-williamson/)</sup>

## 标准化与部署

NIST在SP 800-56B Rev. 2中规定了用于整数分解密码学（主要是RSA）的密钥建立方案，在SP 800-56A中规定了用于离散对数与椭圆曲线密码学的方案，涵盖Diffie-Hellman与Menezes-Qu-Vanstone（MQV）方案。<sup>[12](https://csrc.nist.gov/pubs/sp/800/56/b/r2/final)</sup><sup> • </sup><sup>[13](https://csrc.nist.gov/nist-cyber-history/cryptography/chapter)</sup> RSA在FIPS 186中被批准用于数字签名，在SP 800-56B中被批准用于密钥建立。<sup>[14](https://csrc.nist.gov/glossary/term/RSA)</sup> 对于TLS证书，NIST指南目前要求RSA密钥至少2,048位、ECDSA密钥至少224位，并使用经批准的算法与哈希函数（如SHA-256）签名。<sup>[15](https://www.nccoe.nist.gov/publication/1800-16/VolB/index.html)</sup>

证书通过认证机构的数字签名，把公钥与持有者的身份绑定，提供让各实体相互认证的信任层，从而缓解冒充与中间人攻击。<sup>[16](https://www.mdpi.com/2410-387X/10/1/11)</sup> 由于签发证书的认证机构已成为攻击目标，一旦它们被攻破，就可能导致伪造证书的签发与伪造签名。<sup>[17](https://www.nist.gov/publications/preparing-and-responding-ca-compromise-and-fraudulent-certificate-issuance)</sup>

## 量子的过渡

[肖尔算法](https://www.edgepedia.org/zh/shors-algorithm)在足够大的量子计算机上运行，可在多项式时间内分解整数并求解离散对数问题，从而攻破自1980年代以来部署的RSA、Diffie-Hellman与椭圆曲线系统。<sup>[6](https://csrc.nist.gov/CSRC/media/Presentations/NIST-Cryptography-Transition-Update/images-media/Transition02132018%20-%20L%20Chen.pdf)</sup> NIST于2016年12月启动公开标准化流程以遴选抗量子公钥算法，并于2024年8月发布其主要后量子标准：[FIPS 203](https://www.edgepedia.org/zh/fips-203)（ML-KEM，一种密钥封装机制）、[FIPS 204](https://www.edgepedia.org/zh/fips-204)（ML-DSA，一项数字签名标准）与FIPS 205（SLH-DSA，一项无状态基于哈希的签名标准）。<sup>[7](https://csrc.nist.gov/projects/post-quantum-cryptography?nt=1)</sup><sup> • </sup><sup>[18](https://csrc.nist.gov/projects/pqc-dig-sig)</sup> 按照NIST IR 8547中的过渡计划，量子脆弱算法将被弃用，并最终在2035年前从NIST标准中移除，高风险系统则更早迁移。<sup>[7](https://csrc.nist.gov/projects/post-quantum-cryptography?nt=1)</sup> 2025年3月，NIST选定基于编码的HQC密钥封装机制，作为第四轮中唯一将被标准化的密钥建立算法，以补充基于格的ML-KEM。<sup>[19](https://csrc.nist.gov/pubs/ir/8545/final)</sup>

**两场迁移的部署进度并不均衡。** 把经典X25519与ML-KEM结合的混合后量子密钥协商，已在主流浏览器与内容分发网络中运行了一年多，Cloudflare报告称，到2026年，其网络上超过65%的人类用户流量已采用后量子加密。<sup>[20](https://www.techradar.com/pro/the-fixes-are-architectural-not-bigger-pipes-openssl-president-on-what-businesses-can-expect-and-how-to-prepare-for-a-post-quantum-internet)</sup><sup> • </sup><sup>[21](https://blog.cloudflare.com/post-quantum-roadmap/)</sup> 签名仍是难啃的一块：ML-DSA-44产生的签名有2,420字节，公钥有1,312字节，而ECDSA P-256只需64字节；若不加思索地换用后量子证书，每条新建TLS连接会膨胀约7至10 KB，足以把握手推过拥塞窗口与抗放大阈值。<sup>[20](https://www.techradar.com/pro/the-fixes-are-architectural-not-bigger-pipes-openssl-president-on-what-businesses-can-expect-and-how-to-prepare-for-a-post-quantum-internet)</sup> 谷歌（Google）与[Cloudflare](https://www.edgepedia.org/zh/cloudflare)正在测试默克尔树证书（Merkle Tree Certificates），用防篡改日志中的简短证明取代笨重的逐证书签名，以使后量子认证保持实用。<sup>[22](https://www.techradar.com/pro/googles-pqc-roadmap-puts-traditional-digital-certificates-under-pressure)</sup> 谷歌已将自身的迁移期限提前到2029年，比NIST的指南早六年。<sup>[22](https://www.techradar.com/pro/googles-pqc-roadmap-puts-traditional-digital-certificates-under-pressure)</sup>

## References

1. [Public key cryptography (PKC), NIST CSRC Glossary](https://csrc.nist.gov/glossary/term/public_key_cryptography)
2. [Introduction to public key technology and the federal PKI infrastructure, NIST SP 800-32](https://nvlpubs.nist.gov/nistpubs/legacy/sp/nistspecialpublication800-32.pdf)
3. [Whitfield Diffie, Computer History Museum Fellow profile](https://computerhistory.org/profile/whitfield-diffie/)
4. [James Ellis, GCHQ](https://www.gchq.gov.uk/person/james-ellis)
5. [Clifford Cocks, James Ellis, and Malcolm Williamson, NSA Historical Figures](https://www.nsa.gov/History/Cryptologic-History/Historical-Figures/Historical-Figures-View/Article/3006218/clifford-cocks-james-ellis-and-malcolm-williamson/)
6. [Transition to Post-Quantum Cryptography, NIST presentation (L. Chen)](https://csrc.nist.gov/CSRC/media/Presentations/NIST-Cryptography-Transition-Update/images-media/Transition02132018%20-%20L%20Chen.pdf)
7. [Post-Quantum Cryptography, NIST CSRC](https://csrc.nist.gov/projects/post-quantum-cryptography?nt=1)
8. [Report on Post-Quantum Cryptography, NIST IR 8105](https://csrc.nist.gov/pubs/ir/8105/final)
9. [NIST SP 800-63B](https://pages.nist.gov/800-63-4/sp800-63b.html)
10. [New Directions in Cryptography (1976), Diffie and Hellman](https://cr.yp.to/bib/1976/diffie.pdf)
11. [CS 513 System Security: Public Key Cryptography, Cornell](https://www.cs.cornell.edu/courses/cs513/2000SP/L26.html)
12. [SP 800-56B Rev. 2, Recommendation for Pair-Wise Key-Establishment Using Integer Factorization Cryptography, NIST CSRC](https://csrc.nist.gov/pubs/sp/800/56/b/r2/final)
13. [Cryptography, NIST Cyber History, CSRC](https://csrc.nist.gov/nist-cyber-history/cryptography/chapter)
14. [RSA, NIST CSRC Glossary](https://csrc.nist.gov/glossary/term/RSA)
15. [NIST SP 1800-16 Vol. B, Securing Web Transactions: TLS Server Certificate Management](https://www.nccoe.nist.gov/publication/1800-16/VolB/index.html)
16. [Post-Quantum PKI: A Survey of Applications and Benchmarking Practices, MDPI Cryptography](https://www.mdpi.com/2410-387X/10/1/11)
17. [Preparing for and Responding to CA Compromise and Fraudulent Certificate Issuance, NIST](https://www.nist.gov/publications/preparing-and-responding-ca-compromise-and-fraudulent-certificate-issuance)
18. [Post-Quantum Cryptography: Additional Digital Signature Schemes, NIST CSRC](https://csrc.nist.gov/projects/pqc-dig-sig)
19. [IR 8545, Status Report on the Fourth Round of the NIST Post-Quantum Cryptography Standardization Process, NIST CSRC](https://csrc.nist.gov/pubs/ir/8545/final)
20. [OpenSSL on how to prepare for a post-quantum internet, TechRadar](https://www.techradar.com/pro/the-fixes-are-architectural-not-bigger-pipes-openssl-president-on-what-businesses-can-expect-and-how-to-prepare-for-a-post-quantum-internet)
21. [Cloudflare targets 2029 for full post-quantum security, Cloudflare Blog](https://blog.cloudflare.com/post-quantum-roadmap/)
22. [Google's PQC roadmap puts traditional digital certificates under pressure, TechRadar](https://www.techradar.com/pro/googles-pqc-roadmap-puts-traditional-digital-certificates-under-pressure)
23. [Public-key cryptography - Glossary, MDN](https://developer.mozilla.org/en-US/docs/Glossary/Public-key_cryptography)

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

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

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/public-key-cryptography

English original: https://www.edgepedia.org/public-key-cryptography
