Public-Key Cryptography

Public-key cryptography uses a pair of mathematically linked keys, a public key that can be shared freely and a private key kept secret, so that data handled with one key can only be undone with the other, letting people encrypt messages and verify signatures without sharing a secret in advance.

How does public-key encryption work?

To send a private message, you encrypt it with the recipient's public key, and only their matching private key can decrypt it. Because the public key cannot practically be used to derive the private key, the public key can be published openly.

How do digital signatures work?

A sender signs data with their private key, and anyone can verify the signature using the sender's public key. A valid signature shows the data came from the holder of the private key and was not altered.

How is it different from symmetric encryption?

Symmetric encryption uses one shared secret key for both encrypting and decrypting, which is fast but requires sharing the key securely first. Public-key cryptography uses separate public and private keys instead, and in practice the two approaches are often combined.

Frequently asked questions

What is the difference between a public and private key?

The public key can be shared with anyone and is used to encrypt to you or verify your signatures; the private key is kept secret and is used to decrypt or to sign.

Can you derive the private key from the public key?

Not in practice. Public-key systems are designed so that recovering the private key from the public key is computationally infeasible.


Home · By Runze