PLAIN QUANTUM
Search

What is public-key cryptography?

  • Level: Beginner
  • 4 min read
  • Quick answer
The short answer

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.

Public keyPrivate key hand out copies kept secret Public keyPrivate key hand out copies kept secret
An analogy, not the maths, and only for keeping things secret: anyone can snap your padlock shut, but only your private key opens it. The two keys are made as a pair; sharing the public one is safe as long as nobody can work out the private one from it. Signatures work differently: the signer's private key makes the signature, the matching public key checks it, and nothing is hidden (see digital signatures). Working out the private key from the public one is exactly what a large quantum computer could do for RSA and elliptic-curve keys.

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.

app bank 1 handshake 2 encrypted data quantum target app bank 1 handshake 2 encrypted data quantum target
Public-key cryptography does the small, hard job of getting a shared secret between two parties who have never met. Symmetric cryptography then does the heavy lifting with that secret. Quantum computing threatens step 1, which is why the migration is mostly about public-key cryptography.

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

Sources and further reading

Tags show the kind of source (how sources are chosen and checked). Checked against these sources on 12 October 2026.

  1. Peer-reviewed paperNew directions in cryptographyWhitfield Diffie and Martin Hellman, IEEE Transactions on Information Theory, 1976
  2. Peer-reviewed paperA method for obtaining digital signatures and public-key cryptosystemsRivest, Shamir and Adleman, Communications of the ACM, 1978
  3. StandardFIPS 203: Module-Lattice-Based Key-Encapsulation Mechanism Standard (ML-KEM)NIST, 2024
  4. 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