- Wouldn't it be nice if someone would invent
a perfect encryption algorithm that was unbreakable?
Well, someone already did.
And it was more than 100 years ago.
The one-time pad, invented by a telegraph expert in 1882,
is an example of an unbreakable cipher.
Using the one-time pad is fairly straightforward.
The sender and receiver each have a copy of identical pads
containing strings of random letters.
The pad must be as long as the total of the characters
of all of the messages that they will exchange.
Here's an example of what one page
in the one-time pad might look like.
The sender writes the characters of the message
in plaintext on the pad.
If my message is the word secret,
I would simply write that out across the top of the pad.
The sender then adds together the characters of the message,
and the characters of the key,
treating them as numbers.
A is the first letter of the alphabet,
so think of it as the number one.
B is the number two, and so on.
If we encrypt the first letter, S, here,
we do it by adding the first letter of the key, which is A.
Adding one for A to S gives us T.
Now we want to add together E and C,
the third letter of the alphabet.
Which, E then becomes F, G, H.
Adding C and G together gives us J.
And then the next one is a little bit tricky.
We want to add L, the twelfth letter of the alphabet, to R.
If we start doing that,
we start going S, T, U, V, W, X, Y, Z.
And then we've hit the end of the alphabet.
All we do in this case is loop around to A, B, C,
and get the answer D.
If we continued this math, we'd find
that adding K to E gives us P, and adding B to T is V.
And we have our encrypted message.
T, H, J, D, P, V.
That message is meaningless to anyone who might intercept it
who doesn't have access
to the one-time pad used to encrypt it.
Now, let's say I'm the recipient of that message.
And I have the same one-time pad as the sender.
I use my pad in a similar manner.
I first write out the message.
T, H, J, D, P, V.
But now I subtract the key, instead of adding it,
to reverse the encryption operation.
T minus A becomes S.
H minus C becomes E.
J minus G becomes C.
And when I get to D minus L,
I have that same problem, hitting the end of the alphabet.
I start with D and go backwards
through C, B, and then get to A.
So I do the same thing I did before,
and loop around the alphabet, just in the other direction.
Z, Y, X, W, V, U, T, S,
and then finally the decrypted letter, R.
P minus K is E,
and V minus B is T.
And there we have it.
Secret, the decrypted message.
The one-time pad is unbreakable
because it is totally random.
There's no repetition, so there isn't any
cryptographic attack I can perform against it,
as long as the sender only uses the pad one time.
So, if we have this perfect encryption algorithm
that we've known about for more than a century,
why aren't people using it widely today?
Well, because it's very difficult
to distribute one-time pads.
The sender and the receiver need to be in the same room,
and physically hand over the pad.
And then they need to meet again once they run out of pages.
That's not a very efficient way to communicate.