DeepMind AI 完成 Signal 加密协议的数学证明

Google 旗下 DeepMind AI 实验室的一个团队,对 Signal 私密聊天应用中实现加密机制的代码完成了完整的形式化证明。科学家们将自己的流程称为 AlphaProof Code,并声称它可以应用于其他需要对计算机代码进行完整端到端验证的场景,这意味着 Signal 是安全的,你可以找到详述该证明的完整论文和代码仓库。
更明确地说,该团队审查了一个由 Arm 编译的 libsignal 版本——libsignal 正是 Signal 应用自身所集成并使用的库——并在其外围加上了少量最小化的脚手架代码。需要注意的是,这次验证并不是针对源代码进行的:它有意针对一个 AArch64 二进制文件执行,这意味着该方法可以复用于未来对其他软件的验证。
与这些 AI 实验室在数学方面的工作类似,大部分工作是用 Lean 完成的,Lean 是一门为形式化证明专门打造的语言。不过,这项工作有一个关键区别。Lean 主要用于证明算法背后的数学原理,在这个案例中就是 Signal 加密的规范。
然而,科学家们实际做的是创建数百万行 Lean 证明,并针对真实实现运行这些证明,在本例中就是检验最终的二进制可执行文件与最初的规范相符。
软件开发中的代码测试人人都知道,但对代码进行数学证明则完全是另一回事,而且在计算史上一直格外难以实现。这好比能够核查整个厂区无论在发生其他什么事情的情况下,都能以完全相同的输入、零偏差地生产出它本应制造的零件。
DeepMind 科学家提到,此前在这一方向上曾有过持续多年的努力,为相对小型的软件创建形式化证明。据称 seL4 微内核花了二十年才完成证明,而 CompCert 的 C 编译器花了六年。这听起来可能像是在软件工程上做得太过头了,但考虑到上述程序如今实际上已经坚不可摧,不会因为代码缺陷而失败——至少在其所控制的输入范围内如此。
虽然对地球上所有软件进行形式化证明会是一种值得商榷的资源使用方式,但 AlphaProof Code 能够为像 Signal 通信协议这样的关键任务代码做到这一点,实属一大福音。
过于简化地说,AlphaProof Code 的实际工作流程包含人类与 Gemini 4 Carbon 智能体之间多个来回交互的阶段。第一步是奠定基础与基础设施。团队定义了基本工作范围,然后创建了文本机器人技能,为智能体未来的任务做准备,其中包括规范撰写者、证明工作者和编排。
然后,该让智能体为 AArch64 指令、寄存器、内存和系统调用的工作方式,以及 Linux 进程的运行方式创建第一组 Lean 定义。然而,此时尚未证明任何关于 Signal 或其他应用的内容。接下来才是这一步:团队及其庞大的智能体队伍为 libsignal 的密码学实现起草了全面修订的规范。这随后生成了略多于 120 万行的 Lean 代码,用于检查该协议背后的数学推理。
智能体式工作的大部分内容是生成 530 万行 Lean,以验证每条二进制指令都与先前定义的 AArch64、CPU 和进程形式化行为相匹配。在这一阶段,智能体标记出代码库的 1% 供人工审查和验证。当一切完成时,团队已完全验证二进制文件中的密码引擎确实与所有生成的证明相匹配,直到最后一个被处理的比特。
正如研究人员指出的:“我们从自身经验中得到的最重要教训是,一旦证明变得廉价,困难的问题就变成了要证明什么,”他们补充说,“我们的大部分精力并非用于证明,而是用于规范,”并强调这对密码学等软件主题尤为重要。
有趣的是,他们提到,“针对真实代码编写规范也被证明是对文献的一场压力测试,”这是一个很有洞见的提示,用来验证人们一开始是否正确地编写了软件的规范。
需要声明的是,这是一条关于总体安全的说明,而我们认为 Signal 作为私密消息应用确实是一流的:Google 的团队“只”证明了 libsignal 完全按宣传那样工作。如果恶意行为者用额外代码给 Signal 应用——或任何其他应用——设下陷阱,以复制你的消息,这种证明很可能无法发现它。同样,第三方应用实现了 Signal 协议用于加密,并不自动意味着它提供完全的隐私。
译文由英文原文机器翻译,术语按行业惯例统一,可在文末展开原文核对。
查看英文原文(Google DeepMind AI engineers conjure mathematical proof of Signal's encryption protocol)
A team at Google's DeepMind AI labs has performed a complete formal proof of the code that implements the encryption mechanism for the Signal private chat application. The scientists call their procedure AlphaProof Code and claim it can be applied to other situations requiring complete end-to-end verification of computer code, meaning Signal is safe, and you can find the full paper and the code repository detailing the proof.
More explicitly, the team reviewed an Arm-compiled version of libsignal, the library that the Signal application itself incorporates and uses, with some minimal scaffolding around it. Note that the verification wasn't done against the source code: it was purposely executed against an AArch64 binary, meaning the method can be reused for future verifications of other software.
In a similar vein to the AI labs' work on mathematics, the bulk of the work was done in Lean, a purpose-built language for formal proofs. There's a key difference for this effort, though. Lean is primarily used to prove the underlying math in algorithms, which in this case would be the specifications for Signal's encryption.
However, what the scientists actually did was create millions of lines of Lean proofs that were run against the actual implementation, in this case checking that the final binary executable corresponds to the initial specification.
Everyone knows about code tests in software development, but a mathematical proof of code is a different beast altogether, and one particularly elusive over the history of computing. It's akin to being able to check that an entire factory campus produces the actual parts it was designed to make, with the same exact inputs, with zero variation, no matter what else is happening.
The DeepMind scientists mention previous year-long efforts in this vein to create formal proofs for relatively small pieces of software. The seL4 microkernel purportedly took twenty years to prove, while CompCert's C compiler took six. This may sound like going way overboard on software engineering, until you consider that said programs are now, in practical terms, bulletproof and cannot fail due to a code flaw, at least for the inputs they control.
While it'd be a questionable use of resources to formally prove all software on Earth, AlphaProof Code providing the ability to do so for mission-critical code like the Signal comms protocol is quite a boon.
As an oversimplification, the actual AlphaProof Code workflow comprised various stages of back-and-forth between humans and Gemini 4 Carbon agents. The first steps were laying out the groundwork and infrastructure. The team defined the base scope of work, and then created textual bot skills to prepare agents for their future tasks, among them specification writers, proof workers, and orchestration.
Then, it was time to have agents create the first set of Lean definitions for AArch64 instructions, how registers, memory, and system calls work, and how Linux processes operate. At this point, however, nothing is proven about Signal or any other application. That came next, as the team and its army of agents drafted fully revised specifications for libsignal's cryptography implementation. This then generated just over 1.2 million lines of Lean, for checking the mathematical reasoning behind the protocol.
The bulk of the agentic work was generating 5.3 million lines of Lean to verify that each binary instruction matched the previously defined AArch64, CPU, and process formal behaviors. During this stage, the agent flagged one percent of the codebase for humans to review and verify. When it was all complete, the team had fully verified that the cryptographic engine in the binary did indeed match all the generated proofs, down to the last processed bit.
As the researchers point out: "the most important lesson from our experience is that, once proofs become cheap, the hard question is what to prove," adding that "the majority of our effort went not into proofs but into specifications," and underscoring that this is particularly important for software topics like cryptography.
Interestingly, they mention that "writing specifications against real code also turned out to be a stress test for the literature," an insightful note on verifying that one did write the software's specifications properly to begin with.
With the disclaimer that this is a note about security in general and we think Signal is indeed top-notch as a private messaging application: Google's team "only" proved that libsignal works exactly as advertised. If a malicious actor were to booby-trap the Signal app — or any other one — with additional code to copy your messages, this sort of proof likely wouldn't catch it. Likewise, the fact that a third-party app implements the Signal protocol for encryption doesn't automatically mean it offers full privacy.
正文保留英文原文,标题与摘要由机器翻译。
原文发布于 Tom's Hardware(Google DeepMind AI engineers conjure mathematical proof of Signal's encryption protocol),标题、摘要与正文由机器翻译,术语按行业惯例统一,未经人工逐句校订。