# What Is ECDSA? Definition and Examples

> ECDSA (Elliptic Curve Digital Signature Algorithm) is an elliptic-curve signature scheme used in TLS certificates as a smaller, faster alternative to RSA.

Source: https://ssl.sh/glossary/ecdsa/
Last updated: 2026-11-10

ECDSA is the elliptic-curve version of the Digital Signature Algorithm, standardized by NIST in FIPS 186. In TLS certificates it is used with the [P-256](https://ssl.sh/glossary/p-256/) and P-384 curves. A P-256 key offers about 128-bit security, comparable to 3072-bit [RSA](https://ssl.sh/glossary/rsa/), while the raw signature is only 64 bytes. Every ECDSA signature uses a secret per-signature nonce; if a nonce is ever reused or predictable, the private key can be computed from the signatures, which is why RFC 6979 defines deterministic nonce generation.

## Why it matters
ECDSA certificates make handshakes smaller and server-side signing much cheaper than RSA at a similar or higher security level. As of November 2026, WebPKI CAs issue TLS certificates with RSA or ECDSA (P-256/P-384) keys, and many ACME clients can request ECDSA keys. The main trade-off is compatibility with very old clients that only support RSA, which servers can handle by installing both an ECDSA and an RSA certificate.

## Example
Generate a P-256 key and CSR, then serve ECDSA and RSA certificates side by side in nginx:

```bash
openssl ecparam -name prime256v1 -genkey -noout -out example.com.ecdsa.key
openssl req -new -key example.com.ecdsa.key -out example.com.csr -subj "/CN=example.com"
```

```nginx
ssl_certificate     /etc/nginx/certs/example.com.ecdsa.crt;
ssl_certificate_key /etc/nginx/certs/example.com.ecdsa.key;
ssl_certificate     /etc/nginx/certs/example.com.rsa.crt;
ssl_certificate_key /etc/nginx/certs/example.com.rsa.key;
```

## Common misconceptions
- **"An ECDSA certificate must be issued by an ECDSA CA."** Chains can mix algorithms; an ECDSA leaf signed by an RSA intermediate is common.
- **"256-bit ECDSA is weaker than 2048-bit RSA."** Key lengths are not comparable across algorithms; P-256 is the stronger of the two.
- **"Signature randomness is a minor detail."** A repeated or biased nonce leaks the private key, so use well-tested libraries rather than custom code.

## Related terms

- [ECC](https://ssl.sh/zh/glossary/ecc/): ECC 即椭圆曲线密码学，是基于有限域上椭圆曲线代数结构的公钥密码技术，能用较短的密钥提供很高的安全强度。
- [P-256](https://ssl.sh/zh/glossary/p-256/): P-256 是 NIST 标准化的 256 位素数域椭圆曲线，也叫 secp256r1 或 prime256v1，广泛用于 ECDSA 证书和 ECDHE 密钥交换。
- [RSA](https://ssl.sh/zh/glossary/rsa/): RSA 是 1977 年提出的公钥算法，TLS 用它对证书和握手进行签名，在 TLS 1.3 之前还用它传输会话密钥。
- [数字签名](https://ssl.sh/zh/glossary/digital-signature/): 数字签名是用私钥对消息计算出的一个值，任何持有对应公钥的人都能验证它，从而确认消息来源和内容未被篡改。
- [Ed25519](https://ssl.sh/zh/glossary/ed25519/): Ed25519 是在 Curve25519 爱德华兹形式上实现的 EdDSA 签名方案，由 RFC 8032 定义，公钥 32 字节，签名 64 字节且为确定性签名。
- [ECDHE](https://ssl.sh/zh/glossary/ecdhe/): ECDHE 是椭圆曲线上的临时 Diffie-Hellman 密钥交换，TLS 双方每次握手都生成新的椭圆曲线密钥对，并据此协商出共享密钥。
- [密钥长度](https://ssl.sh/zh/glossary/key-size/): 密钥长度是密钥的位数，其安全含义取决于算法，例如 256 位的 ECDSA 密钥比 2048 位的 RSA 密钥更强。
