Puzzle: A Spy in the White House

You feel silly in the wig and ballerina costume, but your transport from the hospital to the safe house goes without incident. It is a small and basic room. There’s a bed, a TV, a small refrigerator, a desk, a stove and a bathroom. You thank Brown, who has accompanied You along for the trip.

“It is not paradise,” Brown comments, “But You should be able to survive comfortably here until this latest spy episode is over.”

You lay your papers down on the desktop. “Brown, I feel frustrated. Here we have six copies of the code, yet nothing has become any clearer. Sometimes I wonder if the spies actually do have some kind of codebook.”

Brown shakes his head. “That’s what Agent Cooper thinks too. We’ve pretty much ruled out computer language, so I guess that’s the next best thought. But… I don’t think there’s any codebook at all.”

You open one of the cabinets above the stove and are delighted to find a coffeemaker, a 2# bag of coffee, and a few cups and dishes.

“Yeah, I don’t really believe in a codebook either,” You remark as You spoon several heaping mounds of coffee into the brewing chamber. “First of all, codebooks are dangerous. If someone finds a copy, then the game is up. Also, our spies have never used such a book before. It’s not their way."

After adding water, the coffeemaker perks into action.

“I really believe this puzzle can be solved without anything other than the coded messages and our own ingenuity.”

“But how?” asks Brown. “That’s the question.”

You unpack your few belongings and soon the coffee is ready.

“I’ve been thinking about the one-letter words,” Brown says finally. “Let’s say the spies randomly encode the one-letter word ‘A’ with the letter ‘R.’ If we then discover a single ‘R’ somewhere then in the text of the code, we’d know ‘R’ is probably either an ‘A’ or an ‘I.’ We might even be able to guess that ‘R’ is ‘A’ by the context. But how would that help? The letter substitution does not seem to hold steady throughout the code. So if we find a single ‘R’, or indeed any other single letters, I don’t understand how that would help solve the code as a whole unless ‘R’ is always 'A." If ‘R’ does not always stand for ‘A,’ it could not be that much help if we know of one instance where ‘R’ does stand for ‘A.’ If ‘R’, on the other hand, does always stand for ‘A’ — then why are there so many characters in the code? This is so confusing!"

Brown gulps coffee and continues.
“There is of course the other possibility,” Brown continues. “If the letter substitution is not random, then single letter words are a problem for the encoder. What if the single letter words were to give away something, some secret to the actual coding method? Then such single letters would need to be avoided!

"Therefore, whatever a single ‘A’ translates to in such a non-random code, it might give away something about the complete encoding process. That would imply there is a distinct pattern to the overall encoding. If this idea is correct, it makes me think that if we know what ‘A’ was encoded into, we might well then know what ‘B’ is encoded into, and so forth. But what kind of pattern is there? Why can’t we find it? How could the substitution for ‘A’ and for that matter ‘I’ be so very informative to the solver?”

“If we answer that.” You reply to Brown, “We could very well crack this code.”

Brown looks at his watch. “Oh no, I’ve got to go. I’m supposed to meet with Jones. He’s been at the White House plotting strategy. You know, the spies are scheduled to freeze Chicago exactly one week from today.”

“Are they going to release all the imprisoned spies?” You ask.

There goes your life’s work….

“I think they hope the spies are bluffing. But they are really wishing for a big break in the case very soon —some miracle that will get us out of this jam. I wish we could tell them that You are still alive and working on the puzzle. But Jones feels that would be too dangerous. Somehow or another the White House has not been a very good place to keep a secret lately. You know, we told your ROY G BIP joke the other day in the Oval Office and everyone laughed. Then boom— the spies immediately taunt us with ROY G BIV at your funeral.”

You shake your fist at the spies and promise to continue diligent labor. You will go over your ten points again and again until You see the light. Where were You at… point #3, right? As he leaves Brown offers You some melatonin. “This stuff always gives me dreams,” Brown says. “Maybe it can induce a helpful one for You in the nick of time.”

Doesn’t it always seem so simple after You figure it out?
Though You intended to keep progressing through the questions, You find yourself coming back to the first question again and again: How do the spies know how to use the numbers and symbols? Your mind wanders over the words that have no letters. There are a couple that are very similar that keep turning up: 2-8, 3-8. Then, suddenly, it all becomes clear. You check one of the messages, and sure enough, You have found the answer! You begin to decode and the other rules quickly became apparent.

No time to waste now! You start on the most recent message, but it begins with the spies’ typical bloviation. And it looks like it goes on for a while. You skip to the end… and run to the phone in a panic.

“Agent Jones! I’ve cracked the code! The spies have scientists working on figuring out the Higgins device, and once they can operate it, they’re going to kill Higgins and his daughter! I’ll let you know more as soon as I can.”

Now back to the code - there’s not a moment to lose!

“Jones, another update: get ‘Bo’ out of the White House, and take him to the CIA veterinarian. I think you’ll find that he’s been a very bad dog. Bad dog!”

“Okay, Jones, here’s the rest: the spies’ headquarters is in the animal hospital complex on Pennsylvania Ave. I believe they are holding Higgins and his daughter - and the President’s poor pooch - in the basement. They are planning to buy an old battleship with the money they’re demanding, to serve as the new home for the AGWD, so the CIA should ask their sources about anyone expressing interest in purchasing a decommissioned war ship recently. And the tattoos; they’re Roman numerals, except for the circle - that was a “0”. Each spy in the ring has a number now. Sharon O’Day is Agent One Hundred - “C”. Anyone discovered with one of these Roman numeral tattoos should be considered part of their gang until proven otherwise. Once their scientists can work the AGWD, they will have no more use for Higgins, and will kill him and his daughter. And maybe Bo, too! Hurry, Jones, and save those hostages!”

Congratulations to Heart of Dorkness. You have saved Chicago, and maybe the world!

Jones tells You that the raid is on for tonight, and You beg to be a part of the team.

“This time it’s personal!’ You assert.

The CIA cars swing by to pick You up, and You ride with Jones and Brown.

“I know it all,” You say. “I know why the spies didn’t use blue. I know what parts of the taunts are red herrings, and which element is not. I know how to decode the symbols, the numbers and even the letters. I even can guess why they wouldn’t want to use that hash/number/pound sign. It might have caused confusion.”

“Absolutely brilliant work. After this raid is over, You must explain everything,” comments Brown. “I kept thinking I was getting close, but the solution would just be out of reach. This may have been the toughest spy code ever. You are truly amazing.”

“By the way,” interrupts Jones, “That phony Bo-bot is on the loose. We sent a team of agents into the White House this afternoon. They cornered the animal, but it suddenly leapt through a window and disappeared somewhere near the Jefferson Memorial. They probably should have shot it, but no one wanted to be the one to peg the First Dog.”

Darkness has settled in as the team surrounds the Pennsylvania Avenue Animal Clinic. Silently everyone departs the squad cars and stealthily creeps forward. Your nerves are tense. Suddenly a figure springs out from behind a trash can! But it is only a wino. The dirty fellow curses and clutches his brown paper bag before lurching off down the street.

At Jones’ signal the good guys burst through the doors of the PA Ave. Animal Hospital. Pandemonium ensues as the spies are taken by complete surprise. Several villains are captured and the CIA team moves to the basement. The door is forced open, and You see Higgins and his daughter huddled in the corner. The girl Mary appears to be holding a small black pooch. It is the real Bo!

And on a pedestal by the window is the AGWM!

Klaus is there too, holding a gun. “Don’t anybody move or the girl and the Professor get iced!” he snarls. “I don’t know how you all solved the code without that stinkin’ code-breaker, but you aren’t going to take me that easily!”

“Hello, Klaus.” You smile. “I’m not quite as dead as you think.”

“The enraged Klaus raises his weapon. “I still have one ace up my sleeve! Bo. Sic ‘em!"

From the shadows emerges the robot dog, its eyes glowing brightly. “That dog can shoot a deadly death ray from its eyes,” laughs Klaus menacingly. “Prepare to die!”

But at this moment the real Bo springs into action. Leaping from Mary’s arms, the brave mutt hurls itself upon the false mongrel. A tremendous dogfight takes place in the middle of the room. Lasers shoot from the false Bo, but instead of hitting You, they veer off and strike the AGWM, which explodes. Shrapnel from the blast knocks both animals against the wall. The real Bo is OK, but the phony is down for the count. Smoke pours from its tail and ears.

In the confusion You lunge at Klaus and wrestle the gun from his hand. Then the other CIA agents are there. The battle is soon over and the spies are defeated again! As Klaus is led away cursing, You pet the real Bo warmly. “Good dog! Good dog!”

You have finished answering the last question from the press. Your family has been elated, then angry, then understanding. All in all, today has been one crazy Sunday. Now You sit on a bar stool in your apartment with Jones and Brown.

“Sorry about the lack of furnishings,” You say. "My cousin is promising to return most of the old stuff tomorrow.”

“Well at least no one claimed your coffeepot,” laughs Brown.

As You pour everyone a fresh cup, Jones fills in some details. The fake Bo had been programmed to follow the President around, and was often actually in the room when important discussions were held. After all, as far as anyone knew, he was just a loyal pup. Folks in the White House even thought it was cute when Bo would lie outside the door with his ear cocked whenever he was actually shut out of a room where something important was going down. We now know that the dog had super-hearing and would record all sorts of classified discussion and then make “deposits” when he was walked. Other spies would then collect this information and send it to spy headquarters for analysis. Turns out Bo was the real spy in the White House.

Sources say that the behavior of Bo had caused some concern, and that Sasha had even complained to the Secret Service that the dog’s eyes glowed red in the dark and that it once threw up a couple of nuts and bolts. Oh well, hindsight is twenty-twenty. In any case, the real Bo is home and everyone is happy and thankful.

“Bo was quite a brave animal,” You say warmly. “Who knows what would have happened had the real Bo not gone after the robot phony during the showdown?”

“Astro always beats Electranamo,” says Jones with a straight face.

The vet’s office had recently come under new ownership when Doctor Huffman retired last year. The spies had been casing the joint, and quickly put their fake veterinarian in place. Doctor Huffman had always been the veterinarian of choice for the White House, so it was natural for the new owners to take over that responsibility. However, the new evil spy vet quickly got rid of all his other clients, and the stage was set for the switch.

Jones tells You that the CIA has also discovered a database in the veterinary office with the names and all the tattoo numbers of the spies. “This should make for easy identification and prosecution. Indeed, at this point all the known spies have been picked up with the exception of Andy Wilson and Sharon O’Day."

“Andy Wilson. Ugh. I was afraid you’d say that.” You grimace and take a sip of coffee. “I have a feeling Mr. Wilson got away right under our noses. That wino outside the PA Animal Hospital looked awfully familiar. I’m guessing it was Wilson. He was probably acting as a lookout. When he saw us approach, he must have figured the jig was up and took off.”

Jones shakes his head. “Well, we may catch up with Wilson and O’Day soon, and we’ll get the truth out of them. But this is not a time for regrets. We are here to celebrate. You are alive! The AGWM is destroyed, and it will likely be a long time before we have to deal with spies again. And You have a whole new chapter for that autobiography.”

“Oh no,” You wave your hand. “If I’ve learned anything from this case, it is that it is not important what others think. It is only important that You believe in yourself. My autobiography is going to stay unwritten.”

“Well at least tell us how to solve the code,” Brown urges. “You finally cracked the secret of all those colors and taunts and symbols. I think after all this time we deserve to have the solution spelled out.”

“All right,” You respond with a grin. “I could tell you just to look at ROY G BIV… but I guess I can reveal how I figured it all out and what the craziness in the codes really means. It’s like this…"
+++++
Heart of Dorkness…want to take it from here?

You take a sip of coffee, and begin:

"The very first thing I asked myself when I saw the codes was, ‘What is the order or pattern for the symbols?’ I could easily imagine ways to encode the letters, and even the numbers, but I was stumped by the symbols. From the varying frequencies of the symbols used, and the fact that some were not used at all, I could tell that they weren’t random; there was clearly some pattern at work. My first guess was that it related to the keyboard layout somehow. I looked at the arrangement of the keys, whether they needed the Shift key or not, and even compared the modern computer keyboard to older typewriter keyboards. But I couldn’t find a pattern that made any kind of sense. I even considered that they might be sorted alphabetically, by the name of the symbol. And that would explain why the pound/hash/number symbol wasn’t used; the spies wouldn’t be sure what to call it. I was so close.

"But I talked myself out of it - I noted that, of the characters appearing in every message, an “asterisk” is sometimes called a “star”, a “plus” is also called an “addition sign/symbol”, a “hyphen” is also a “dash”, “greater than” and “less than” are also “angle brackets”, and so on. So I assumed that there would be confusion over those names as well. And even then, I was imagining the symbols being sorted into the alphabet (A & ’ * B C ^ : , D $ E = ! F G, etc.) or placed at the end in that same order, and then the whole thing being used… well, I wasn’t sure how. Some kind of shift pattern?

"So I just forgot about the names of the symbols for a while. Then, I discovered that the number of words with colored letters was always either 13 or 23, and since there were 13 symbols that were always used, and of course, 13 is half of 26, or A-Z, I got caught up in trying to associate the symbols to the colored words. But I couldn’t make head or tail of that, either. And with good reason: it was either just a coincidence, or an intentional red herring.

"Finally, I wrote out my 10 questions to organize my thoughts. There was just so much going on: the colors, the fonts, the symbols, the numbers and the letters. I decided that, if each one of these elements affected the code in some way, then I should concentrate on words with the fewest of these elements involved. I had noted that there were very few words that repeated, that almost none of those had special fonts, and when they did, they matched. And since it was the symbols that confused me the most, I focused on the words with only numbers and symbols, and no colors or fonts. (There were no words with only symbols, though there could have been.) I started thinking about words beginning with “3-”; there were a lot of them. And “2-” as well. Like “3-8”, “3-!”, “2-8”…[SPOILER] "I thought, “Three, Hyphen, Eight.” “Two, Hyphen, Eight.” “Three, Hyphen, Eight.” And it hit me: the symbols simply stood for the first letter of their name. I had been making it too complicated. There was no order or shifts or anything, just a one-to-one correspondence. “Asterisk”, “Ampersand”, “Apostrophe”, and “At” all stand for “A”, every time. Using this system, I was able to decode enough to realize that the same was true for the numbers - “Six” and “Seven” stand for “S”, “Two” and “Three” stand for “T” - and also the fonts! Regardless of what the actual character is, “Italicized” letters are “I”, “Underlined” letters are “U”, “Green” letters are “G”, and “Purple” letters are “P”.

"That’s why there were no letters in more than one font. A letter couldn’t be both “I” and “R” at the same time, so it couldn’t be both “Italicized” and “Red”, It was also why the “Bold” taunts tended to be so short, and why the color “Blue” wasn’t used: “B” is just not a very common letter, and there wouldn’t have been enough of them to make two taunts. As I noted, some of the symbols used do have more than one name. So there might have been a little confusion for the spies if they called the + an “Addition sign” rather than a “Plus”, but they would quickly realize their mistake. The Pound/Hash/Number sign, however, would have been even more problematic, and since there were already multiple characters to represent all those letters, it was probably just easier to leave them out. The same goes for characters like { [ \ | /. They have multiple names (bracket/curly bracket/left curly bracket? backslash/left slash? pipe/bar/vertical-line-thingy?), and all those names begin with letters that were already accounted for.

"And what about the letters? Once I caught on to the symbols and fonts, it readily became apparent that the letters were shifted by the number of letters in the word. So “THE” would become “WKH”, while “THERE” would become “YMJWJ”. But there were only a couple of words that used only letters and didn’t have a font of some kind, so this relatively obvious system was fairly well obscured.

"Taking all of this into account, it’s clear why the spies avoided using the words “I” and “a”. How could they encode them? Consider “A”: if they used the symbols, it would always be “Asterisk”, “Ampersand”, “Apostrophe”, or “At”, and the initial-letter pattern would soon be obvious. They couldn’t use the fonts at all. And if they used the letter shift, it would always be “B”. And “I” has the same problems. There were no symbols starting with “I”, and the shift would have always produced “J”. They could have used any character, as long as it was always “Italic”, but that would have also been a big clue. So it was best to just avoid them entirely.

"Oh, and the Roman numeral tattoos. The spies referred to their agents by number in the messages - “Agent Fifty”, “Agent Twenty” - and by comparing the tattoos to the numbers, it was easy to figure out.
[/spoiler]“And I think that covers everything. As is often the case,” You conclude, “it seems pretty simple now, but it sure gave me some headaches before I figured it out! I really must commend you, Brown: you were thinking along the same lines as I was the whole time, and sometimes, you even noted something I missed, like the absence of Blue. I really think you could have solved this yourself. And you know, I hate to say it, but I have to hand it to Klaus: he’s really quite clever at creating codes that are simple enough for even the dumbest lunkhead spy to decode, yet almost complex enough to keep us from cracking them.”

You grin broadly at Brown and Jones.

Almost… but not quite.”

“Oh, and of course,” You add, “here are all of the decrypted messages. I expect the CIA will want to review them.”

Message 1:

AGENT ZERO
OUR SECRET SPY IS IS IN PLACE
DURING ONE RECENT VETERINARY VISIT WE REPLACED OBAMAS PET DOG BO WITH AN UNDETECTABLE EVIL DUPLICATE ROBOT
THIS DOG RECORDS EVERYTHING IT HEARS AND THEN LEAVES THE TAPE FOR OUR OPERATIVES TO PICK UP
OBSERVE FAKE BO AND MAKE SURE HE IS ACTING NORMALLY
NO ONE MUST SUSPECT THAT OUR PHONY PORTUGUESE WATER DOG IS REALLY ANDROID MOLE DELIVERING VALUABLE SECRETS TO SPIES
CONTACT US AT SPY HEADQUARTERS LOCATED IN PENNSYLVANIA AVENUE ANIMAL HOSPITAL COMPLEX
Message 2:

WHITE HOUSE DOG INFORMING US ABOUT HIGGINS FREEZE MACHINE
IF WE CAN GET THIS TERRIBLE DEVICE WE SURELY GROW RICH AND POWERFUL
BUT FIRST WE MUST GO ABOUT STEALING IT
GATHER OUTSIDE THE SCIENCE BUILDING AT GU CAMPUS EARLY EVENING ON INDEPENDENCE DAY
WASHINGTON FIREWORKS DISPLAY IS GIVING JUST THAT DISTRACTION WE NEED
Message 3:

BRING HEISTED GLOBAL CHILLER TO OUR HOME BASE
PLEASE USE BACK DOOR ENTRANCE TO GUARANTEE SECURITY
BE CAREFUL BECAUSE WE CANNOT AFFORD MISTAKES
REMEMBER WHAT HAPPENED TO AGENT ZERO AND AGENT FIFTY
SUCCESS MEANS WEALTH
IF THE US GOVERNMENT DOES NOT PAY BIG BUCKS WE CAN BRING ON ONE HORRIBLY EARLY WINTER
Message 4:

SPIES NEED TO BE PREPARED
VERY SOON WE CERTAINLY SHOULD KNOW AN ACCURATE DATE AND TIME FOR THE TRANSFER OF KLAUS AND ANDY WILSON
AT SOME POINT ON THEIR TRIP WE SIMPLY JUST ICE THEIR ENVIRONMENT CAUSING THE TRANSPORT VEHICLE TO STALL OUT
OUR TEAM SHOULD THEN QUICKLY ATTACK THIS TRANSPORT VEHICLE AND FREE OUR COMRADES
SPIES ARE REQUIRED TO WEAR BULLET PROOF PARKAS DURING THIS OPERATION
SPY AGENT ONE HUNDRED IS SET TO COORDINATE THIS SIEGE
ONCE OUR LEADER KLAUS IS RESTORED TO POWER WE CAN GO ABOUT THAT REALLY IMPORTANT BUSINESS OF CONQUERING MANKIND
Message 5:

WE MUST CONTINUE TO OPERATE OUT OF THE VETERINARY CLINIC
THE OBAMAS ARE DUE TO BRING PHONY BO IN FOR HIS CHECKUP SO WE WILL BE ABLE TO RECHARGE HIS BATTERIES AND REFILL HIS MESSAGE TUBES
WE HAVE THE REAL BO HIDDEN IN THE BASEMENT
OUR CANINE SPY WILL LET US KNOW EXACTLY WHAT OUR OPPONENTS ARE PLANNING
WE MAY HAVE TO FREEZE SEVERAL CITIES IN ORDER TO GET THE GOVERNMENT TO PAY
BUT PAY THEY WILL
LATER WE CAN USE THE AGWM TO TAKE OVER THE WORLD
WE ARE ALSO GOING TO BURY THAT ANNOYING AMATEUR CRYPTOLOGIST UNDER MOUNTAINS OF SNOW
THREE CHEERS FOR KLAUS
Message 6:

ALL HAIL THE RETURN OF KLAUS AND ANDY WILSON
AGENT TWENTY DID NOT DIE IN VAIN
THIS MONTH WE WILL PROBABLY HAVE TO FREEZE CHICAGO
ALL SPIES THERE SHOULD GET OUT NOW
IT IS OUR BEST GUESS THAT WE WILL ONLY HAVE TO ICE DOWN ONE AMERICAN CITY BEFORE OUR DEMANDS ARE GRANTED
WHEN WE GET OUR MONEY WE ARE GOING TO BUY AN OLD WARSHIP AND TRANSFER THE AGWD TO THIS SEAGOING VESSEL
SOON OUR SCIENTISTS SHALL KNOW ENOUGH TO OPERAE THAT DEVICE AND WE CAN SEND HIGGINS AND HIS MEDDLESOME DAUGHTER TO THE BOTTOM OF THE ATLANTIC OCEAN

*Q!71F!

If I did that right…

Great fun. Hat’s off to Code Maker and Code Breaker,
really enjoyed myself even though I was lost in keyboard
cluelessness.