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.
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.
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.
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.
Home · By Runze