Public-key cryptography · 01 How it works

Public-key cryptography: how it works

The open padlock as a metaphor, encryption with the public key, signing with the private key and hybrid cryptography.

The padlock metaphor

Imagine handing out open padlocks to everyone, keeping for yourself the only key that opens them. Anyone who wants to send you a secret message puts it in a box and snaps one of your padlocks shut: from then on not even the sender can reopen it. Only you, with your key, can. The open padlock is the public key; the key that opens it is the private key.

  1. 01
    Generation

    Everyone creates a mathematically linked key pair.

  2. 02
    Publication

    The public key is distributed: on a website, in a certificate, in a message.

  3. 03
    Encryption

    The sender encrypts with the recipient’s public key.

  4. 04
    Decryption

    The recipient decrypts with their own private key.

  5. 05
    Signature

    The sender signs with their own private key; the recipient verifies with the sender’s public key.

Hybrid cryptography

Public-key algorithms are slow. In practice they are used to exchange or protect a random symmetric key, with which the data are then encrypted using a fast algorithm such as AES. This is what happens every time you open a site over HTTPS.

Continue with
02 History

Public-key cryptography: history

From the secret insights of Britain’s GCHQ to Diffie and Hellman’s paper, from RSA to elliptic curves and certificate infrastructures.

↑