Skip to content

Inadequate RSA Key Size

Description

The RSA key size is insufficient by NIST standards. It is recommended to use a key length of 2048 or higher. Smaller key sizes are more susceptible to brute-force attacks.

Examples

Insecure Code

ruby
OpenSSL::PKey::RSA.new(1024)

Secure Code

ruby
OpenSSL::PKey::RSA.new(2048)

Remediation

Generate RSA keys with a size of 2048 bits or more.

Rule Details

FieldValue
IDCODE-0520
CategoryCrypto
SeverityMEDIUM
CWECWE-326
ConfidenceHIGH
ImpactMEDIUM
LikelihoodMEDIUM
ExploitabilityMODERATE
Tagsencryption, rsa
OWASPA3:2017-Sensitive Data Exposure, A02:2021-Cryptographic Failures

References