paperbot · PL 论文追踪

全部论文 待读 收藏

P2 CT-wasm: type-driven secure cryptography for the web ecosystem

CT-Wasm:面向 Web 生态的类型驱动安全密码学
POPL 3(POPL)2019匹配度 2/10 · 论文是 WebAssembly 类型系统/形式化验证保障密码代码恒定时间与信息流安全,属于 PL 与安全方向,但与用户核心关注的 LLM/Agent、AI 与静态分析交叉、浮点程序分析或贝叶斯程序分析均无直接关系。引用 61 inbox
Conrad Watt, John Renner, Natalie Popescu, Sunjay Cauligi, Deian Stefan
crossref: 2026-09-10

AI 速览

一句话:在 WebAssembly 上引入类型驱动的严格扩展 CT-Wasm,用类型系统保证密码代码的信息流安全与恒定时间执行。

大量客户端与服务端密码学代码用 JavaScript 实现,虽广受安全质疑,却因其在 Web 生态中的无处不在而难以替代。WebAssembly 的引入为提出既有原则性又不牺牲便利性的替代方案提供了机会。本文提出 Constant-Time WebAssembly(CT-Wasm),一个类型驱动、严格的 WebAssembly 扩展,用于可验证安全地实现密码算法。其类型系统同时保证信息流安全与抵抗计时侧信道攻击,且与原 Wasm 一样可在多项式(线性)时间内验证。作者在已有 Wasm 机器化基础上机器化了完整 CT-Wasm 规约,证明了扩展类型系统的可靠性,实现了经验证的类型检查器,并给出若干安全性质证明。工作提供 OCaml 参考解释器、面向 Node.js 与 Chromium 的 V8 原生实现,以及 CT-Wasm 到 Wasm 的重写工具,使开发者可在基础 Wasm 环境中受益于该类型系统。作者移植了 Salsa20、SHA-256、TEA 及完整 TweetNaCl 库进行评估,结果显示 CT-Wasm 快速、表达力强,且生成代码经实验测量为恒定时间。

问题
JavaScript 是 Web 生态中密码学实现的主要载体,但难以保证其实现的信息流安全与恒定时间执行,从而易受计时侧信道攻击;Wasm 的出现提供了在不牺牲便利性的前提下给出原则性替代方案的机会。
方法
提出 CT-Wasm——WebAssembly 的类型驱动严格扩展,用类型系统强制信息流安全与恒定时间执行;在已有 Wasm 机器化之上机器化完整规约、证明类型系统可靠性并实现经验证的类型检查器,同时给出 OCaml 参考解释器、基于 V8 的原生实现与 CT-Wasm 到 Wasm 的重写工具。
评估
将 Salsa20、SHA-256、TEA 等密码原语及完整的 TweetNaCl 库移植到 CT-Wasm,通过实验评估其性能与表达力,并实测生成代码的恒定时间性质。
原文摘要(Abstract)

A significant amount of both client and server-side cryptography is implemented in JavaScript. Despite widespread concerns about its security, no other language has been able to match the convenience that comes from its ubiquitous support on the "web ecosystem" - the wide variety of technologies that collectively underpins the modern World Wide Web. With the introduction of the new WebAssembly bytecode language (Wasm) into the web ecosystem, we have a unique opportunity to advance a principled alternative to existing JavaScript cryptography use cases which does not compromise this convenience. We present Constant-Time WebAssembly (CT-Wasm), a type-driven, strict extension to WebAssembly which facilitates the verifiably secure implementation of cryptographic algorithms. CT-Wasm's type system ensures that code written in CT-Wasm is both information flow secure and resistant to timing side channel attacks; like base Wasm, these guarantees are verifiable in linear time. Building on an existing Wasm mechanization, we mechanize the full CT-Wasm specification, prove soundness of the extended type system, implement a verified type checker, and give several proofs of the language's security properties. We provide two implementations of CT-Wasm: an OCaml reference interpreter and a native implementation for Node.js and Chromium that extends Google's V8 engine. We also implement a CT-Wasm to Wasm rewrite tool that allows developers to reap the benefits of CT-Wasm's type system today, while developing cryptographic algorithms for base Wasm environments. We evaluate the language, our implementations, and supporting tools by porting several cryptographic primitives - Salsa20, SHA-256, and TEA - and the full TweetNaCl library. We find that CT-Wasm is fast, expressive, and generates code that we experimentally measure to be constant-time.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot680,
  title = {CT-wasm: type-driven secure cryptography for the web ecosystem},
  author = {Conrad Watt and John Renner and Natalie Popescu and Sunjay Cauligi and Deian Stefan},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {3},
  number = {POPL},
  year = {2019},
  doi = {10.1145/3290390}
}