Nonsecure RSA public exponent
Context used in key generation is associated with low exponent value
Description
This defect occurs when you attempt RSA key generation by using a context object that is associated with a low public exponent.
For instance, you set a public exponent of 3 in the context object, and then use it for key generation.
/* Set public exponent */ ret = BN_dec2bn(&pubexp, "3"); /* Initialize context */ ctx = EVP_PKEY_CTX_new_id(EVP_PKEY_RSA, NULL); pkey = EVP_PKEY_new(); ret = EVP_PKEY_keygen_init(kctx); /* Set public exponent in context */ ret = EVP_PKEY_CTX_set_rsa_keygen_pubexp(ctx, pubexp); /* Generate key */ ret = EVP_PKEY_keygen(kctx, &pkey);
Risk
A low RSA public exponent makes certain kinds of attacks more damaging, especially when a weak padding scheme is used or padding is not used at all.
Fix
It is recommended to use a public exponent of 65537. Using a higher public exponent can make the operations slower.
Examples
Result Information
Group: Cryptography |
Language: C | C++ |
Default: Off |
Command-Line Syntax:
CRYPTO_RSA_LOW_EXPONENT |
Impact: Medium |
Version History
Introduced in R2018a
See Also
Incompatible
padding for RSA algorithm operation
| Missing padding
for RSA algorithm
| Missing blinding
for RSA algorithm
| Weak padding for
RSA algorithm
| Find defects (-checkers)
Topics
- Interpret Bug Finder Results in Polyspace Desktop User Interface
- Interpret Bug Finder Results in Polyspace Access Web Interface (Polyspace Access)
- Address Results in Polyspace User Interface Through Bug Fixes or Justifications
- Address Results in Polyspace Access Through Bug Fixes or Justifications (Polyspace Access)