Skip to content

Inadequate Encryption Strength

Description

The code uses an insufficient key size for DSA. NIST recommends a key size of 2048 or higher.

Examples

Insecure Code

scala
KeyPairGenerator.getInstance("RSA").initialize(1024);

Secure Code

scala
KeyPairGenerator.getInstance("RSA").initialize(2048);

Remediation

Increase the key size to at least 2048.

Rule Details

FieldValue
IDCODE-0026
CategoryCrypto
SeverityMEDIUM
CWECWE-326
ConfidenceHIGH
ImpactMEDIUM
LikelihoodMEDIUM
ExploitabilityMODERATE
Tagsencryption, key size
OWASPN/A