数学英语 30 How to Use Math to Send Encrypted Messages
by Jason Marshall
Would you believe it’s possible to send someone a secret message secured with absolutely unbreakable encryption using only a bit of simple arithmetic? Well, it is—the solution is surprisingly simple and was used by British, German, and American spy agencies throughout World War II. Curious to know how it works? You’re in luck because today we’re taking our first steps into the world of secret-agent math.
The podcast edition of this article was sponsored by Go to Meeting. With this meeting service, you can hold your meetings over the Internet and give presentations, product demos and training sessions right from your PC. For a free, 45 day trial, visit GoToMeeting.com/podcast.
Secret Agent Math, Part 1
Here’s the somewhat ridiculous but hopefully amusing scenario 1: Imagine you’re a secret agent working for your government’s top-secret espionage 2 agency. You’re sitting alone in a restaurant when the waiter approaches your table and slides a small piece of folded paper in front of you. He indicates that the note was sent by a person seated across the room—you take a look and quickly recognize him to be a trusted colleague. The waiter leaves and you unfold the paper. Given your wealth of experience in these situations, you’re not at all surprised to find a senseless looking series of letters scrawled 3 across the paper: “P–B–A”. Having taken stock of the situation, you realize that this sequence of letters is an encrypted message.
How to Decrypt a Secret Message
You pull out a small notepad that was issued to you before leaving on your trip. Its pages contain sequences of completely random 4 numbers between zero and twenty-five. Armed with your notepad and the scrambled 5 secret message, you begin the decryption process. Here’s how it works. Start by looking up the first random number in your notepad—in this case it’s two—and then cross it out so you don’t accidentally use it again. This first number is used to decrypt the first letter of your message. Beginning with the first letter in your message, “P,” count forward through the alphabet two characters—“Q” is one and “R” is two. So “R” is the first letter of your decoded 6 message.
Okay, now that you’ve got that one figured out, all you have to do is repeat the process for each of the final two letters of your message. You look-up the next random number in your notepad—nineteen. So start at the letter “B”—the second letter in the scrambled message—and count forward nineteen letters until, eventually, you reach the letter “U”. This is the second letter in your decoded message. Finally, for the last letter “A,” you see the next random number in your notepad is thirteen. You count forward thirteen letters from “A” and arrive at “N.” So, you’ve now got your entire message decrypted—and it says: “R–U–N.” Run?!
The One-Time Pad Method of Encryption
Alright, time out. I know this scenario is probably pretty alarming, and you’re no doubt eager to learn the fate of your dramatized alter-ego. But before we get to that, let’s take a minute to talk about this encryption method called the “one-time pad” that played a major role in sending secret messages throughout much of the 20th century. The name “one-time pad” comes from the fact that the series of random numbers in the notepad must be used only one time. If a pad is reused, patterns can emerge that give away the random numbers in the pad, and the encryption can then be broken quite easily by an intercepting 7 party. Additionally, these numbers must be absolutely random (not just sort of random) or, once again, patterns can develop that make it easy to figure out the contents of the pad—and, if someone knows the numbers in your pad, your encryption is useless.
Secret Agent Math, Part 2
Now, let’s get back to the story. Recall that you’ve just deciphered a secret message telling you to “Run!” You ponder for a moment whether or not the message is a joke—if your running was that urgent, why wouldn’t your colleague just yell? But then you remember that this colleague is known for strictly 8 over-following standard industry encryption protocols 9, so you realize it is a real message and make a mad dash for the door. But having taken so long to comprehend the urgency of the message, you’re grabbed and hustled 10 into the trunk of a car and driven away—leaving your colleague to ponder the folly 11 of his ways. Apparently 12, he now realizes, encryption isn’t always necessary—sometimes simple solutions are better. But, your alter-ego’s misfortune in our drama is your own good-fortune in real life since, if for some bizarre reason you ever need to secretly share information with someone, you now can do it using a one-time pad!
The Math Behind One-Time Pad Encryption
Before wrapping-up, let’s take a minute to talk a little more about the math behind one-time pad encryption. Start by assigning each letter of the alphabet a corresponding integer value between 1 and 26. A=1, since “A” is the first letter of the alphabet, B=2, since “B” is the second letter, and so on until you get to Z=26, the last letter of the alphabet. If you take the integer value that corresponds to a particular scrambled letter in your encrypted message (say the letter is “P” with an integer value of 16) and add it to the associated random number from a one-time pad (say the number is two), then you get a new integer—in this case 16 + 2 = 18—which can then be converted back into the letter “R,” which you’ll recognize to be the first decrypted letter in the message from our story.
How to Solve Math Problems Smartly
That’s all well and good, but here’s an interesting case: What would happen if the scrambled letter you were trying to decrypt was “Y,” and the corresponding random number was 25? If we count forward through the alphabet from “Y,” we’ll obviously get to “Z,” but then what? Well, in this case, the answer is to loop back around and start again at “A.” That’s the way the one-time pad system is defined to work. So you could start at “Y,” count forward to “Z,” jump back to “A,” and then proceed 23 more letters forward and eventually arrive at “X.” But how about this: Instead of counting forward 25 letters from “Y,” couldn’t you also just count backward one letter? And isn’t counting backward one letter a lot easier? And a lot less error prone 13 too? It is.
So what’s my point here? Well, in math, as in life, there’s usually more than one way to solve a problem—and some ways are easier than others. So here’s the quick and dirty tip: work smart. Simply yelling “Run!” instead of going to the trouble of sending an encrypted message would be smart. Counting one letter backward through the alphabet instead of twenty-five forward would be smart too. Think before acting 14 and you’ll solve more problems while working less—that’s a pretty tough combination to beat!
Wrap Up
And speaking of beat...up: Whatever happened to our favorite secret agent? Will math save the day? Be sure to check out the next “Secret-Agent Math” episode to find out.
Thanks again to our sponsor this week, Go To Meeting. Visit GoToMeeting.com/podcast and sign up for a free 45 day trial of their online conferencing service.
Please email your math questions and comments to .........You can get updates about the Math Dude podcast, the “Video Extra!” episodes on YouTube, and all my other musings about math, science, and life in general by following me on Twitter. And don’t forget to join our great community of social networking math fans by becoming a fan of the Math Dude on Facebook.
Until next time, this is Jason Marshall with The Math Dude’s Quick and Dirty Tips to Make Math Easier. Thanks for reading, math fans!
- But the birth scenario is not completely accurate.然而分娩脚本并非完全准确的。
- This is a totally different scenario.这是完全不同的剧本。
- The authorities have arrested several people suspected of espionage.官方已经逮捕了几个涉嫌从事间谍活动的人。
- Neither was there any hint of espionage in Hanley's early life.汉利的早期生活也毫无进行间谍活动的迹象。
- I tried to read his directions, scrawled on a piece of paper. 我尽量弄明白他草草写在一片纸上的指示。
- Tom scrawled on his slate, "Please take it -- I got more." 汤姆在他的写字板上写了几个字:“请你收下吧,我多得是哩。”
- The list is arranged in a random order.名单排列不分先后。
- On random inspection the meat was found to be bad.经抽查,发现肉变质了。
- Each scrambled for the football at the football ground. 足球场上你争我夺。 来自《现代汉英综合大词典》
- He scrambled awkwardly to his feet. 他笨拙地爬起身来。 来自《简明英汉词典》
- The control unit decoded the 18 bits. 控制器对这18位字进行了译码。 来自《简明英汉词典》
- Scientists have decoded the dog genome. 科学家已经译解了狗的基因组。 来自辞典例句
- The police had been intercepting my mail, ie reading it before it was delivered. 警方一直截查我的邮件。
- We've been intercepting radio transmissions from Moscow. 我们已从莫斯科拦截到无线电信号。
- His doctor is dieting him strictly.他的医生严格规定他的饮食。
- The guests were seated strictly in order of precedence.客人严格按照地位高低就座。
- There are also protocols on the testing of nuclear weapons. 也有关于核武器试验的协议。 来自辞典例句
- Hardware components and software design of network transport protocols are separately introduced. 介绍系统硬件组成及网络传输协议的软件设计。 来自互联网
- He grabbed her arm and hustled her out of the room. 他抓住她的胳膊把她推出房间。
- The secret service agents hustled the speaker out of the amphitheater. 特务机关的代理人把演讲者驱逐出竞技场。
- Learn wisdom by the folly of others.从别人的愚蠢行动中学到智慧。
- Events proved the folly of such calculations.事情的进展证明了这种估计是愚蠢的。
- An apparently blind alley leads suddenly into an open space.山穷水尽,豁然开朗。
- He was apparently much surprised at the news.他对那个消息显然感到十分惊异。