Public-key cryptography
Each person has two linked keys. The public key can be shared with anyone. The private key is kept secret. Something locked with the public key can only be opened with the private key, and something signed with the private key can be checked by anyone with the public key.
A postbox in the street. Anyone can drop a letter in through the slot, but only the person with the key can open it and read the post.
- 1Fingerprint the document The signer's software makes a hash of the exact contents. Typical: SHA-256 Any change, even one character, changes the hash.
- 2Sign with the private key The hash is signed with a private key only the signer holds. Typical: RSA, ECDSA or Ed25519 ML-DSA is the post-quantum replacement.
- 3Send with a certificate The document travels with the signature and a certificate linking the public key to the signer. Typical: X.509 certificates Certificates are signed the same way.
- 4Anyone can verify The receiver checks the signature with the public key against a fresh hash of the document. Typical: Done automatically by browsers, phones and PDF readers A mismatch means it was altered or signed by someone else.
Why it matters
Two strangers on the internet can set up a secure connection without ever meeting to swap a secret. It also makes digital signatures possible.
Where you meet it
Every secure website, passkeys, software updates on your phone, chip cards.
- Your phone or laptop
- 1Key exchange Your device and the site agree a secret key over the open internet. Today: X25519 (elliptic curves) Breakable by a large quantum computer. Browsers now add ML-KEM alongside it.
- 2Certificate and signature The site proves it is your bank and not an impostor. Today: RSA or ECDSA signatures Breakable by a large quantum computer. No post-quantum certificates are used on the public web yet. Chrome plans to start in 2027.
- 3Encrypted data Everything you send and receive is scrambled with the shared key. Today: AES or ChaCha20 Safe with today's key sizes. Quantum computers only weaken it slightly.
- 4Integrity checks Every message carries a tag that shows if anyone tampered with it. Today: Built into AES-GCM or ChaCha20-Poly1305 Safe. Quantum computers barely affect these checks.
- The website
Go deeper history and technical detail
Also called asymmetric cryptography. It was published by Whitfield Diffie and Martin Hellman in 1976, with RSA following in 1977 (GCHQ researchers had found similar ideas earlier, kept secret until 1997). Public-key maths is slow, so in practice it is used to agree or protect a symmetric key, and the symmetric key then encrypts the data. Its security rests on maths problems that are hard for ordinary computers, such as factoring large numbers. Some of those problems are easy for a large quantum computer.
Read or watch next
- The Code BookSimon Singh (1999), book
- How Public Key Cryptography Really WorksQuanta Magazine (2024), article
- CryptoSteven Levy (2001), book
- How Does Math Keep Secrets?The Joy of Why, Quanta Magazine (2024), podcast episode
- New Directions in CryptographyWhitfield Diffie and Martin Hellman (1976), paper
- CryptographyJonathan Katz, University of Maryland on Coursera, course
Related terms
Cite this page Encryption Observer, “Public-key cryptography”, encryption.observer/terms/public-key-cryptography/, checked December 2026.