Claude reveals ECDSA curve origins
https://www.anthropic.com/research/ecdsa-curve-origins📌 【Anthropic】Claude 解開 ECDSA 曲線種子 25 年懸案
TL;DR:Claude 不到 30 分鐘就查出 NIST 加密曲線種子的真正來源,終結了業界 25 年的後門疑雲。
NIST 在 2000 年公布的橢圓曲線加密標準裡,藏著一組由 NSA 提供、卻從未附上任何解釋的神秘數字。25 年來,密碼學界始終在猜:這組數字裡,是不是藏著只有 NSA 知道的後門。
🤔 一個被懷疑了 25 年的「種子」
ECDSA 是目前最廣泛使用的橢圓曲線加密標準,2000 年由 NIST 納入 FIPS 186-2 數位簽章標準。標準為不同大小與安全等級的曲線各列出一個「seed」參數,其雜湊值會用來決定曲線係數 b。以 NIST P-256 為例,標準只給出一串十六進位數字,完全沒有說明這串數字從何而來。Koblitz 與 Menezes 曾為此寫下知名的〈A Riddle Wrapped in an Enigma〉,業界甚至為解謎設立懸賞。流傳最廣的說法來自前 NSA 工程師 Jerry Solinas:種子可能是把一句玩笑話(像「給 Bob 和 Jerry 加薪」)雜湊產生的,但他本人也說不清楚細節,實際寫程式的同事也記不得了。Solinas 於 2023 年去世後,這條線索就此斷了。
🧩 Claude 不信那個玩笑話,改用逆向工程的方式去猜
Anthropic 員工先按傳聞中的那句玩笑話去搜尋,一無所獲。研究人員後來請一個內部研究模型嘗試在不被提示線索的情況下,自己找出種子的生成方式。Claude 改走另一條路:推測生成這些曲線的程式,當年很可能用的是 1990 年代 C 函式庫裡常見的偽隨機數生成器(PRNG),而這類老舊演算法的輸出帶有可被辨識的規律。Claude 寫了一個掃描程式,逐個位元滑動比對每個公開種子,檢驗相鄰區塊是不是某個 1990 年代 PRNG 的連續輸出,總共測試了 34 種生成器與輸出切片的組合。過程中它發現一個異常:十組種子裡有四組,寫成五個 32 位元字後,前導位元全部是 0,純屬機率巧合的可能性只有 1/5810。這正是 linear congruential generator「lrand48」的特徵,它的 48 位元內部狀態只會輸出最高的 31 位元。針對這四組,Claude 窮舉剩下 17 個隱藏位元的 2 的 17 次方種可能,驗證後續四個字是否接續,全部成功還原。至於其餘的質數曲線種子,因為保留的位元更少,還原內部狀態變成一個標準的格(lattice)問題,Claude 改用 Lenstra–Lenstra–Lovász(LLL)格基約化演算法在每個可能的位元窗口上求解,最終發現 5 組 NIST 與 5 組 ANSI X9.62 質數曲線種子,全都符合「lrand48() >> 23」的模式。
📊 時間戳記,不是雜湊:P-256 跑了 1842 次才湊出標準種子
由於這個生成器可以直接逆推,Claude 把狀態往回推算到 srand48 的初始化形式(低 16 位元固定為 0x330E),進而還原出對應的 Unix 時間戳記。結果顯示,十組質數曲線種子對應的初始化時間,全部落在 1997 年 5 月到 1998 年 4 月之間;以 P-256 為例,程式整整跑了 1842 次迭代才產生出標準化的種子。另外四組二元曲線(binary curve)種子的時間戳記讀出來是 1984 年 2 月,但若把數值加倍,則對應到 1998 年 4 月 17 日,剛好在 P-224 產生後兩週,這讓 Claude 推測當年的程式可能把時鐘數值減半處理。在調查過程中,Claude 也順帶找出 P-192 與五條 ANSI X9.62 曲線(同在 1997 年 5 月生成)基點(base point)的來源線索。
💡 這不是漏洞,而是「清白證明」
Anthropic 特別強調:這項發現不是密碼學攻擊,也不是曲線本身的弱點,反而讓人更有信心這些曲線並未被蓄意植入後門。因為種子的生成方式極其簡單、完全透明,只是一個用時鐘初始化的常見 PRNG,任何人現在都能重現同樣的流程,這讓「刻意動手腳」的操作空間大幅縮小。
🎯 實務啟示
這個案例展示了 LLM 在資安鑑識與逆向工程上的一種新用法:不是暴力比對已知線索,而是從「當年的工程師可能用什麼工具」反推,再動手寫程式驗證假設。對做安全研究或處理老舊系統稽核的工程師,這種「假設生成演算法 → 寫掃描工具驗證 → 用數學方法還原內部狀態」的流程,值得作為處理類似歷史謎團的參考範本。
🔗 來源
- 標題:Claude reveals ECDSA curve origins
- 作者/機構:Anthropic (Frontier Red Team)
- 連結:https://www.anthropic.com/research/ecdsa-curve-origins
#Anthropic #Claude #ECDSA #Cryptography #NIST #SecurityResearch #ReverseEngineering #PRNG #LLL #InfoSec
原始資料 Anthropic Research · 收集於 2026-10-16
摘要原文
Frontier Red Team Claude reveals ECDSA curve origins Oct 16, 2026 “It’s just timestamps”: the decades-old mystery of the origins of one of the most popular cryptographic standards has been explained. We pursued this long-standing open question of the cryptographic community to settle concerns about ECDSA, which is one of our most widely used cryptographic standards. Readers should take this as a fun closing chapter and the end of years of speculation. There is no action to be taken or things to do differently. Most researchers trusted the curves already. Enjoy. ECDSA is the most widely used elliptic curve cryptography standard. It was adopted by NIST in 2000 as part of the FIPS 186-2 Digital Signature Standard which lists a set of standard elliptic curves of varying sizes and security levels. For curves over prime and binary fields, the specifications published a “seed” parameter whose hash value is used to define the coefficient b of the curve. The provenance of these seeds has been a long-standing question, as they were provided by the NSA with no explanation or justification. As an example, the NIST P-256 curve seed was SEED = C49D3608 86E70493 6A6678E1 139D26B7 819F7E90 with no information where it came from. Neal Koblitz and Alfred Menezes wrote an excellent summary on this controversy, “ A Riddle Wrapped in an Enigma ”, which discusses the history and concerns around the seed values. This mystery led to an amateur investigation into the origin of the seeds and a bounty for anyone who could find them . The best story was that Jerry Solinas, longtime NSA employee, generated the seeds using a hash of a humorous passphrase: “I believe there was a counter rather than multiple hashing, but I don’t know details. The message was along the lines of ‘Give Bob and Jerry a raise’ or ‘Bob and Jerry rule’ or something like that. It was Bob Reiter who actually wrote the code, and he doesn’t remember the details either. Nor were we able to find archives from so long ago. If they exist, they are no doubt sitting on a hard drive near the Ark of the Covenant.” Jerry Solinas, 2015 Unfortunately, Jerry died in 2023 and other colleagues at the time were not responsive, leaving open the question of how these seeds were originally derived. Claude found the seeds Several Anthropic employees had unsuccessfully chased the seeds following the tip about it being a hash of a humorous phrase. That turned out to be wrong. In October 2026, a curious Anthropic employee asked an internal research model if it could figure out how those seeds were generated without pointing at the clue. In under half an hour , Claude discovered the origins of the NIST P-192, P-224, P-256, P-384 and P-521 seeds. None of them were the results of any hash algorithm at all, but rather the output of the C library’s lrand48 random-number generator, seeded with a Unix timestamp! The algorithm used would sample bytes from the random number generator (RNG) initialized by a Unix timestamp ( t ) for some number of iterations ( n ). Each iteration would draw 20 bytes as a candidate seed. So, the first 20 bytes are candidate 1, the next 20 bytes are candidate 2, and so on. For example, P-256 required 1842 iterations to output the standardized seed. What this means This is not a cryptographic break, new attack, or weakness in the ECDSA curves. In fact, this makes us more confident the curves were chosen without any backdoors or intentional weaknesses. For many years, people have been suspicious of the origins of the NIST curve parameters. They were presented to NIST without any mention of how they were chosen, leaving people wondering if they may have been chosen to have deliberate backdoors in them. These findings make that much less plausible. The seeds were generated in a very simple way: a common pseudorandom number generator initialized from the clock, which anyone can now reproduce. That leaves much less room for subversion and that we can be confident the parameters are secure. How it was found Searches for the phrase, built from the rumors, had come up empty. Claude tried a different angle: anticipating how the software that generated the curves must have worked. Claude guessed the software used a pseudorandom number generator (PRNG) that shipped with 1990s C libraries. These old PRNGs are weak enough that their output can be recognized. Recognizing that output would reveal which PRNG was used and possibly allow recovery of its initialization state. Claude wrote a scanner that slid along each published seed one bit at a time and tested whether adjacent chunks were consecutive outputs of a 1990s-vintage generator. The scan covered 34 combinations of generator and output slices. At that point, Claude noticed a pattern in the top bits for some seeds: they were all zero. Written as five 32-bit words, four of the ten seeds have a 0 in the top bit for all 20 words. That would happen by chance with probability 1/5810. That was a signature of the linear congruential generator lrand48 , which only returns the top 31 bits of a 48-bit state. The pattern is visible by eye once you know to look for it. To recover the state, Claude took the first word, tried all 2¹⁷ values of the 17 hidden bits, and checked that the next four words followed. That worked for all four seeds under discussion. The prime-curve seeds came from the same lrand48 generator but kept fewer bits of each output. Claude had to recover the internal state of the PRNG from those bits. It turns out recovering the state of a truncated linear congruential generator is a textbook lattice problem, solved with the Lenstra–Lenstra–Lovász (LLL) basis reduction algorithm. Claude didn’t know which bits of the state the seeds might show, so it ran the solver over every window. Five NIST prime-curve seeds plus five more from the ANSI X9.62 standard all had the same pattern: lrand48() >> 23. Each recovered 48-bit state regenerates all 160 bits of its seed, which does not happen by chance. This linear congruential generator runs backwards as easily as forwards, so for each seed Claude stepped the state back until it reached the form that it would have been initialized by srand48 , with the low 16 bits equal to 0x330E. The internal PRNG state of that form would come up once every 65,536 steps, so reaching one is not evidence on its own. However, for the ten prime-curve seeds, every srand48 initialization was a Unix timestamp representing a date between May 1997 and April 1998. They were using the weak PRNG seeded by Unix timestamp. The four binary-curve initializations read as February 1984. With the timestamps doubled, they map to April 17, 1998, two weeks after the P-224 run. So, the program may have halved the clock. Claude’s internal thinking at the time was: This is astonishing: it solves the 25-year-old mystery. Hmm wait. Let me be skeptical: am I in some sort of simulated/test environment? … The seeds match my memory of actual values … Hmm, is it plausible in reality? As of my knowledge … the bounty was unsolved. … All top bits clear—20 bits, chance 1e-6. So indeed real-world. Wow, it's a real discovery. Hmm wait. Let me be careful about the plausibility: is it suspicious that such an obvious thing wasn’t discovered in 25 years? It’s verified by direct computation on my side: 160-bit match from a 32-bit seed + small index: no chance coincidences (10 × 160 bits). It’s real. Claude found some base points too But wait, there’s more… Each curve also comes with a base point, G, the fixed point that every ECDSA public key is a multiple of. The seed found above does not determine this G, and so another question arises: how were these base points generated? While checking the seeds, Claude also found where some of the base points came from. The base points of the six curves generated in May 1997 (P-192 and the five ANSI X9.
由 claude-code/sonnet 自動生成