Mbed-TLS / TF-PSA-Crypto

Reference implementation of the PSA Cryptography API
Apache License 2.0
8 stars 7 forks source link

Consider removing support for small RSA keys #111

Open gilles-peskine-arm opened 1 week ago

gilles-peskine-arm commented 1 week ago

There is now a movement to stop supporting smaller RSA keys — see Hacking a Virtual Power Plant, OpenSSL issue, Go issue.

Data points: 512-bit RSA has been trivially broken for more than a decade. 1024-bit RSA still holds safe to academic research. The latest public factoring record is 829 bits (taking roughly 2700 core-years).

Since Mbed TLS 3.5.0, we prevent the generation of RSA keys smaller than 1024 bits. The initial motivation was to block users from unwittingly requesting a 128-byte or 256-byte key, but getting a 128-bit or 256-bit key. It also prevented the use of a bit-size that is sensible for symmetric keys or for ECC but not for RSA. The minimum size is a compile-time option (MBEDTLS_RSA_GEN_KEY_MIN_BITS). Since generating such small RSA keys is not sensible, we considered this change acceptable for a minor release. We did not change our long-time support branch (but it was a close call).

The goal of this issue is to decide whether we want change our RSA limits in Mbed TLS 4.0 and TF-PSA-Crypto 1.0, and if decided, implement this decision.

Added to the 4.0 planning board since this is potentially a feature removal that we would not want to do in a minor release.