ViewWiki

Lesson 3 of 4

Keys and guessing.

About 20 minutes · 6 practice questions

A message locked with a key, the trouble of passing the key, and why every extra bit in the key doubles the time a codebreaker needs to try them all.

Step 1 of 6 · A locked message

Step 1 of 6

A locked message

Alice writes Bob a message, locks it with a key, and sends it down the tube. Eve copies every capsule that passes, but without the key she sees only scrambled bytes. Bob, who has the same key, opens the message and reads it. The key is a binary number, a row of bits, punched on a card both sides hold.

But where did Bob get the key from?

To the question

Step 2 of 6

Counting keys

Eve can try guessing: try every possible key until the message makes sense. Her machine, on the board at the back, tries a trillion keys a second, 101210^{12}⁠, and shows how many keys there are and how long it takes to try them all.

An nn⁠-bit key has 2n2^n⁠ possible values, because each bit has two possibilities, and every extra bit doubles the number. Key size is now fixed at 88⁠ bits: a toy key.

To the question

Step 3 of 6

One more byte

The DES encryption standard, adopted in the United States in 1977, used a 5656⁠-bit key. Eve’s machine goes through all its keys in about twenty hours. Eight bits make one byte.

To the question

Step 4 of 6

Eight more bits

A 4040⁠-bit key, like those the United States once allowed for export, falls to Eve’s machine in about a second. Work out how long a key one byte longer would take.

To the question

Step 5 of 6

Out of reach

Because every bit doubles the time, a few more bits take a key from “broken in a second” to “broken after the codebreaker is long dead”. Today’s keys are 128128⁠ or 256256⁠ bits long. The glass cube beside Eve shows what share of all the keys she could try in eighty years.

To the question

Step 6 of 6

Twice as long

A long enough key shuts the door on guessing. But the problem from the start of the Lesson remains: to use a key, both sides must have the same key, and it must not travel down the tube. The next Lesson solves that.

To the question

Still of the Cryptography 3D scene
Interactive scene

Loading the interactive version…

Each step sets up the Scene for you, and a control marked “fixed” stays put for that step.

To the experiment

Practice · Choose

Alice wants to send Bob a message locked with a key. Eve copies everything that passes through the tube. What is the trouble with first sending the key down the same tube?

To the experiment

Practice · Calculate

Key size is fixed at 88⁠ bits, and Eve’s machine board shows 28=2562^8 = 256⁠ keys to try. How many different keys are there at 1616⁠ bits?

To the experiment

Practice · Predict, then look

Key size is 5656⁠ bits, like DES’s from 1977, and Eve’s machine tries every key in about twenty hours. Now the key will grow to 6464⁠ bits. How many times longer will Eve need?

To the experiment

Practice · Predict, then look

Key size is 4040⁠ bits, and Eve’s machine, trying 101210^{12}⁠ keys a second, goes through them all in about 1.11.1⁠ seconds. How long will a 4848⁠-bit key take it? Write it in seconds.

To the experiment

Practice · Reach the target

Change Key size until Eve’s machine needs about seven months, 0.580.58⁠ years, to try every key, then press Check.

To the experiment

Practice · Choose

A 256256⁠-bit key is twice as long as a 128128⁠-bit key. How many times as many keys does it have?