ECDSA
Elliptic Curve Digital Signature Algorithm on NIST curves and secp256k1
Overview
ECDSA is the elliptic-curve version of the Digital Signature Algorithm and the most widely deployed signature scheme on the internet. It provides compact, fast classical signatures but is not secure against large quantum computers.
A key pair is a secret scalar d and a public point Q = dG on an elliptic curve. To sign, the signer picks a per-signature secret nonce k, computes the x-coordinate r of kG, and combines r, the message hash and d into the value s. Verification uses only Q, the hash and (r, s). Security relies on the elliptic curve discrete logarithm problem.
The nonce is the scheme's weak point. Reusing k, or leaking even a few bits of it across many signatures, allows recovery of the private key, as happened with the Sony PlayStation 3 signing key and several cryptocurrency wallets. RFC 6979 deterministic nonce generation removes the dependence on a random number generator, and FIPS 186-5 permits it. ECDSA signatures are also malleable: (r, -s) is a valid signature when (r, s) is.
Four curves are present: NIST P-256, P-384 and P-521, as specified in FIPS 186-5 and SEC 2, and secp256k1, the Koblitz curve used by Bitcoin and Ethereum and registered for JOSE and COSE in RFC 8812. Hashes are normally SHA-256 for P-256 and secp256k1, SHA-384 for P-384 and SHA-512 for P-521. Signatures are commonly encoded either as a DER sequence or as fixed-length r and s concatenated.
History
1992–2023ECDSA proposed by Scott Vanstone
Standardised in ANSI X9.62
Added to FIPS 186-2
Deterministic nonces specified in RFC 6979
FIPS 186-5 published
How it works
- KeyGen picks a random scalar d and computes Q = dG.
- Sign hashes the message to e, chooses a nonce k (random or per RFC 6979), and sets r = x(kG) mod n.
- It computes s = k^-1 (e + r*d) mod n and outputs (r, s).
- Verify computes u1 = e/s and u2 = r/s and checks that x(u1*G + u2*Q) equals r.
Security notes
Broken by a large quantum computer running Shor's algorithm, so migration to ML-DSA or hybrid signatures is advised for long-lived keys. Nonce reuse or bias leaks the private key; use RFC 6979 or hedged nonces and constant-time scalar multiplication.
Typical uses
Variants in NextSSL
13| Algorithm | Tier | Sizes (bytes) | Standards | API |
|---|---|---|---|---|
| ECDSA-P-256 ecdsa-p256 |
standard FIPS | pk 65 · sk 32 · sig 64 · seed 32 · ctx 0 | FIPS 186-5, RFC 6979, SEC 1, RFC 9864 | safe |
| ECDSA-P-384 ecdsa-p384 |
standard FIPS | pk 97 · sk 48 · sig 96 · seed 48 · ctx 0 | FIPS 186-5, RFC 6979, SEC 1, RFC 9864 | safe |
| ECDSA-P-521 ecdsa-p521 |
standard FIPS | pk 133 · sk 66 · sig 132 · seed 66 · ctx 0 | FIPS 186-5, RFC 6979, SEC 1, RFC 9864 | safe |
| ECDSA-secp256k1 ecdsa-secp256k1 |
standard | pk 65 · sk 32 · sig 64 · seed 32 · ctx 0 | SEC 2, RFC 6979, RFC 8812 | safe |
| Libecc-ECDSA-Brainpoolp256r1-SHA-256 libecc-ecdsa-brainpoolp256r1-sha256 |
unverified | pk 64 · sk 32 · sig 64 · seed 32 · ctx 0 | ISO/IEC 14888-3, ANSI X9.62 | root |
| Libecc-ECDSA-Brainpoolp320r1-SHA-384 libecc-ecdsa-brainpoolp320r1-sha384 |
unverified | pk 80 · sk 40 · sig 80 · seed 40 · ctx 0 | ISO/IEC 14888-3, ANSI X9.62 | root |
| Libecc-ECDSA-Brainpoolp384r1-SHA-384 libecc-ecdsa-brainpoolp384r1-sha384 |
unverified | pk 96 · sk 48 · sig 96 · seed 48 · ctx 0 | ISO/IEC 14888-3, ANSI X9.62 | root |
| Libecc-ECDSA-Brainpoolp512r1-SHA-512 libecc-ecdsa-brainpoolp512r1-sha512 |
unverified | pk 128 · sk 64 · sig 128 · seed 64 · ctx 0 | ISO/IEC 14888-3, ANSI X9.62 | root |
| Libecc-ECDSA-Frp256v1-SHA-256 libecc-ecdsa-frp256v1-sha256 |
unverified | pk 64 · sk 32 · sig 64 · seed 32 · ctx 0 | ISO/IEC 14888-3, ANSI X9.62 | root |
| Libecc-ECDSA-Gost2001-Cryptopro-A-Streebog256 libecc-ecdsa-gost2001-cryptopro-a-streebog256 |
unverified | pk 64 · sk 32 · sig 64 · seed 32 · ctx 0 | ISO/IEC 14888-3, ANSI X9.62 | root |
| Libecc-ECDSA-Gost256-Streebog256 libecc-ecdsa-gost256-streebog256 |
unverified | pk 64 · sk 32 · sig 64 · seed 32 · ctx 0 | ISO/IEC 14888-3, ANSI X9.62 | root |
| Libecc-ECDSA-Gost512-Streebog512 libecc-ecdsa-gost512-streebog512 |
unverified | pk 128 · sk 64 · sig 128 · seed 64 · ctx 0 | ISO/IEC 14888-3, ANSI X9.62 | root |
| Libecc-ECDSA-Secp224r1-SHA-256 libecc-ecdsa-secp224r1-sha256 |
unverified | pk 56 · sk 28 · sig 56 · seed 28 · ctx 0 | ISO/IEC 14888-3, ANSI X9.62 | root |
Frequently asked questions
Which ECDSA variants does NextSSL include?
NextSSL registers 13 ECDSA variants: ecdsa-p256, ecdsa-p384, ecdsa-p521, ecdsa-secp256k1, libecc-ecdsa-brainpoolp256r1-sha256, libecc-ecdsa-brainpoolp320r1-sha384, libecc-ecdsa-brainpoolp384r1-sha384, libecc-ecdsa-brainpoolp512r1-sha512, libecc-ecdsa-frp256v1-sha256, libecc-ecdsa-gost2001-cryptopro-a-streebog256 and more.
Families with similar names
sign · 13 variants
sign · 13 variants
sign · 3 variants
sign · 13 variants
sign · 13 variants
sign · 13 variants
sign · 13 variants
Other digital signatures
All 503Related
Deterministic hashing of byte strings to elliptic curve points with the SSWU map
SHA-2The NIST Merkle–Damgård hash family behind most of today's TLS, signatures and software
ECDH (including X25519 and X448)Elliptic-curve Diffie-Hellman key agreement on NIST curves, Curve25519 and Curve448
EdDSADeterministic Edwards-curve signatures: Ed25519 and Ed448
ML-DSANIST's primary post-quantum signature scheme, standardised in FIPS 204
Schnorr signatures (BIP 340)Bitcoin's x-only Schnorr signatures on secp256k1, introduced with Taproot