Locks anyone can close,
only one person can open

How public-key encryption and signing certificates actually work — with live demos you can poke at, animated step-throughs, and the number theory underneath.

The problem: sharing a secret over a public wire

Classic (symmetric) encryption uses one key: the same key locks and unlocks. That works fine — AES is symmetric and superb — except for one brutal bootstrap problem: how do Alice and Bob agree on the key in the first place, when everything they send each other can be read in transit?

Alice
wants to send a secret
⟶ ⟶ ⟶public network — anyone can read this
Bob
wants to receive it
Eve
reads everything on the wire

If Alice sends the key, Eve has the key. Meeting in person doesn't scale to "your browser talking to a server it's never seen." The 1976 breakthrough (Diffie–Hellman, then RSA in 1977) was realizing you can split the key into two halves:

Anyone can encrypt a message to Bob with his public key, but only Bob's private key can decrypt it. Eve can capture the ciphertext and the public key and still be stuck — if the math cooperates. So the entire scheme rests on finding a mathematical operation that's easy in one direction and practically impossible to reverse.