关于AES-CBC的安全问题
发布于 4 年前 作者 ming87 4258 次浏览 来自 分享

搜集有关 AES-CBC 安全性的资料。AES-CBC 出现过两种 attacks: bit flipping attacks 和 padding oracles attacks。微软文档认为AES-CBC已不再安全,推荐使用 AEAD-AES-GCM。而 nodejs 帮助文档中的Crypto安全性描述环节里没有说 AES-CBC 不安全。有关各方的部分资料摘要如下,供参考交流。

  1. ietf.org:TLS1.3(rfc8446)与 TLS1.2 的主要区别之一(有关对称加密):只保留 AEAD 加密算法。其他的不再支持。链接:https://tools.ietf.org/html/rfc8446

  2. nist.gov:没有找到有关文档(明确描述 aes-cbc 存在漏洞)。

  3. docs.microsoft.com 中关于 AES-CBC 的观点:由于 padding oracle attack,AES-CBC不再安全。链接:https://docs.microsoft.com/en-us/dotnet/standard/security/vulnerabilities-cbc-mode

  4. nodejs.org 文档中未提到 AES-CBC 的问题:帮助文档的 crypto 章节里只提到 MD5, SHA1 等不再使用。未提及 AES-CBC 的问题。链接:https://nodejs.org/dist/latest-v15.x/docs/api/crypto.html#crypto_support_for_weak_or_compromised_algorithms

  5. wikipedia.org 条目 Padding oracle attack:指出该 attack 涉及到 AES-CBC 等加密模式。链接:https://en.wikipedia.org/wiki/Padding_oracle_attack

  6. blog.cloudflare.com 认为:在 TLS 场合不要再用aes-cbc,而在静态加密环境下仍然可以采用。(原文:There are still valid uses of CBC mode (such as for encrypting static content), but in the context of TLS, MAC-then-encrypt with CBC has had too many issues to be ignored.)链接:https://blog.cloudflare.com/padding-oracles-and-the-decline-of-cbc-mode-ciphersuites/

  7. cisco.com 的 support docs 中的一篇文章认为,能拦截 SSL/TLS 连接并能不断发送新数据,这时才能利用此漏洞。(原文:The vulnerability can only be exploited by someone that intercepts data on the SSL/TLS connection, and also actively sends new data on that connection.)链接:https://www.cisco.com/c/en/us/support/docs/security/email-security-appliance/118518-technote-esa-00.html

  8. baidu_secrity @ blog.csdn.net 文章认为:AES-CBC模式本没有错,是TLS协议中对AES-CBC的不当应用使得攻击成为了可能。链接:https://blog.csdn.net/baidu_secrity/article/details/106789208

  9. 关于国密 SM4 加密算法

9.1  gmbz.org.cn 收录的SM4 文档:无加密模式描述。未提及(类似AES-CBC的)问题。链接:http://www.gmbz.org.cn/main/viewfile/20180108015408199368.html

9.2  ietf.org 收录的 SM4 文档:有加密模式描述:sm4-ecb, sm4-cbc, sm4-cfb, sm4-ofb, sm4-ctr。未提及(类似AES-CBC 的)问题。链接:https://tools.ietf.org/id/draft-ribose-cfrg-sm4-09.html

9.3 微信文档中提供的国密算法 js 库:微信官方文档-扩展能力-工具类库-国密算法中有js库下载和使用举例。未提及(类似AES-CBC的)问题。sm2:公钥秘钥,sm3:hash,sm4:对称加密。链接:https://developers.weixin.qq.com/miniprogram/dev/extended/utils/sm-crypto.html

  1. 推荐几个 js 和 CSharp 加密库:这些加密库的安全性完整性无更多资料。

10.1 js库:nodejs-CryptoJS(不含aes-gcm), nodejs-Crypto(含aes-gcm但不能install), Forge(含aes-gcm), sjcl(含aes-gcm)。

10.2 C#.NET库:BouncyCastle.Crypto.dll。

回到顶部