What is the difference between RSA and ECDSA keys?
Short answer
RSA and ECDSA are two public key algorithms used in certificates. RSA relies on the difficulty of factoring large numbers and has the widest client compatibility, but it requires a key of at least 2048 bits to be secure; ECDSA relies on elliptic curves and provides the same security level with a much shorter key (P-256 is roughly at the level of RSA 3072), so its signing operations are lighter. In TR7, the key algorithm is selected from RSA 2048/3072/4096 and ECDSA P-256/P-384 in the Key Algorithm field of the forms in which keys are generated (e.g. Private Key Library), and in the Acme.sh Key Length field for ACME certificates.
Where It Is Used in TR7
| Where | Field / label | What for |
|---|---|---|
| Certificates & PKI → Private Key Library | Key Algorithm: RSA 2048 (default), RSA 3072, RSA 4096, ECDSA P-256, ECDSA P-384 | The key to be generated in the library |
| SSL/TLS Certificates → CSR (External CA) | Key Algorithm (default RSA 2048) | The new key to be generated for the CSR |
| Certificates & PKI → Certificate Authorities (CA) | Key Algorithm (default RSA 4096) | The key of the Internal CA |
| Certificates & PKI → Certificate Profiles | Key Algorithm (default RSA 2048) | The key of the certificates issued by the Internal CA |
| SSL/TLS Certificates → ACME.SH | Acme.sh Key Length: ec-256 (default), ec-384, ec-521, 2048, 3072, 4096 | The key of the certificate obtained with ACME (ec- is elliptic curve, the numbers are RSA bit lengths) |
| SSL/TLS Certificates → preview → Details | Cert. Algorithm, Key Length | Seeing the algorithm of the installed certificate |
Comparison
| RSA | ECDSA | |
|---|---|---|
| Basis | Factoring of large numbers | Discrete logarithm on an elliptic curve |
| Sizes selectable in TR7 | 2048, 3072, 4096 bits | P-256, P-384 (additionally ec-521 in ACME) |
| 128-bit security level (NIST SP 800-57) | RSA 3072 | ECDSA P-256 |
| Signing cost | Higher | Lower |
| Compatibility | The widest | All current clients |
Common Misconceptions
- "An ECDSA key is weaker because it is short." On elliptic curves, a short key provides the same security level as a much longer RSA key.
- "The key algorithm is independent of the cipher suite." In TLS 1.2, the authentication algorithm is part of the cipher suite; an ECDSA certificate is used with
ECDHE-ECDSA-…suites, and an RSA certificate withECDHE-RSA-…suites. In TLS 1.3, this distinction is not in the cipher suite but in the signature algorithm in the handshake. - "The key length changes by itself when the certificate is renewed." The algorithm used in the renewal is determined by the setting of the record: Acme.sh Key Length for an ACME certificate, and the Key Algorithm field in Certificate Profiles for an Internal CA certificate. In a Manual or PFX certificate, the key comes with the uploaded file; for a different algorithm, a new certificate is uploaded with a new key (What is the difference between renewing a certificate and rekeying it?).
How it is done in the documentation
