Every coffee helps keep the servers running. Every book sale funds the next tool I'm dreaming up. You're not just supporting a site — you're helping me build what developers actually need.
Elliptic Curve Digital Signature Algorithm (ECDSA) is a cryptographic algorithm used to ensure that data can only be signed by its rightful owners. It's widely used in cryptocurrencies like Bitcoin and Ethereum, as well as TLS/SSL, SSH, and secure messaging protocols.
ECDSA is a variant of the Digital Signature Algorithm (DSA) that uses elliptic curve cryptography. It provides the same level of security as RSA but with significantly smaller key sizes, making it more efficient for:
k (critical for security)R = k × G on the curver = R.x mod ns = k⁻¹(hash + r × privateKey) mod n(r, s)w = s⁻¹ mod nu1 = hash × w mod nu2 = r × w mod nP = u1 × G + u2 × PublicKeyP.x mod n == rA secret 256-bit integer known only to the owner. Used to generate signatures. In Bitcoin, this is derived from a random number. Must be kept absolutely secret.
Derived from the private key using elliptic curve point multiplication: PublicKey = privateKey × G. Can be shared publicly and used to verify signatures.
Proves that the signer has the private key without revealing it. Consists of two values (r, s) typically encoded as DER format or concatenated raw bytes.
| Feature | ECDSA (256-bit) | RSA (3072-bit) | Winner |
|---|---|---|---|
| Security Level | 128-bit | 128-bit | Tie |
| Key Size | 256 bits (32 bytes) | 3072 bits (384 bytes) | ECDSA |
| Signature Size | 64 bytes | 384 bytes | ECDSA |
| Sign Speed | Fast | Slow | ECDSA |
| Verify Speed | Moderate | Fast | RSA |
| Adoption | Growing (TLS 1.3, Bitcoin) | Legacy (widespread) | Depends |
| Curve | Bits | Security | Usage | Notes |
|---|---|---|---|---|
secp256k1 |
256 | 128-bit | Bitcoin, Ethereum, Litecoin | Koblitz curve, efficient for verification |
P-256 (secp256r1) |
256 | 128-bit | TLS, WebAuthn, FIDO2, Apple | NIST standard, most widely supported |
P-384 (secp384r1) |
384 | 192-bit | Government, NSA Suite B | Required for TOP SECRET classification |
P-521 (secp521r1) |
521 | 256-bit | High-security applications | Maximum NIST curve security |
Ed25519 |
256 | 128-bit | SSH, Signal, Tor | EdDSA variant, deterministic signatures |
brainpoolP256r1 |
256 | 128-bit | European standards, German BSI | Alternative to NIST curves |
Bitcoin, Ethereum use ECDSA for transaction signing
HTTPS certificates and key exchange
Secure shell authentication keys
FIDO2, WebAuthn, passkeys
# List available curves
openssl ecparam -list_curves
# Generate EC key pair (secp256k1 for Bitcoin compatibility)
openssl ecparam -name secp256k1 -genkey -noout -out ec-private.pem
# Extract public key
openssl ec -in ec-private.pem -pubout -out ec-public.pem
# View key details
openssl ec -in ec-private.pem -text -noout
# Sign a message (creates binary signature)
openssl dgst -sha256 -sign ec-private.pem -out signature.bin message.txt
# Convert signature to Base64
base64 signature.bin > signature.b64
# Verify signature
openssl dgst -sha256 -verify ec-public.pem -signature signature.bin message.txt
# Generate key for P-256 (NIST) curve
openssl ecparam -name prime256v1 -genkey -noout -out p256-key.pem
k - leads to private key recoveryk. In 2010, Sony's PlayStation 3 private key was compromised because they used the same k value for multiple signatures. Always use cryptographically secure random number generators or deterministic signature schemes (RFC 6979).