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.

1x3+2x4=1111-2x4=3
Scrambling gives 11 from 1 times 3 plus 2 times 4. The undoing matrix [[1,-2],[0,1]] subtracts the 2 copies back off.

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.

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.

1x5+2x1=7second stays 1
First row gives 1 times 5 plus 2 times 1, which is 7. The second number stays 1, so the result is (7, 1).

In a real exchange nothing sent reveals the secret. The watcher records locked pieces only, and locked pieces without the private half reveal nothing usable. That is why the watcher ends with recordings but no secret.

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

11 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