Skip to content

Inadequate encryption strength

Description

The application is generating an RSA key that is less than the recommended 2048 bits. The National Institute of Standards and Technology (NIST) deprecated signing Digital Certificates that contained RSA Public Keys of 1024 bits in December 2010.

Examples

Insecure Code

java
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); keyPairGenerator.initialize(1024);

Secure Code

java
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("Ed25519"); return keyPairGenerator.generateKeyPair();

Remediation

Use a key size greater than 2048 when generating RSA keys or consider upgrading to the newer asymmetric algorithm such as Ed25519.

Rule Details

FieldValue
IDCODE-0693
CategoryCrypto
SeverityMEDIUM
CWECWE-326
ConfidenceHIGH
ImpactMEDIUM
LikelihoodMEDIUM
ExploitabilityMODERATE
Tagsinadequate encryption strength, RSA key size
OWASPA3:2017-Sensitive Data Exposure, A02:2021-Cryptographic Failures