LightMySky

Public-Key Cryptography and Key Exchange

A key pair splits the secret: one half can be published, and only the other half undoes what the first did. That solves the problem symmetric ciphers cannot, which is agreeing on a shared key with someone you have never met, over a line somebody is reading.

No account needed. Progress saves in this browser.

What a learner can do afterwards

  • Explain what each half of a key pair can do and what it cannot
  • Follow a key exchange and say what an eavesdropper has at the end of it
  • Say why public-key operations are used to set up a symmetric key rather than to carry the data

1 · Read

A key pair splits the secret in two. One half, the public key, can be published for everyone to see. The other half, the private key, is never revealed. A message locked with the public half can only be unlocked with the matching private half, so strangers can write to you while only you can read.

Try it together

Try a toy scramble: multiply each number pair by the matrix [[1, 2], [0, 1]]. The pair (3, 4) becomes (11, 4), since the first row gives 1 times 3 plus 2 times 4. The undoing matrix is [[1, -2], [0, 1]]: it subtracts the 2 copies back off and restores the original pair.

That split solves the problem symmetric ciphers cannot: two strangers agree on a shared secret over a line somebody is recording. Every message of the exchange is overheard, yet the watcher ends with nothing usable. The toy matrix fails this test: anyone seeing the scrambling matrix can compute its undoing matrix with a short formula, so it can never have a safe public half.

Good to know

Real public-key systems use math where the undo half stays hidden even when the scramble half is published. They are also slower, so computers use them just to swap a secret key, then switch to fast symmetric encryption for the real conversation. Publish the scramble half, hide the undo half, and let the fast cipher carry the chat.

Publish one half, hide the other, agree secrets over watched lines, then hand the chat to the fast cipher.

2 · Watch

Take it off screen

Print a worksheetA4 with an answer key page for grown-ups. No screen, no internet.

Where it sits

Then practise

8 questions wait behind this lesson, each with its answer explained. Every answer feeds the sky: stars light as they are learned, and dim when it is time to come back.

Spotted a problem on this page? Tell us
Public-Key Cryptography and Key Exchange · Computing, ages 20 to 22 · LightMySky