Click to see the query in the CodeQL repository
Modern encryption relies on the computational infeasibility of breaking a cipher and decoding its message without the key. As computational power increases, the ability to break ciphers grows, and key sizes need to become larger as a result. Cryptographic algorithms that use too small of a key size are vulnerable to brute force attacks, which can reveal sensitive data.
Use a key of the recommended size or larger. The key size should be at least 128 bits for AES encryption, 256 bits for elliptic-curve cryptography (ECC), and 2048 bits for RSA, DSA, or DH encryption.
The following code uses cryptographic algorithms with insufficient key sizes.
To fix the code, change the key sizes to be the recommended size or larger for each algorithm.
Wikipedia: Key size.
Wikipedia: Strong cryptography.
OWASP: Testing for Weak Encryption.
NIST: Transitioning the Use of Cryptographic Algorithms and Key Lengths.
Common Weakness Enumeration: CWE-326.