What is public-key cryptography?
Public-key cryptography uses a pair of keys instead of one. The public key can be shared with anyone; the matching private key is kept secret by its owner. That simple idea lets two computers that have never met set up a secure connection, and lets anyone check who sent a message. It's in almost every secure connection, card payment and software update, and it's the part of today's cryptography that quantum computers threaten.
Two keys instead of one
Older cryptography, called symmetric, uses one secret key shared by both sides. It's fast and strong, but it has a chicken-and-egg problem: how do two parties agree that key in the first place, over a network anyone could be listening to? Public-key cryptography, invented in the 1970s, solved it. The two keys are made as a mathematically linked pair, but working out the private key from the public one is, for an ordinary computer, impossibly hard.
Two jobs
- Setting up shared secrets. Two systems use their key pairs to agree a fresh secret key, called key establishment or key agreement, without ever sending that secret across the network.
- Proving who sent something. A digital signature made with a private key can be checked by anyone with the public key. Certificates, signed software and signed payment messages all rely on this.
How it works with symmetric cryptography
Public-key cryptography is much slower than symmetric cryptography, so the two work as a team. When your banking app connects, public-key cryptography agrees a fresh key; then a symmetric algorithm such as AES encrypts everything else with it.
Why quantum computers threaten it
Today's public-key cryptography rests on two maths problems: factoring huge numbers (RSA) and a related problem on elliptic curves (ECC). Both are hard for ordinary computers. Shor's algorithm would let a large enough quantum computer solve both, working out private keys from public ones. Symmetric cryptography isn't affected in the same way; it only needs adequate key sizes.
What replaces it
The replacements are still public-key cryptography, just built on different maths: ML-KEM for agreeing keys, and ML-DSA, SLH-DSA and FN-DSA for signatures. They run on ordinary computers and keep the same two-key idea.
Common confusions
- "Post-quantum cryptography isn't public-key cryptography." It is. Only the underlying maths changes.
- "Longer RSA keys would fix it." No. Shor's algorithm scales to larger keys; the answer is migration, not a bigger key.
- "The public key is a weakness because it's public." No. It's designed to be shared. The weakness quantum computing would create is in the maths that links it to the private key.
Sources and further reading
Tags show what kind of source each one is (how sources are used). Checked against these sources on 12 October 2026. Spotted an error? Email hello@plainquantum.com and it will be corrected, with a note.
- Peer-reviewed paperNew directions in cryptographyWhitfield Diffie and Martin Hellman, IEEE Transactions on Information Theory, 1976
- Peer-reviewed paperA method for obtaining digital signatures and public-key cryptosystemsRivest, Shamir and Adleman, Communications of the ACM, 1978
- StandardFIPS 203: Module-Lattice-Based Key-Encapsulation Mechanism Standard (ML-KEM)NIST, 2024
- StandardPost-Quantum Cryptography project (status of FN-DSA and other work)NIST Computer Security Resource Center