方法使用了強大的加密算法,但密鑰大小較小,從而導致加密數據容易受到強力攻擊。
當前的密碼指南建議,AES 算法使用的密鑰長度至少應為 128 位。然而,計算能力的提高與因子分解技術[1] 的進步正在挑戰 128 位 AES 加密的安全性。
例 1:下列代碼采用弱加密算法且密鑰長度不夠:
ccStatus = CCCrypt( encryptOrDecrypt,
kCCAlgorithmDES,
typeOfSymmetricOpts,
(const void *)[self getSymmetricKeyBytes],
64,
iv,
(const void *) [plainText bytes],
plainTextBufferSize,
(void *)bufferPtr,
bufferPtrSize,
&movedBytes
);
[1] J. Cheng 307-digit key crack endangers 1024-bit RSA
[2] Standards Mapping - OWASP Top 10 2010 - (OWASP 2010) A7 Insecure Cryptographic Storage
[3] Standards Mapping - OWASP Top 10 2007 - (OWASP 2007) A8 Insecure Cryptographic Storage
[4] Standards Mapping - OWASP Top 10 2004 - (OWASP 2004) A8 Insecure Storage
[5] Standards Mapping - Security Technical Implementation Guide Version 3 - (STIG 3) APP3150.1 CAT II
[6] Standards Mapping - Security Technical Implementation Guide Version 3.4 - (STIG 3.4) APP3150.1 CAT II
[7] B. Chess and J. West, Secure Programming with Static Analysis.Boston, MA:Addison-Wesley, 2007.
[8] Cryptographic Algorithms and Key Sizes for Personal Identity Verification NIST
[9] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 310
[10] Standards Mapping - Web Application Security Consortium 24 + 2 - (WASC 24 + 2) Information Leakage
[11] Standards Mapping - FIPS200 - (FISMA) MP
[12] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 - (PCI 1.2) Requirement 3.6.1, Requirement 6.3.1.3, Requirement 6.5.8
[13] Standards Mapping - Payment Card Industry Data Security Standard Version 2.0 - (PCI 2.0) Requirement 3.6.1, Requirement 6.5.3
[14] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 - (PCI 1.1) Requirement 3.6.1, Requirement 6.5.8