# RSA密码系统

**RSA**（Rivest–Shamir–Adleman）是一种公钥密码系统，其安全性部分依赖于分解两个大秘密素数乘积的困难性。1977年，麻省理工学院的[罗恩·里维斯特](https://www.edgepedia.org/zh/ron-rivest)（Ron Rivest）、阿迪·沙米尔（Adi Shamir）和[伦纳德·阿德尔曼](https://www.edgepedia.org/zh/leonard-adleman)（Leonard Adleman）公开描述了该算法，缩写RSA取自三人姓氏的首字母。<sup>[1](https://ptacts.uspto.gov/ptacts/public-informations/petitions/1458295/download-documents?artifactId=nThh0TKklB-wE5vt-pz5OhIMeg9EJk44neyzg3kYGG78W_aCGdbT2mA)</sup> RSA用于数字签名和密钥建立。2011年，麻省理工学院新闻将其描述为用于绝大多数金融交易和互联网安全通信的密码系统。<sup>[2](https://csrc.nist.gov/glossary/term/RSA)</sup><sup> • </sup><sup>[3](https://news.mit.edu/2011/rivest-unlocks-cryptographys-past-looks-toward-future)</sup>

| 关键事实 | 详情 |
|---|---|
| 起源 | 1977年由麻省理工学院的罗恩·里维斯特、阿迪·沙米尔和伦纳德·阿德尔曼公开描述；麻省理工学院技术报告MIT-LCS-TM-082于1977年4月发行，期刊版发表于《ACM通讯》21(2)，第120–126页，1978年2月<sup>[1](https://ptacts.uspto.gov/ptacts/public-informations/petitions/1458295/download-documents?artifactId=nThh0TKklB-wE5vt-pz5OhIMeg9EJk44neyzg3kYGG78W_aCGdbT2mA)</sup><sup> • </sup><sup>[4](https://dspace.mit.edu/entities/publication/a2e09fea-6f05-48a5-9ce9-5073dfcde567)</sup> |
| 核心运算 | 消息表示为数字M，计算其e次幂（e为公开指数）并对n = p·q取模；解密使用秘密指数d，满足e·d = 1 mod (p−1)(q−1)<sup>[4](https://dspace.mit.edu/entities/publication/a2e09fea-6f05-48a5-9ce9-5073dfcde567)</sup> |
| 密钥 | 公钥为二元组(n, e)；私钥为(n, d)；素数p和q以及指数d保密<sup>[5](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf)</sup> |
| 密钥长度 | FIPS 186-5要求模长为偶数且至少2048比特，p和q各为模长的一半；2048比特满足美国联邦使用的最低112比特安全强度要求<sup>[5](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf)</sup><sup> • </sup><sup>[6](https://nvlpubs.nist.gov/nistpubs/specialpublications/nist.sp.800-131ar2.pdf)</sup> |
| 标准用途 | 在FIPS 186中获批用于数字签名，在NIST SP 800-56B中获批用于密钥建立，包括RSA-OAEP加密<sup>[2](https://csrc.nist.gov/glossary/term/RSA)</sup> |
| 专利 | 美国专利4,405,829，“密码通信系统和方法”，1983年9月20日授予<sup>[1](https://ptacts.uspto.gov/ptacts/public-informations/petitions/1458295/download-documents?artifactId=nThh0TKklB-wE5vt-pz5OhIMeg9EJk44neyzg3kYGG78W_aCGdbT2mA)</sup> |
| 量子前景 | 用于整数分解的Shor算法可以攻破RSA；NIST 2024年过渡草案计划在2030年后弃用量子脆弱算法，并在2035年前移除<sup>[7](https://arxiv.org/abs/quant-ph/0702183)</sup><sup> • </sup><sup>[8](https://nvlpubs.nist.gov/nistpubs/ir/2024/NIST.IR.8547.ipd.pdf)</sup> |

## 工作原理

RSA是一种加密方法，其特性是公开加密密钥不会泄露对应的解密密钥。原论文中描述了由此产生的两个结果：消息可以用预期接收者公开的密钥加密，因此传输密钥无需安全信道；消息可以用私人持有的解密密钥签名，任何人用公钥即可验证。<sup>[4](https://dspace.mit.edu/entities/publication/a2e09fea-6f05-48a5-9ce9-5073dfcde567)</sup>

其算术是模幂运算。消息表示为数字M，计算其e次幂（e为公开指定的指数），并对n取模，n是两个大秘密素数p和q的乘积。解密时计算该结果的d次幂，d是另一个秘密指数，d的选取满足e·d = 1 mod (p−1)(q−1)。系统的安全性部分依赖于分解公开除数n的困难性。<sup>[4](https://dspace.mit.edu/entities/publication/a2e09fea-6f05-48a5-9ce9-5073dfcde567)</sup>

在今天使用的标准化形式中，RSA公钥是二元组(n, e)，用于验证数字签名；私钥是(n, d)，用于生成签名。RSA密钥对的大小通常被认为是模数n的比特长度。允许使用基于中国剩余定理的替代私钥表示。<sup>[5](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf)</sup> RSA签名过程的安全强度不超过模长相关强度与所用散列函数强度中的较小者，因此获批的散列函数必须达到或超过与模数相关的强度。<sup>[5](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf)</sup>

## 标准化与用途

NIST批准RSA用于两种目的：FIPS 186下的数字签名和SP 800-56B下的密钥建立。<sup>[2](https://csrc.nist.gov/glossary/term/RSA)</sup> FIPS 186-5于2023年2月3日发布，规定了RSA签名方案，要求模数的比特长度为偶数且至少2048比特，p和q具有相同的比特长度，即n长度的一半。<sup>[9](https://csrc.nist.gov/pubs/fips/186-5/final)</sup><sup> • </sup><sup>[5](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf)</sup> NIST SP 800-131A Rev. 2为联邦使用设定了相同的下限：模数应为2048比特或以上，以满足112比特的最低安全强度要求；低于此前批准的下限的密钥长度被视为不可接受用于新签名。<sup>[6](https://nvlpubs.nist.gov/nistpubs/specialpublications/nist.sp.800-131ar2.pdf)</sup>

PKCS #1规范，现为RFC 8017（版本2.2），定义了使原始RSA可用的填充方案。对于加密，基于最优非对称加密填充的RSAES-OAEP要求在新应用中支持，而RSAES-PKCS1-v1_5仅出于与现有应用的兼容性而保留。对于签名，RSASSA-PSS在新应用中为必需，RSASSA-PKCS1-v1_5为兼容性而保留。<sup>[10](https://datatracker.ietf.org/doc/rfc8017)</sup> RFC 8017还建议不要在多个方案中使用同一RSA密钥对，因为某一方案实现中的弱点可能危及在另一方案下加密的消息。<sup>[10](https://datatracker.ietf.org/doc/rfc8017)</sup>

## 已知攻击

最著名的RSA实际攻击并不分解模数；它们利用用于加密的PKCS #1 v1.5填充。1998年，贝尔实验室技术人员丹尼尔·布莱肯巴赫（Daniel Bleichenbacher）提出了一种针对PKCS #1 v1.5填充方案的自适应选择密文攻击，利用对有效和无效密文响应不同的服务器作为预言机来解密RSA密文。<sup>[11](https://cryptome.org/jya/rsa-pkcs1.htm)</sup><sup> • </sup><sup>[12](https://www.usenix.org/conference/usenixsecurity18/presentation/bock)</sup> 该攻击针对基于RSA的SSL/TLS会话的扩展在实际中是可行的；在一项研究中，实际测试表明，随机选择的互联网SSL/TLS服务器中有三分之二易受一种变体攻击，该变体利用协议的版本号检查作为侧信道。<sup>[13](https://eprint.iacr.org/2003/052)</sup> 2018年的ROBOT工作重新审视了这一威胁，并建议弃用TLS中的RSA加密密钥交换以及PKCS #1 v1.5标准本身。<sup>[12](https://www.usenix.org/conference/usenixsecurity18/presentation/bock)</sup>

[TLS 1.3](https://www.edgepedia.org/zh/tls-1-3)在协议层面消除了这一暴露：它不使用RSA密钥传输，因此不直接受布莱肯巴赫类攻击的影响，但实现仍需谨慎处理遗留RSA密钥。<sup>[14](https://www.rfc-editor.org/info/rfc8446/)</sup> RSA签名仍用于TLS中的证书认证，RSA-OAEP解密规范要求对手无法通过错误消息或时序区分不同的解密错误条件，以防止增强的布莱肯巴赫和曼格攻击。<sup>[10](https://datatracker.ietf.org/doc/rfc8017)</sup>

## 后量子过渡

用于整数分解的Shor量子算法可以攻破RSA公钥密码系统，而后者广泛用于许多密码应用。<sup>[7](https://arxiv.org/abs/quant-ph/0702183)</sup> 作为回应，NIST于2024年8月发布了其主要后量子密码标准，规定了ML-KEM和ML-DSA等密钥建立和数字签名方案，并于2024年11月发布了NIST IR 8547草案《向后量子密码标准过渡》。<sup>[15](https://csrc.nist.gov/Projects/Post-Quantum-Cryptography?source=post_page---------------------------)</sup><sup> • </sup><sup>[8](https://nvlpubs.nist.gov/nistpubs/ir/2024/NIST.IR.8547.ipd.pdf)</sup> 根据该过渡时间表，NIST将在2035年前从其标准中弃用并最终移除包括RSA在内的量子脆弱算法，高风险系统将更早过渡。<sup>[15](https://csrc.nist.gov/Projects/Post-Quantum-Cryptography?source=post_page---------------------------)</sup><sup> • </sup><sup>[8](https://nvlpubs.nist.gov/nistpubs/ir/2024/NIST.IR.8547.ipd.pdf)</sup>

[RSA Security](https://www.edgepedia.org/zh/rsa-security)总结的草案指南建议至少112比特安全强度（2048比特RSA密钥），目标是在2030年之后达到至少4096比特RSA密钥以实现128比特强度，并且2035年后不得使用任何密钥长度的RSA加密。<sup>[16](https://www.rsa.com/company/rsa-cryptography/)</sup> 量子攻击的资源估计因假设而异：一项研究预测，约102,000量子比特的并行架构可在97天内破解RSA-2048，而11,000至14,000量子比特的系统可在三年内解决。<sup>[17](https://www.livescience.com/technology/quantum/quantum-computers-need-just-10-000-qubits-not-the-millions-we-assumed-to-break-the-worlds-most-secure-encryption-algorithms)</sup> 与椭圆曲线密码的比较一致发现，在可比经典安全级别下，ECC所需的量子比特少于RSA，使ECC成为更容易的量子目标。<sup>[18](https://arxiv.org/abs/1706.06752)</sup>

## 历史

里维斯特、沙米尔和阿德尔曼于1977年在麻省理工学院开发了该算法，麻省理工学院于1983年9月20日获得美国专利4,405,829，涉及使用该算法的密码通信系统。<sup>[1](https://ptacts.uspto.gov/ptacts/public-informations/petitions/1458295/download-documents?artifactId=nThh0TKklB-wE5vt-pz5OhIMeg9EJk44neyzg3kYGG78W_aCGdbT2mA)</sup> 三人于1982年创立了RSA Security。<sup>[19](https://www.rsa.com/de/company/rsa-cryptography/)</sup> 其论文的期刊版以《一种获取数字签名和公钥密码系统的方法》为题发表于《ACM通讯》21(2)，第120–126页，1978年2月；更早的麻省理工学院技术报告MIT-LCS-TM-082于1977年4月发行。<sup>[4](https://dspace.mit.edu/entities/publication/a2e09fea-6f05-48a5-9ce9-5073dfcde567)</sup><sup> • </sup><sup>[20](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-56b.pdf)</sup> 到2011年，麻省理工学院新闻将RSA描述为用于绝大多数金融交易和互联网安全通信的密码系统。<sup>[3](https://news.mit.edu/2011/rivest-unlocks-cryptographys-past-looks-toward-future)</sup>

## References

1. [USPTO petition record: The RSA algorithm was publicly described; Patent 4,405,829](https://ptacts.uspto.gov/ptacts/public-informations/petitions/1458295/download-documents?artifactId=nThh0TKklB-wE5vt-pz5OhIMeg9EJk44neyzg3kYGG78W_aCGdbT2mA)
2. [RSA – Glossary, NIST CSRC](https://csrc.nist.gov/glossary/term/RSA)
3. [Rivest unlocks cryptography's past, looks toward future, MIT News](https://news.mit.edu/2011/rivest-unlocks-cryptographys-past-looks-toward-future)
4. [A Method for Obtaining Digital Signatures and Public-key Cryptosystems, MIT DSpace, MIT-LCS-TM-082, April 1977](https://dspace.mit.edu/entities/publication/a2e09fea-6f05-48a5-9ce9-5073dfcde567)
5. [FIPS 186-5, Digital Signature Standard (DSS), NIST](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf)
6. [NIST SP 800-131A Rev. 2, Transitioning the Use of Cryptographic Algorithms and Key Lengths](https://nvlpubs.nist.gov/nistpubs/specialpublications/nist.sp.800-131ar2.pdf)
7. [Security Notions for Quantum Public-Key Cryptography, arXiv:quant-ph/0702183](https://arxiv.org/abs/quant-ph/0702183)
8. [NIST IR 8547 (initial public draft), Transition to Post-Quantum Cryptography Standards, November 2024](https://nvlpubs.nist.gov/nistpubs/ir/2024/NIST.IR.8547.ipd.pdf)
9. [FIPS 186-5, Digital Signature Standard (DSS), NIST CSRC](https://csrc.nist.gov/pubs/fips/186-5/final)
10. [RFC 8017, PKCS #1: RSA Cryptography Specifications Version 2.2, IETF](https://datatracker.ietf.org/doc/rfc8017)
11. [RSA Laboratories, Analysis of the PKCS #1 attack (Bleichenbacher bulletin)](https://cryptome.org/jya/rsa-pkcs1.htm)
12. [Return Of Bleichenbacher's Oracle Threat (ROBOT), USENIX Security 2018](https://www.usenix.org/conference/usenixsecurity18/presentation/bock)
13. [Attacking RSA-based Sessions in SSL/TLS, Klíma, Pokorný, and Rosa, IACR ePrint 2003/052](https://eprint.iacr.org/2003/052)
14. [RFC 8446, The Transport Layer Security (TLS) Protocol Version 1.3, IETF](https://www.rfc-editor.org/info/rfc8446/)
15. [Post-Quantum Cryptography project, NIST CSRC](https://csrc.nist.gov/Projects/Post-Quantum-Cryptography?source=post_page---------------------------)
16. [RSA Cryptography: From Public Key Origins to Post-Quantum, RSA Security](https://www.rsa.com/company/rsa-cryptography/)
17. [Quantum computers need just 10,000 qubits to break the world's most secure encryption algorithms, Live Science](https://www.livescience.com/technology/quantum/quantum-computers-need-just-10-000-qubits-not-the-millions-we-assumed-to-break-the-worlds-most-secure-encryption-algorithms)
18. [Quantum resource estimates for computing elliptic curve discrete logarithms, arXiv:1706.06752](https://arxiv.org/abs/1706.06752)
19. [RSA-Kryptografie: Von den Anfängen der Public-Key-Kryptografie bis zur Post-Quanten-Kryptografie, RSA Security](https://www.rsa.com/de/company/rsa-cryptography/)
20. [NIST SP 800-56B, Recommendation for Pair-Wise Key Establishment Schemes Using Integer Factorization Cryptography](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-56b.pdf)

---
*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 › Key management

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/rsa-cryptosystem

English original: https://www.edgepedia.org/rsa-cryptosystem
