Finally catching up on Agent Carter, and I see they brought in a cryptographer! Now, if you know anything about cryptography, this is the moment where you’ll start your inner countdown to see how long it takes until someone says or does something that sounds good but makes no sense whatsoever.
Here, it’s twenty seconds, and that’s only due to non-cryptography banter beforehand. That may be a new record. Great job, Agent Carter!
What, you’re still here? Okay then, here’s what they did wrong. They used the term one-time pad and use that knowledge to decode the cipher. The pieces of that fit - one-time-pad is an encryption method, and it helps knowing that it is that (and that the original message is russian) to decode it, and it did exist at the time…
…but you can’t crack a one-time-pad encryption. The One-Time Pad, also known as OTP, is the one and only encryption method that is actually 100% secure and unbreakable if you do it right. It’s even possible to prove that mathematically.
The system is deliberately very easy. Suppose Alice wants to send Bob a message that is encrypted using a one-time pad, so that Eve the eavesdropper can’t read it. First of all, both Alice and Bob have to have a sheet of paper with random letters on it. This sheet is the one-time pad that gives the whole method its name. Now Alice takes her message and goes through it letter by letter, and compares each letter with the one at the same position in the one time pad. If it’s an “A”, she leaves the letter as it is. If it’s a “B”, she changes the letter for the one that comes afterwards in the alphabet; if it’s a “C” she goes two forward and so on. For example, if the original text is
LETS WATCH FROZEN AGAIN
and the one-time-pad is HFGDSWHOQERNMYCOZUNP, you go:
L E T S W A T C H F R O Z E N A G A I N
+ H F G D S W H O Q E R N M Y C O Z U N P
= S J Z V O W A Q X J I B L C P O F U V C
Bob does the inverse and gets the original message. If the one-time-pad is truly random (this one isn’t, it’s the result of me randomly mashing my keyboard and thus has certain bias towards keys that are more in the middle), and Eve doesn’t know its contents, then this is perfectly secure.
Oh, sure, Eve can try every single key, but not only are there too many, she has no way of knowing when she has hit the right one. Suppose she randomly tries ZCRDLFWYFBQFEUWKZGKZ as the key. Then she gets:
H F G D S W H O Q E R N M Y C O Z U N P
- Z C R D L F W Y F B Q F E U W K Z G K Z
T H I S D R E S S I S W H I T E G O L D
A perfectly valid and true statement. For all Eve knows, that may have been the message Alice did send.
In fact, for every single message of that length, you can find a one-time-pad that produces the same result, just by simple subtraction. Sure, Eve can read the original message, it’s one of the countless ones she can generate, but she has no way of knowing that this was actually the one that Alice sent and Bob received. If Alice and Bob are mean, they can insert some random garbage at the end of their message so Eve’s job gets even more impossible. This is what a mathematician means when they talk about perfect security.
This scheme isn’t used all that much today, because it requires careful handling of the one-time pad. It has to be the same size of the message, so if Alice wants to encrypt a four gigabyte animated movie file, she has to create a four gigabyte one-time-pad as well, and get it to Bob in some way that Eve can’t intercept - but if Alice can do that, she can just as well send the movie directly. Also, Alice and Bob must make sure that they never use the same one-time-pad twice (that’s why it’s called that way). Otherwise Eve can just subtract the messages and get a weird mix of both of them (specifically each letter in the first message changed by the amount indicated by the same letter in the second message). This doesn’t sound too useful, but there are actually good statistic methods you can use to get information from that.
The soviets actually made that mistake in the real-life cold war, and the UK and the US were able to decipher a lot of messages that way in the VENONA project. But there is no evidence in the TV show that the SSR has any of the information needed for that. They have one single message, and that’s it.
So: Peggy Carter is awesome, no doubt about it, but she can’t decipher a one-time-pad on the fly. It’s mathematically impossible.