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 can use public-key cryptography to set up a shared secret key without exposing it to an eavesdropper. This job is called key establishment. With key agreement, both sides contribute to determining the key; with key transport, one side chooses a key and sends it securely protected. Establishing a shared key does not, by itself, confirm who is on the other end.
- 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 sets up a fresh shared 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 different 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 encryption faces a different quantum threat: Grover's algorithm speeds up generic key searches, so appropriately chosen key lengths remain important.
What replaces it
The replacements are still public-key cryptography, just built on different maths: ML-KEM, a key-encapsulation mechanism, for establishing shared secret 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.
Where this comes up
- Lesson"Harvest now, decrypt later," explainedQuantum and security · 8 min
- LessonPost-quantum cryptography for non-engineersQuantum and security · 14 min
- LessonWhy your bank is already preparingBanking and payments journey · 14 min
- GuideChapter 1 · What quantum threatens in a bank, and what it doesn'tProfessionals · Banking guide
- GuideChapter 2 · Where cryptography lives in a payments estateProfessionals · Banking guide
Sources and further reading
Tags show the kind of source (how sources are chosen and checked). Checked against these sources on 12 October 2026.
- 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
Written by Muhammad Atif · Reviewed 30 October 2026 · Report a correction