搜集有關 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
10. 推薦幾個 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。