CodeQL queries 1.23
Using broken or weak cryptographic algorithms can leave data vulnerable to being decrypted.
Many cryptographic algorithms provided by cryptography libraries are known to be weak, or flawed. Using such an algorithm means that an attacker may be able to easily decrypt the encrypted data.
Ensure that you use a strong, modern cryptographic algorithm. Use at least AES-128 or RSA-2048.
The following code shows an example of using the
advapi windows API to decrypt some data.
When creating a key, you must specify which algorithm to use. The first example uses DES
which is an older algorithm that is now considered weak. The second example uses AES, which
is a strong modern algorithm.
- NIST, FIPS 140 Annex a: Approved Security Functions.
- NIST, SP 800-131A: Transitions: Recommendation for Transitioning the Use of Cryptographic Algorithms and Key Lengths.
- Common Weakness Enumeration: CWE-327.