Production ML-DSA Verification in 350 Lines of Python
2026年7月26日
AI 摘要 AI 生成,可能有误
作者展示了一个可用于生产环境的 ML-DSA(后量子签名)验证器,由 350 行纯 Python 代码编写、无任何第三方依赖,已在 PyPI 上发布,其 API 参照 pyca/cryptography 设计,并支持所有参数集。性能被描述为尚可——每秒约可完成 230 次 ML-DSA-44 验证,大约比 Go 慢 60 倍——并且该实现已通过 Wycheproof 测试向量、CCTV 测试向量以及变异测试进行了全面检验。该项目源于作者通过编写一个独立实现来验证自己的 Go 实现的想法,由于验证过程不涉及任何机密信息,Python 缺乏恒定时间(constant-time)保证并不是一个问题。
I don’t do a lot of Python, at least not in my most recent life.1 However, I happen to have just written a production ML-DSA verifier in pure Python. It’s 350 lines of code (plus many more of tests), it supports all parameter sets, and I am pretty satisfied with it.
You can fetch it as mldsa from PyPI, thanks to William Woodruff, or you can copy-paste it: it’s a single file without dependencies and it’s dual-licensed CC0 and 0BSD. It works with Python 3.8 and later. The API is modeled after the excellent pyca/cryptography.
I hope this will make it easier for some projects to migrate to post-quantum authentication, which has suddenly become more urgent than we all anticipated. In particular, I hope it will unblock some client applications that can’t use C extensions for portability reasons.
继续阅读全文
为了尊重作者,这里只展示开头几段。你可以去原文阅读,或者在 HorizonReader 里读:划线做笔记、让 AI 帮忙。
AI 摘要A team from Anthropic claimed the author's three-year-old bounty by discovering that the NIST elliptic curve seeds were generated in 1997-98 using the drand48 random number generator seeded with UNIX timestamps, disproving the lore that they came from hashed English sentences. The findings rule out the NSA-backdoor conspiracy theories, since the seeds offered too little freedom to intentionally target weak curves, restoring confidence in NIST elliptic curve cryptography. The prize was donated to ISRG, the non-profit behind Let's Encrypt, tripling its value to $36,864.
AI 摘要This article presents an updated edition of the 'Cryptographic Right Answers' guidance for developers, driven by the accelerated post-quantum transition timeline that now targets completion by 2029. It explains that while symmetric cryptography remains largely unchanged, nearly all asymmetric recommendations have shifted, offering concrete picks such as XAES-256-GCM or XChaCha20Poly1305 for encryption, Argon2id or scrypt for passwords, X25519+ML-KEM-768 for key exchange, HPKE with X-Wing for asymmetric encryption, and ML-DSA-44 for signatures. It also highlights that LLM-based code review is now a standard recommendation alongside using memory-safe languages.
AI 摘要The article argues that passkeys are the key solution to phishing but that server-side adoption suffers from non-interoperable database schemas, so the author proposes a c2sp.org/passkey-record format—borrowing PHC string syntax and WebAuthn's authenticator data encoding—that lets applications store passkeys as opaque strings, much like password hashes. Building on this, the author drafts a stateless Go crypto/passkey API covering registration and login flows, where the application only stores per-user passkey records and caches login challenges while the library handles verification. The author notes the format naturally avoids credential-ID collision attacks, invites feedback on the format and API (possibly a proposal for Go 1.28), and closes with personal and sponsor notes.
AI 摘要The author, a former lead of the Go Security team, explains that vulnerability reports have traditionally been treated as special—deserving responsiveness and attribution—because researchers provided scarce insight and the confidentiality needed to fix flaws before attackers could exploit them. Now that LLMs can find vulnerabilities as well as most researchers, and attackers can do the same, that insight is no longer precious and confidentiality matters little, making triage of noisy reports the real bottleneck. The era of vulnerability reports being special may therefore be over, shifting the job's focus to triage, rapid remediation, and prevention, though the author and commenters note some highly severe or trusted reports may still warrant special treatment.
AI 摘要The article debunks the common misconception that quantum computers will 'halve' the security of symmetric keys, arguing that AES-128 and other 128-bit symmetric primitives remain safe against quantum attacks. Because Grover's algorithm cannot be effectively parallelized (as proven by Zalka in 1997), breaking AES-128 would require roughly 140 trillion quantum circuits of 724 logical qubits each running in parallel for a decade—making it astronomically more expensive than Shor's algorithm attacks on 256-bit elliptic curves. This near-consensus position is supported by NIST, the German BSI, and experts like Samuel Jaques, meaning no symmetric key sizes need to change as part of the post-quantum cryptography transition.