Go 加密现状
Go Cryptography State of the Union

原始链接: https://words.filippo.io/2025-state/

Go语言的`crypto/tls`库的最新更新优先考虑针对未来量子计算威胁的安全。该库现在默认采用“混合”加密方法,将成熟的算法与新的后量子密码学(如X25519和ML-KEM-768)相结合。 这种混合模式是一种预防措施;虽然新算法显示出前景,但历史表明它们可能容易受到意外攻击(例如,一台笔记本电脑就能破解的攻击!)。通过同时使用旧方法和新方法,只有*两者*都被攻破,连接才能被破坏——需要一台量子计算机*以及*破解新密码学的突破。 Go 1.24+ 会自动与兼容的应用程序(如Chrome)协商这种后量子安全性。开发者不再需要手动配置密钥交换顺序,因为该库会智能地默认选择最安全的选项,除非明确禁用。 这旨在主动保护连接免受未来的密码学威胁。

## 黑客新闻讨论摘要:密码学与 Go 一个黑客新闻帖子讨论了 Filippo 最近关于密码学现状的文章,重点关注 Go 生态系统中的挑战。关键点包括对 NIST 标准(如 FIPS 140)缓慢进展的沮丧,它实际上限制了安全改进的天花板,而非作为安全基线。 讨论集中在 Go 处理密码学原语的方式,特别是对种子和密钥材料使用 `[]byte`。人们担心长度检查可能导致错误,以及缺乏对安全关键数据的强类型化。Go 加密团队为这些选择辩护,引用了实际经验和防止常见错误的需要。 一个 `runtime/secret` 包的提议旨在解决垃圾回收语言中的内存安全问题,而参与者则争论内存中残留密钥的风险以及零化敏感数据的重要性。对话还涉及区块链/加密货币领域对“密码学”一词的挪用。
相关文章

原文
#

Instead, you're probably going to just use crypto/tls, which by default now uses a hybrid of X25519 and ML-KEM-768 for all connections with other systems that support it.

Why hybrid? Because this is new cryptography. So we are still a little worried that somebody might break it.

There was one that looked very good and had very small ciphertext, and we were all like, “yes, yes, that's good, that's good.” And then somebody broke it on a laptop. It was very annoying.

We're fairly confident in lattices. We think this is the good one. But still, we are taking both the old stuff and the new stuff, hashing them together, and unless you have both a quantum computer to break the old stuff and a mathematician who broke the new stuff, you're not breaking the connection.

crypto/tls can now negotiate that with Chrome and can negotiate that with other Go 1.24+ applications.

Not only that, we also removed any choice you had in ordering of key exchanges because we think we know better than you and— that didn't come out right, uh.

… because we assume that you actually want us to make those kind of decisions, so as long as you don't turn it off, we will default to post-quantum.

You can still turn it off. But as long as you don't turn it off, we'll default to the post-quantum stuff to keep your connection safe from the future.

联系我们 contact @ memedata.com