What is public-key cryptography?

Public-key cryptography, also called asymmetric cryptography, uses two related keys instead of one shared secret. The public key can be given to anyone and is used to encrypt data or check a signature. The private key is kept secret by its owner and is used to decrypt that data or create the signature.

NIST describes it as cryptography that “uses two separate keys to exchange data, one to encrypt or digitally sign the data and one for decrypting the data or verifying the digital signature.”1

Also called: Asymmetric cryptography, Asymmetric encryption, Public key encryption

Updated November 2026. Sources are numbered and listed at the end.

How public-key cryptography works

Each person or device has a key pair. The two keys are linked by math, but in one direction only: NIST says “given the public key, it is computationally infeasible to derive the private key.”1 That is what makes it safe to publish the public key.

To send someone a secret, you use their public key. Only their private key can undo it, so it doesn’t matter who else saw the public key. As NIST notes, this lets two parties communicate securely without first sharing a secret key.1 With symmetric cryptography alone, they would have to agree on that key some other way in advance.

The private key is “uniquely associated with the owner and is not made public.”2 Whoever holds it can read what was encrypted to it and sign in the owner’s name, so where it is kept matters more than anything else.

What it is used for

  • Agreeing on a key. Two sides use their key pairs to arrive at a shared secret over an open network. This is how TLS, VPNs and messaging apps start every session. X25519 and ML-KEM work this way.
  • Encrypting to someone. Email encryption standards such as PGP and S/MIME encrypt each message with a fresh key and lock that key with the recipient’s public key.
  • Digital signatures. The owner signs with the private key and anyone can check the signature with the public key, which proves who sent something and that it wasn’t changed.2 Passkeys and software updates rely on this.

Public-key vs symmetric cryptography

The two families of cryptography, side by side.
ComparedPublic-key (asymmetric)Symmetric
KeysA public key and a private keyOne shared secret key
Sharing the keyThe public key can be publishedMust be kept secret by everyone who has it
SpeedSlowerFast
Typical jobAgreeing on keys and signingEncrypting the data itself
ExamplesRSA, X25519, ML-KEM, ML-DSAAES-256

In practice the two work together, which is called hybrid encryption: a public-key step sets up a fresh symmetric key, and that key encrypts the message or the connection.

Public-key cryptography and quantum computers

The public-key methods in wide use today, RSA and elliptic curves such as X25519, rest on math problems that a large quantum computer running Shor’s algorithm could solve. NIST has published replacements built on different math, ML-KEM for key establishment in FIPS 203 and ML-DSA for signatures in FIPS 204, and its draft transition plan proposes deprecating the weaker RSA and elliptic-curve sizes after 2030 and disallowing both after 2035.3

Until the new methods have a long track record, many systems use both at once, a classical and a post-quantum key exchange combined, so the connection stays safe as long as either one holds.

Sources

  1. NIST Computer Security Resource Center, Glossary: public key cryptography, definitions from NIST SP 800-56B Rev. 2; see also asymmetric cryptography, definition from NIST SP 800-77 Rev. 1.
  2. NIST Computer Security Resource Center, Glossary: private key, definition from FIPS 186-5.
  3. NIST, IR 8547 (initial public draft): Transition to Post-Quantum Cryptography Standards.

Checked November 2026. Secria facts are from our Mail and VPN pages and the whitepaper.

Questions about public-key cryptography

Is public-key cryptography the same as asymmetric encryption?

Yes. Public-key cryptography and asymmetric cryptography are two names for the same thing, because the two keys in the pair are different.

Can you decrypt with a public key?

Not data that was encrypted to you. That needs the private key. With signatures it runs the other way: the private key signs and the public key checks the signature.

Is it safe to share my public key?

Yes, that is what it is for. Working out the private key from the public key is not feasible with today’s computers.

Is RSA public-key cryptography?

Yes. RSA is a public-key system that is still widely used, along with elliptic-curve methods such as X25519. Both are expected to be replaced by post-quantum methods such as ML-KEM.

What happens if my private key is stolen?

Whoever has it can decrypt what was encrypted to you and sign as you. The key pair has to be replaced and the old public key withdrawn.