# 离散对数

离散对数是满足有限群 G 中 \( g^{x} = h \) 的指数 x，其中 G 由元素 g 生成；离散对数问题就是从 g 和 h 恢复出 x。这个名称来自与普通对数的类比，因为离散指数运算服从 \( g^{x+y} = g^{x} \cdot g^{y} \)，但量 x 存在于有限循环群中而非实数中。当 g 不生成整个群时，只有 g 所生成子群的元素才存在解，且解在模 g 的阶的意义下唯一。<sup>[1](https://www-users.cse.umn.edu/~odlyzko/doc/discretelogs2014.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 定义 | 给定循环群 G 的生成元 g 和元素 h，求满足 \( g^{x} = h \) 的 x；x 在模 ord(g) 的意义下唯一<sup>[1](https://www-users.cse.umn.edu/~odlyzko/doc/discretelogs2014.pdf)</sup> |
| 密码学角色 | 1976 年迪菲-赫尔曼密钥交换以及大量后续公钥系统和协议的安全假设<sup>[1](https://www-users.cse.umn.edu/~odlyzko/doc/discretelogs2014.pdf)</sup> |
| 通用算法 | 小步-大步法需要 \( O(\sqrt{q} \cdot \mathrm{polylog}(q)) \) 时间和 \( O(\sqrt{q}) \) 内存；波拉德ρ算法以常数内存达到 \( O(\sqrt{q}) \) 时间，其中群的阶为 q<sup>[5](https://www.cl.cam.ac.uk/teaching/2223/Crypto/crypto-slides-2up.pdf)</sup> |
| 有限域 | 指标演算和数域筛法给出亚指数 \( L \)-记号算法，因此有限域参数必须足够大（经典安全性需 1024 比特或更多）<sup>[6](https://www.cs.umd.edu/~waa/414-F11/IntroToCrypto.pdf)</sup> |
| 椭圆曲线 | 对于一般椭圆曲线群，未知有任何亚指数算法；并行波拉德ρ算法是最好的实用通用攻击<sup>[6](https://www.cs.umd.edu/~waa/414-F11/IntroToCrypto.pdf)</sup> |
| 量子威胁 | 肖尔 1994 年的算法在量子计算机上以多项式时间求解离散对数，步数为输入规模的多项式<sup>[2](https://arxiv.org/abs/quant-ph/9508027)</sup> |
| 计算记录 | 2019 年计算了一个 795 比特素域离散对数，同时完成了 RSA-240 的因数分解；\( \mathbb{F}_{2^{30750}} \) 中的记录打破了 2014 年 \( \mathbb{F}_{2^{9234}} \) 的记录<sup>[7](https://arxiv.org/abs/2006.06197)</sup><sup> • </sup><sup>[8](https://arxiv.org/abs/2008.02717)</sup> |
| 标准化 | NIST SP 800-186（2023 年 2 月）规定了美国政府推荐使用的椭圆曲线；NIST 计划到 2035 年从其标准中弃用易受量子攻击的算法<sup>[3](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-186.pdf)</sup><sup> • </sup><sup>[10](https://www.nist.gov/news-events/news/2024/08/nist-releases-first-3-finalized-post-quantum-encryption-standards)</sup> |

## 在密码学中的角色

第一个实用的公钥密码系统——惠特菲尔德·迪菲（Whitfield Diffie）和马丁·E·赫尔曼（Martin E. Hellman）于 1976 年在《IEEE 信息论汇刊》上发表的迪菲-赫尔曼密钥交换——其安全性依赖于离散对数难以计算这一假设。这一难解性假设也是大量后续公钥系统和协议的基础。<sup>[1](https://www-users.cse.umn.edu/~odlyzko/doc/discretelogs2014.pdf)</sup> NIST 的密钥建立标准 SP 800-56A 在有限域和椭圆曲线两种设定下定义了离散对数技术，涵盖多种迪菲-赫尔曼和梅内塞斯-奎-范斯通（MQV）变体。<sup>[11](https://www.nist.gov/publications/recommendation-pair-wise-key-establishment-schemes-using-discrete-logarithm-1)</sup> 在 TLS 中，RFC 7919 定义了命名的有限域迪菲-赫尔曼群（ffdhe2048 至 ffdhe8192），对等方通过“支持群”扩展进行协商，取代了服务器临时选择、客户端无法验证其结构的参数。<sup>[4](https://www.rfc-editor.org/rfc/rfc7919.html)</sup>

群的选择与群的大小同样重要。波利格-赫尔曼算法将合数阶 n 的群中的离散对数归约为素数阶 \( p_i \) 的循环子群中的离散对数，因此问题的难度由群阶的最大素因子决定；困难实例必须设置在阶含有大素因子的群中。<sup>[1](https://www-users.cse.umn.edu/~odlyzko/doc/discretelogs2014.pdf)</sup><sup> • </sup><sup>[6](https://www.cs.umd.edu/~waa/414-F11/IntroToCrypto.pdf)</sup> 对于椭圆曲线，NIST SP 800-186 要求每条推荐曲线的阶为 \( h \cdot n \)，其中 n 为大素数、h 为小余因子，阶不同于域大小以避免异常曲线攻击，且嵌入度 k 至少为 \( 2^{10} \)，因为小的嵌入度会将椭圆曲线问题转化为 \( \mathrm{GF}(q^{k}) \) 中的普通离散对数，从而可应用指标演算。<sup>[3](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-186.pdf)</sup>

## 经典算法

**通用算法。** 仅使用群运算的方法适用于任何循环群。平凡的暴力搜索尝试 g 的所有幂，时间最多为群的阶。尚克斯的小步-大步算法将未知指数写成两位表示并匹配循环的两半：它将 \( \sqrt{q} \) 个大步值存入表中，然后从目标出发走小步直到出现匹配，运行时间为 \( O(\sqrt{q} \cdot \mathrm{polylog}(q)) \)，内存为 \( O(\sqrt{q}) \)。波拉德ρ算法通过检测伪随机游走中的碰撞，利用生日悖论，以常数内存达到相同的 \( O(\sqrt{q}) \) 期望时间。<sup>[5](https://www.cl.cam.ac.uk/teaching/2223/Crypto/crypto-slides-2up.pdf)</sup><sup> • </sup><sup>[16](https://bukittimahtutor.com/mathematics/computational-number-theory-discrete-logarithms-baby-step-giant-step-pollard-rho/)</sup> 在通用群模型中，平方根复杂度是最优通用经典方法的下界，维克托·舒普（Victor Shoup）证明了通用离散对数算法的下界。<sup>[16](https://bukittimahtutor.com/mathematics/computational-number-theory-discrete-logarithms-baby-step-giant-step-pollard-rho/)</sup><sup> • </sup><sup>[15](https://cs355.stanford.edu/schedule/cryptanalysis/lecture-6/)</sup>

**指标演算。** 对于有限域的乘法群，算法可以利用通用群所缺乏的代数结构。指标演算将离散对数问题归约为寻找元素间的光滑关系，产生用 \( L \)-记号表示的亚指数运行时间，\( L_{a,b}(N) = e^{b(\log N)^{a}(\log\log N)^{1-a}} \)，它在多项式复杂度 \( L_{0,b} \) 和指数复杂度 \( L_{1,b} \) 之间插值。数域筛法（NFS）是中等至大特征有限域的已知最佳方法，分为四个阶段：多项式选择、关系收集、线性代数和个体对数计算。<sup>[1](https://www-users.cse.umn.edu/~odlyzko/doc/discretelogs2014.pdf)</sup><sup> • </sup><sup>[9](https://arxiv.org/abs/1505.07553)</sup> 在小特征域中，2012 年末至 2013 年初的一系列突破最终促成了安托万·茹（Antoine Joux）与同事巴尔布列斯库（Barbulescu）、戈德里（Gaudry）和托梅（Thomé）提出的启发式准多项式时间算法。<sup>[8](https://arxiv.org/abs/2008.02717)</sup>

实际后果是参数尺寸上的巨大差距。由于指标演算适用于 \( \mathbb{F}_{q}^{*} \) 并将安全级别降低到 \( (\log_{2} q)^{1/2+o(1)} \) 比特，有限域群需要比椭圆曲线群大得多的 q 才能抵御攻击；椭圆曲线群中的每次运算成本更高，但这被其允许的更小域大小所抵消。<sup>[12](https://cr.yp.to/papers/safecurves-20240809.pdf)</sup> 教科书指南指出，困难的有限域离散对数问题需要域 \( \mathbb{F}_{p^{t}} \) 满足 \( p^{t} \ge 2^{1024} \)，而对于椭圆曲线，除特殊情况外未知有任何亚指数算法，因此唯一实用的通用攻击是并行波拉德ρ算法，阶约为 \( 2^{160} \) 的子群足以提供 80 比特安全性。<sup>[6](https://www.cs.umd.edu/~waa/414-F11/IntroToCrypto.pdf)</sup>

**记录计算。** 已求解的最大实例的规模反映了算法进展。2019 年，研究人员宣布在相同硬件和软件上取得两项结果：分解 RSA-240（一个 795 比特的数）和计算模 795 比特素数的离散对数。他们的比较表明，离散对数几乎不比分解同等大小的数更难，而且得益于算法变体和精心选择的参数，两次计算的开销远低于早期记录所暗示的水平。<sup>[7](https://arxiv.org/abs/2006.06197)</sup> 在小特征情形下，\( \mathbb{F}_{2^{30750}} \) 中的一个离散对数以很大差距打破了此前于 2014 年 1 月在 \( \mathbb{F}_{2^{9234}} \) 中创下的记录。<sup>[8](https://arxiv.org/abs/2008.02717)</sup> 在一个 1024 比特素域中的特殊数域筛法计算在学术集群上花费了两个多月的日历时间，使用了一个带陷门的素数，检测其弱点似乎遥不可及。<sup>[14](https://arxiv.org/abs/1610.02874)</sup>

NFS 的个体对数步骤具有直接攻击后果。在 2015 年 5 月披露的针对 TLS 中迪菲-赫尔曼密钥交换的 Logjam 攻击中，为期七天的关系收集和线性代数预计算使得对两个目标 512 比特素域中的每一个，都能在约一分钟内计算出任何给定的个体离散对数，速度足以进行中间人攻击。<sup>[9](https://arxiv.org/abs/1505.07553)</sup>

## 特殊情形与弱群

若干结构化的群族被刻意避免。超奇异曲线和具有小嵌入度的曲线允许从椭圆曲线问题到有限域离散对数的可计算映射，从而给出亚指数攻击；素域上的异常曲线（群阶等于 p）会被一种需要 \( O(\log p) \) 次椭圆曲线运算的算法攻破；而 \( \mathbb{F}_{2^{n}} \) 上 n 为合数的二元曲线则暴露于韦伊下降攻击。<sup>[6](https://www.cs.umd.edu/~waa/414-F11/IntroToCrypto.pdf)</sup> 基于配对的构造也面临同样的风险：对标准化配对友好曲线的安全评估发现，SM9 和先前 ISO/IEC 标准推荐的 BN256 曲线仅提供 99.92 比特安全性，远低于预期的 128 比特级别。<sup>[13](https://arxiv.org/abs/2309.04693)</sup>

## 量子威胁

彼得·W·肖尔（Peter W. Shor）当时在贝尔实验室，后来成为麻省理工学院教授，他于 1994 年证明，假设的量子计算机可以用高效的随机算法求解整数分解和离散对数，步数为输入规模（例如待分解整数的位数）的多项式；这两个问题在经典计算机上普遍被认为是困难的，并曾被用作所提出的若干密码系统的基础。<sup>[2](https://arxiv.org/abs/quant-ph/9508027)</sup> 该算法也适用于椭圆曲线群：普罗奥斯（Proos）和扎尔卡（Zalka）估计，在量子计算机上大约 1000 个量子比特足以破解 160 比特椭圆曲线密码密钥，而分解安全性等效的 1024 比特 RSA 模数则需要约 2000 个量子比特。<sup>[17](https://arxiv.org/abs/quant-ph/0301141)</sup>

由于肖尔算法击败了离散对数假设本身，应对措施是将公钥密码学转向没有已知高效量子算法的问题。NIST 于 2016 年开始在类似公开竞赛的过程中选择抗量子算法，并于 2024 年 8 月发布了首批三项最终确定的后量子标准：FIPS 203（ML-KEM，用于通用加密）、FIPS 204（ML-DSA，用于数字签名）和 FIPS 205（SLH-DSA，一种备用签名方法）。<sup>[10](https://www.nist.gov/news-events/news/2024/08/nist-releases-first-3-finalized-post-quantum-encryption-standards)</sup> 根据 NIST IR 8547 中的过渡时间表，NIST 将在 2035 年前从其标准中弃用并最终移除易受量子攻击的算法（包括基于离散对数的算法），高风险系统将更早过渡。<sup>[10](https://www.nist.gov/news-events/news/2024/08/nist-releases-first-3-finalized-post-quantum-encryption-standards)</sup><sup> • </sup><sup>[18](https://www.nist.gov/pqcrypto)</sup>

## References

1. [Antoine Joux, Andrew Odlyzko, and Cécile Pierrot. The Past, evolving Present and Future of Discrete Logarithm.](https://www-users.cse.umn.edu/~odlyzko/doc/discretelogs2014.pdf)
2. [Peter W. Shor. Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer. arXiv:quant-ph/9508027.](https://arxiv.org/abs/quant-ph/9508027)
3. [NIST SP 800-186. Recommendations for Discrete Logarithm-based Cryptography: Elliptic Curve Domain Parameters (February 2023).](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-186.pdf)
4. [D. Gillmor. RFC 7919: Negotiated Finite Field Diffie-Hellman Ephemeral Parameters for TLS (August 2016).](https://www.rfc-editor.org/rfc/rfc7919.html)
5. [University of Cambridge. Cryptography course slides (2022-23).](https://www.cl.cam.ac.uk/teaching/2223/Crypto/crypto-slides-2up.pdf)
6. [Nigel Smart. Introduction to Cryptography, Chapter 13: Discrete Logarithms (course text, University of Maryland mirror).](https://www.cs.umd.edu/~waa/414-F11/IntroToCrypto.pdf)
7. [Boudot, Gaudry, Guillevic, Heninger, Thomé, Zimmermann. Comparing the difficulty of factorization and discrete logarithm: a 240-digit experiment. arXiv:2006.06197.](https://arxiv.org/abs/2006.06197)
8. [Gaudry, Kohel, Leroux. Computation of a 30750-Bit Binary Field Discrete Logarithm. arXiv:2008.02717.](https://arxiv.org/abs/2008.02717)
9. [Grémy, Thomé. Computing Individual Discrete Logarithms Faster in GF(p^n) with the NFS-DL Algorithm. arXiv:1505.07553.](https://arxiv.org/abs/1505.07553)
10. [NIST Releases First 3 Finalized Post-Quantum Encryption Standards (August 13, 2024).](https://www.nist.gov/news-events/news/2024/08/nist-releases-first-3-finalized-post-quantum-encryption-standards)
11. [NIST SP 800-56Ar3. Recommendation for Pair-Wise Key-Establishment Schemes Using Discrete Logarithm Cryptography (2018).](https://www.nist.gov/publications/recommendation-pair-wise-key-establishment-schemes-using-discrete-logarithm-1)
12. [Daniel J. Bernstein and Tanja Lange. SafeCurves paper (2024 version).](https://cr.yp.to/papers/safecurves-20240809.pdf)
13. [Security Analysis of Pairing-based Cryptography. arXiv:2309.04693.](https://arxiv.org/abs/2309.04693)
14. [Kleinjung, Wesolowski et al. A kilobit hidden SNFS discrete logarithm computation. arXiv:1610.02874.](https://arxiv.org/abs/1610.02874)
15. [Stanford CS 355, Lecture 6: Attacks on Groups.](https://cs355.stanford.edu/schedule/cryptanalysis/lecture-6/)
16. [Bukit Timah Tutor. Computational Number Theory 6: Discrete Logarithms, Baby-Step Giant-Step and Pollard Rho.](https://bukittimahtutor.com/mathematics/computational-number-theory-discrete-logarithms-baby-step-giant-step-pollard-rho/)
17. [Proos, Zalka. Shor's discrete logarithm quantum algorithm for elliptic curves. arXiv:quant-ph/0301141.](https://arxiv.org/abs/quant-ph/0301141)
18. [NIST Post-Quantum Cryptography project page.](https://www.nist.gov/pqcrypto)

---
*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: 物质世界与数学 › 数学与统计学 › 数与代数 › Number theory › Computational and probabilistic number theory › Discrete logarithm and cyclic-group algorithms

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/discrete-logarithm

English original: https://www.edgepedia.org/discrete-logarithm
