Help me please!
Me and my friend write each other in secret code. But my brother always understands!! How can he do that? And how can I stop him???
From Emma
***
Dear Emma,
If your brother can read it easily, then your code is too simple. Don’t worry, I’ve got your back. Ask anyone who knows me – making simple things complicated is my specialty!
I’m guessing that you and your friend are using a shifted cipher (also called a Caesar cipher because Julius Caesar was so fond of them). This means that every letter in the alphabet is shifted down by some number of letters, let’s say nine:
So M is U, I is Q, D is M, and so on. I don’t know what you might be writing about, but I’m guessing nefarious shenanigans, so we’ll encode the message
COME TO THE GARDEN DOOR AT MIDNIGHT
which becomes
LXVN CX CQN PJAMNW MXXA JC VRMWRPQC
The problem with this cipher is also the reason it’s so useful: the coding connects the letters to each other. So you only have to remember “scoot the letters nine places back in the alphabet” and you can read the whole message, but your brother only has to figure out one letter and he’s figured out all of them. All he has to do is look at that and think “Hmm, I see several C’s in that message… and T is a very common letter…” and then bam, secrecy gone.
So how do we solve this problem? Well, we can start by randomizing the letters. We don’t want to make it totally random, or it’ll be a pain to remember which one is which, so let’s go by threes, C then F then I and so on, swinging back around until we get all the letters. That should look pretty random:
This does leave M and Z as themselves, but that’s ok, we’ll survive (most messages don’t have a lot of Z’s, anyways). Now our message reads
ISMO HS HXO UCBLOP LSSB CH MALPAUXH
Which is much better! Now if your brother has the same thought, this time thinking that there are several H’s, he doesn’t automatically get all of the other letters, too. He’s only gotten this far:
_ _ _ _ T _ T _ _ _ _ _ _ _ _ _ _ _ _ _ T _ _ _ _ _ _ _ T
ISMO HS HXO UCBLOP LSSB CH MALPAUXH
This might be enough to stump him. This is what most cryptograms do, in books or newspapers (remember newspapers? no?), and plenty of people find them challenging. Of course, the fact that they’re a newspaper game tells you that people usually solve them, with a little work. If your brother is a clever sort, he may start looking at that second word and thinking, “Hmm, two-letter word that begins with a T? Gotta be ‘to.’ And next is a three-letter word starting with T? Probably ‘the.’ ” And he would unfortunately be correct, which would give him the code for H, E and O as well:
_ O _ E T O T H E _ _ _ _ _ _ _ O O _ _ T _ _ _ _ _ _ H T
ISMO HS HXO UCBLOP LSSB CH MALPAUXH
And then, since your brother is clearly a know-it-all, he might recognize that “ht” only occurs in words that end with “-ight,” so he gets I and G:
_ O _ E T O T H E G _ _ _ E _ _ O O _ _ T _ I _ _ I G H T
ISMO HS HXO UCBLOP LSSB CH MALPAUXH
At this point “midnight” is pretty easy to guess, especially if your brother knows that you and your friend tend to plan late-night mischief, which gives him M, D, and N.
_ O M E T O T H E G _ _ D E N D O O _ _ T M I D N I G H T
ISMO HS HXO UCBLOP LSSB CH MALPAUXH
Now you are really in a world of trouble, and guess who’s going to be behind the bushes with a hose when the clock strikes twelve?
So what can we do about this? First and foremost, we can take out the spaces between the words. ISMOHSHXOUCBLOPLSSBCHMALPAUXH is about a thousand times more difficult to crack then ISMO HS HXO UCBLOP LSSB CH MALPAUXH and yet not much more difficult for you and your friend to read. However, it can still be cracked. In this message, it’s the “th” in one place and the “ht” at the end that make the message solvable, but if the message is long enough there’s always something for a fiendish snoop to get his hands on. English uses many of the same words over and over (the, a, and, you, is, are, to, for, you get the idea) and they make patterns. You could just drop these common words and make your messages shorter (GARDEN DOOR MIDNIGHT would probably get past him).
Or…!!
You could take your codes to the next level. You and your friend decide on a code word or phrase. I’ll go with “The League of Nerds,” because hey, why not? Now write your code phrase vertically, in a column, and write the alphabet starting with each of the letters, like in the Caesar cipher above. So, thusly:
WOW that took a while. New advice: probably pick a shorter phrase. A four-letter word would be great. (Wait…)
Now, just go down through your alphabets. Code your first letter with the alphabet in row 1, your second letter with the alphabet in row 2, and so on. Now your secret message reads:
VVQP XO ZLI UFEHVQ VHVV LX MOXRMUMG
And now your plans are properly hidden from prying eyes. To see why this is such a great coding style, just look at the word for DOOR. The D, the second O, and the R all happened to be V’s in the sixteenth, second, and third alphabets, respectively, so the letter V stands for three different letters. Even better, the letter O is represented by different letters in the first and second alphabets, so the two O’s are an H and a V!
Here is your brother’s brain trying to apply regular English patterns to this code: “Hmm, that third word has three letters, it might be ‘the.’ I don’t see the letter Z again, so there are no more T’s. I see a two-letter word starting with L, which stands for H, that has to be ‘he.’ Wait a minute, the I thought ZLI was ‘the,’ so I is E, but if LX is ‘he’ then X is E, DOES NOT COMPUTE DOES NOT COMPUTE ABANDON SHIP AAAAAAAAAAAA”
This is what I recommend for your truly secret business. Go ahead and drop the spaces here, too. You should leave your brother thoroughly discombobulated.
A word of warning: don’t leave a copy of your word and all its alphabetical permutations lying around, or your bro will catch on. And you might want to clear your browsing history if you’re on a family computer. Good luck, and may all your clandestine deeds remain completely private henceforth!
Yours,
The Language Nerd
Zvxlpasayolrulhkmpsy? Esqnlsqnkldyxuich! asktheleagueofnerds@gmail.com
Or: Twitter @AskTheLeague / facebook.com/asktheleagueofnerds
My main reference this time is a childhood spent with my father, who always disdained pens and pencils when solving the newspaper’s daily cryptogram, preferring to solve them in his head.
My other reference is the amazing Simon Singh’s The Code Book, the history and how-to guide that every budding cryptographer should have by her side. The codes I’ve outlined here are great for handwritten messages, and more than enough to stump most people, but if you ever want to start writing million-dollar codes, like the ones online used to encrypt bank account information or government evidence of alien cover-ups, head straight for Singh.