安全与密码学2016eprint.iacr.org
OpenSSL DSA 密钥恢复攻击
OpenSSL DSA key recovery attack
进阶 · 约 60 分钟读完前置知识:密码学基础、DSA 签名、侧信道攻击
导读
这篇论文研究 OpenSSL 中 DSA 签名的时序侧信道攻击:由于模幂运算的执行时间依赖于本应保密的指数(随机数 k)的比特长度,攻击者可通过测量时间信号恢复 DSA 私钥。论文还指出 OpenSSL 团队为修复此问题提交的“常量时间”补丁因 BN_copy 不传播 BN_FLG_CONSTTIME 标志而引入缺陷,使修复失效。
HN 关注点:密码学实现中常量时间这一细节多么容易出错——连 OpenSSL 的官方修复补丁都因一个 API 误用而失效。
HN 评论精选
这几条评论里:质疑 1 补充 1
补充梳理了论文中 OpenSSL 修复补丁因 BN_copy 不传播常量时间标志而失效的细节,并质疑攻击前提是本地非特权进程。
论文引用了 OpenSSL 团队针对此问题的两次代码提交。第一次为模幂运算添加了“常量时间”实现,但其执行时间仍依赖于指数的比特长度,而 DSA 中指数应当保密。第二次提交试图“确保 DSA 签名的幂运算真正是常量时间”的,方法是固定指数的比特长度。不幸的是,该提交引入了软件缺陷:BN_copy 函数并不负责把标志位从源复制到目标,OpenSSL 为此提供了专门的 API BN_with_flags。结果 BN_FLG_CONSTTIME 标志没有传播到 kq,求和结果不再被当作秘密处理,等于撤销了第一次提交的修复。另外,利用此攻击需要一个本地“间谍”进程在握手进行时记录时间信号——我猜这是非特权进程,否则密钥不是可以直接读取了吗?
zaroth查看英文原文
Make Sure DSA Signing Exponentiations Really are Constant-Time "...the OpenSSL team committed two code changes relevant to this work. The first adds a “constant-time” implementation of modular exponentiation..." "The execution time of the “constant-time” implementation still depends on the bit length of the exponent, which in the case of DSA should be kept secret [12, 15, 27]. The second commit aims to “make sure DSA signing exponentiations really are constant-time” by ensuring that the bit length of the exponent is fixed." "...While the procedure in this commit ensures that the bit length of the sum kq is fixed, unfortunately it introduces a software defect. The function BN_copy is not designed to propagate flags from the source to the destination. In fact, OpenSSL exposes a distinct API BN_with_flags for that functionality..." "In contrast, with BN_copy the BN_FLG_CONSTTIME flag does not propagate to kq. Consequently, the sum is not treated as secret, reverting the change made in the first commit..." Exploitation requires a local 'spy' process recording timing signals while the handshakes are running. I assume this is an unprivileged process, otherwise wouldn't the key be directly accessible?
质疑指出攻击所需样本量很小(几百次握手),担心在共享云环境(如 AWS)中可被实际利用。
只需要监听几百次握手。唉。我感觉这在大规模 AWS 实例上部署会有一定成功率。
vessenes查看英文原文
Needs to listen to only a few hundred handshakes. Ugh. Something tells me this could be deployed on AWS large instances with some success.
历次讨论
- 2016Hacker News 讨论帖184 分 · 17 评
同领域还值得读
如何入侵一台已关机的电脑:在 Intel ME 中运行未签名代码
How to hack a turned-off computer, or running unsigned code in Intel ME
这篇 Black Hat 2017 白皮书讨论 Intel Management Engine(ME)的安全问题:如何在 ME 中运行未签名代码,以及攻破处于关机状态的电脑的相关…
安全与密码学2017 · 543 分 · 107 评专业 · 约 40 分钟编辑精选比特币:一种点对点的电子现金系统(2008)
Bitcoin: A Peer-to-Peer Electronic Cash System (2008)
中本聪 2008 年发表的比特币白皮书,提出了无需可信第三方的点对点电子现金系统。
安全与密码学2017 · 536 分 · 394 评入门 · 约 45 分钟编辑精选GPRS 加密算法 GEA-1 的密码分析表明存在故意弱点
Cryptanalysis of GPRS Encryption Algorithms GEA-1 suggest intentional weakness
首次公开了对 GPRS 加密算法 GEA-1 和 GEA-2 的密码分析攻击。
安全与密码学2021 · 487 分 · 107 评专业 · 约 90 分钟编辑精选Signal 消息协议的形式化安全分析
A Formal Security Analysis of the Signal Messaging Protocol
用形式化方法分析 Signal 消息协议(TextSecure)的安全性:作者在多阶段密钥交换模型下,借助自动化证明工具对协议的密钥协商与 Double Ratchet 密钥更新…
安全与密码学2016 · 353 分 · 230 评专业 · 约 120 分钟编辑精选A2:模拟恶意硬件
A2: Analog Malicious Hardware
论文研究如何在芯片设计阶段植入模拟电路形式的恶意硬件后门,使其难以被常规检测发现。
安全与密码学2016 · 315 分 · 94 评专业 · 约 75 分钟编辑精选