Glossary Security

Public-key cryptography

Public-key (asymmetric) cryptography uses a pair of linked keys: a public key anyone can have, and a private key kept secret.

Last reviewed:

AdSense Placeholder
Slot: header_reference_page

In more detail

What one key does, only the other can undo. Anyone can encrypt a message with your public key but only your private key can read it, and a signature made with your private key can be checked by anyone with the public key (Digital signature). RSA and elliptic-curve schemes such as Ed25519 are common. Public-key operations are slow, so in practice they only agree on or protect a short symmetric key that then encrypts the bulk data. It underpins TLS, SSH and signed software.

Why it matters

It solves key distribution: two parties who have never met can communicate securely, because the public key can be shared openly. The weak point moves to trust, namely knowing that a public key really belongs to its claimed owner, which is the job of a Digital certificate. Losing or leaking the private key breaks everything built on it.

Example

A toy RSA key with p = 61 and q = 53 gives n = 3233, public exponent e = 17 and private exponent d = 2753. The message 65 encrypts to 65^17 mod 3233 = 2790, and 2790^2753 mod 3233 returns 65. Signing runs the other way: 65^2753 mod 3233 = 588, and anyone can check 588^17 mod 3233 = 65. Real keys use primes hundreds of digits long. With OpenSSL, an Ed25519 signature is 64 bytes, the public key is 32 bytes, and changing one letter of the signed message makes verification fail. The Key Pair Generator creates real pairs.

AdSense Placeholder
Slot: footer_leaderboard