Public-key cryptography: weaknesses and attacks
The man-in-the-middle attack, weak keys, side channels and the quantum threat: where public-key cryptography can fail.
- Man in the middle
- If an adversary replaces Bruno’s public key with their own, Anna encrypts for the adversary while believing she is encrypting for Bruno. That is why certificates or key fingerprint checks are needed.
- Faulty random generators
- Keys generated with little randomness can be guessed or share factors with other keys.
- Keys that are too short
- Parameters once secure become attackable as computing power grows.
- Vulnerable implementations
- Programming errors, overly informative error messages, side channels such as timing and power consumption.
- Theft of the private key
- All security depends on safeguarding the private key: if it is stolen, the adversary becomes you.
- Quantum computers
- Shor’s algorithm would break RSA, Diffie-Hellman and elliptic curves: hence post-quantum cryptography.
Public-key cryptography today
Where public-key cryptography is used every day: HTTPS, digital signatures, messaging, passkeys, cryptocurrencies, software updates.
The pages of this topic
Back to the overviewPublic-key cryptography: how it works
The open padlock as a metaphor, encryption with the public key, signing with the private key and hybrid cryptography.
Public-key cryptography: history
From the secret insights of Britain’s GCHQ to Diffie and Hellman’s paper, from RSA to elliptic curves and certificate infrastructures.
Public-key cryptography: the maths
Trapdoor one-way functions: multiplication and factoring, modular exponentiation and the discrete logarithm.
Public-key cryptography: worked example
A digital signature with small numbers, using the example RSA keys, to see how private and public keys work together.
Public-key cryptography: try it yourself
Exercises on modular exponentiation, one-wayness and verifying a signature, with solutions.
Public-key cryptography: frequently asked questions
Short answers to the most common doubts about public-key cryptography.