Asymmetric (public-key) cryptography uses a mathematically linked key pair: anyone can encrypt with the public key, but only the matching private key can decrypt — so the public key never needs to be kept secret.
RSA: n = p·q (p, q large primes)
encrypt: c = m^e mod n
decrypt: m = c^d mod n
security ≈ difficulty of factoring n
ECC: public key Q = d·G (scalar mult. on curve, G = base point)
shared secret (ECDH): S = d_A·Q_B = d_B·Q_A
security ≈ difficulty of the elliptic-curve discrete-log problem
Roughly equal security, very different key sizes:
80-bit ≈ RSA 1024 ≈ ECC 160
112-bit ≈ RSA 2048 ≈ ECC 224
128-bit ≈ RSA 3072 ≈ ECC 256
192-bit ≈ RSA 7680 ≈ ECC 384
- Algorithm — RSA locks the message with modular exponentiation (the rotating number ring); ECC locks it by hopping along an elliptic curve (the point-doubling path). ECC reaches the same security with far smaller keys.
- Key size — more digits/points to search before the private key can be brute-forced; also more work per operation, which is why the relative-speed stat drops as it grows.
- Encrypt vs Sign — encrypt uses the receiver's public key so only they can open it; sign uses the sender's private key so anyone can verify authenticity with the public key.
- Hybrid session — real protocols (TLS included) use asymmetric crypto only to exchange a short-lived symmetric key, then encrypt the actual data with fast symmetric ciphers like AES — asymmetric math alone is too slow for bulk data.