Elliptic Curve Cryptography
1. What is ECC?
Elliptic Curve Cryptography is a form of public-key cryptography based on the mathematics of elliptic curves over finite fields.
-
Like RSA, it allows key exchange, digital signatures, and encryption.
-
But ECC achieves the same level of security with much smaller key sizes.
- RSA 3072-bit ≈ ECC 256-bit security.
2. Elliptic Curve Basics
An elliptic curve is defined by an equation of the form:
- Let are constants chosen such that the curve has no singularities (i.e., ).
- means calculations are done modulo a prime .
Each point on this curve, plus a special point at infinity, form an abelian group under an operation called point addition.
3. Group Operation
ECC works because we can define arithmetic on curve points:
- Point addition: Given two points and , we can compute .
- Point doubling: If , then .
- Scalar multiplication: (k times).
This scalar multiplication is easy to compute but hard to reverse. The hard problem is called the Elliptic Curve Discrete Logarithm Problem (ECDLP): given and , find . This is the foundation of ECC security.
4. Cryptographic Applications
ECC is used in many protocols:
- Key Exchange (ECDH): Two parties exchange points and derive a shared secret.
- Digital Signatures (ECDSA, EdDSA): Prove ownership of a private key without revealing it.
- Encryption (ECIES): Encrypt data using public keys on elliptic curves.
5. Example: ECDH Key Exchange
- Public parameters: curve , generator point .
- Alice chooses private key , computes public key .
- Bob chooses private key , computes public key .
- Alice computes shared secret: .
- Bob computes shared secret: . Both derive the same secret , but no outsider can compute it without solving ECDLP.
6. Common Curves
- secp256k1 → used in Bitcoin and Ethereum.
- Curve25519 → used in Signal, TLS, SSH (favored for speed and security).
- P-256 (secp256r1) → standardized by NIST.