Sunday, November 4, 2018

Ars Paradoxica: Episode 1 - Hypothesis - Blue

I've got a lot of travel coming up soon, and so I'm re-listening to all of Ars Paradoxica, starting from the very first episode, in which Sally Grissom launches herself into the past - both hers and ours - accidentally inventing time travel and starting a whole chain(s?!) of convoluted events. As with the entire series, I wholeheartedly suggest you listen to the episode.

This, however, is a walkthrough on our very first code of the series. At the end of each episode, a somewhat-mechanical voice will read out a series of numbers, and a code word. It's meant to remind you of the cold war era (and presumably prior) numbers stations, some of which have been studied and tracked for years. I often pause the episode and relisten to the series several times to make sure I've got it right. Then, the fun begins.

The first several codes to break are based on a 'straightforward' Vigenere's cipher. There's a lot out there on the history of the code, and a lot of it is quite interesting, just in terms of how code making and breaking evolved. In short, Vigenere took the Caesar shift, or Rot-N system, and kicked it up a notch. Rather than rotating each letter in a sentence by the same number of spaces down the alphabet, you 'rotate' each letter in order of a code phrase.

Not sure what I'm talking about? It makes more sense when you see it.

Caesar shifts

For my example, I'm going to take the words ARS PARADOXICA. Pretend I'm trying to pass you a note on one of the cooler podcasts out there.

If I was using a Rot-N/Caesar cipher (guess who's one of the first to be documented using it...) I'd 'rotate' the alphabet by a pre-agreed number. Let's say 10, which would be passed to you in a separate way, secretively, so that only you would have both the coded language and the passcode/number.

So, to encode ARS PARADOXICA in a Rot-10, I would count 10 letters up from each, going around to A when I reached Z.  This is sometimes easier to see with the numbers, which we will need in a second anyhow.

Rot-N systems assign each letter a number, starting with A=1, all the way to Z=26. There are a lot of ways of messing with this, but let's stick with the simple example first.

With A=1, ARS PARADOXICA = 01-18-19 16-01-18-01-04-15-24-09-03-01

Now, to encode that, I take the number series 01-18-19 16-01-18-01-04-15-24-09-03-01 and add 10 to each, so it becomes 11-02-03 26-11-02-11-14-25-08-19-13-11, which in turn becomes KBC ZKBKNYHSMK using the same A =1 encoding.


I would pass you one note reading KBC ZKBKNYHSMK, and another reading 10. You would then turn the letters back into numbers: 11-02-03 26-11-02-11-14-25-08-19-13-11, and this time, subtract 10 from each, giving you 01-18-19 16-01-18-01-04-15-24-09-03-01. Then, you'd convert it back to letters and get ARS PARADOXICA.

Vigenere Cipher

This is where it gets tricky. Caesar shifts are fairly straightforward to encode/decode, and fairly straightforward to crack with a brute force method. You just have to run through all 26 possibilities (which is simple with a computer) and see which of them makes sense. It works on all alphabets pretty much equally, as long as there's a set/common order of the letters. 

Vigenere, as I said, doesn't rotate each number to the same degree. Instead, it uses a code word. For this example, I'm going to encode ARS PARADOXICA again, but instead of 10, I'm going to use the codeword NERD, presumably for obvious reasons. 

Method One: Math

In order to encode ARS PARADOXICA, I add/rotate the letters in the plain text by the letters in the codeword. In other words, I do the following:

A+N, R+E, S+R, P+D.... etc. Now, my message is 13 letters, and my codeword is only 4 - no problem - I just remove the space and keep repeating the codeword.

A R S P A R A D O X I C A
N E R D N E R D N E R D N

Now, the first major change between Vigenere and Caesar is that for either the code word or the plain text (doesn't really matter), A, rather than being 1, is 0, and Z=25. So, any number 'rotated' by A in this case, is just itself.  If we look at the numbers:
01-18-19 16-01-18-01-04-15-24-09-03-01
A R S P A R A D O X I C A
0 17 18 15 0 17 0 3 14 23 8 2 0
N E R D N E R D N E R D N
14 5 18 4 14 5 18 4 14 5 18 4 14

In this case, I chose to make the plaintext A=0 as it occurs so often in the text. If we add the two lines together we get: 14-22-36-19-14-22-18-07-28-28-26-6-14. Some numbers are over 26, so we subtract 26, looping back around: 14-22-10-19-14-22-18-07-02-02-26-06-14, or NVJSNVRGBBZFN.

To decode, you'd just subtract NERD repeated from that, and get ARS PARADOXICA back out again.

That's one way to encode/decode a Vigenere cipher. However, that involves math and sometimes it's just too time consuming. That's why there's an easy reference chart. (The 'hard' way will come in handy later, though.)

Method Two: The Vigenere Table


Image result for vigenere table

This eye-boggling chart is a quick and dirty way to encode/decode your Vigenere cipher. You assign your plaintext to the x-axis, and your code word to the y-axis (or the other way around, up to you), and find where the row and column meet. So, to encode the first letter, A+N, I would find A in the columns, and N in the rows, and where they cross, I get N. R+E becomes V, S+R = J, etc. You end up with the same message: NVJSNVRGBBZFN.

ARS PARADOXICA: First Code

Blue

10 16 26 06 18 | 04 20 26 01 | 14 11 03 | 08 06 08 15 21 03

WEATHER: cloudy

The above is what the voice gives you at the end of the episode. The | indicate beeps, which are used to break words. Later, there will be other colors, but for right now, blue means that it's a straight forward Vigenere cipher. The weather gives you the code word: CLOUDY, or 03-12-15-21-04-25.

You can approach this either by subtracting the numbers of cloudy (again, rotated down 1 to make the math work) from the numbers in the code, which would give you:


10 16 26 06 18 04 20 26 01 14 11 03 08 06 08 15 21 03
02 11 14 20 03 24 02 11 14 20 03 24 02 11 14 20 03 24
08 05 12  -14  15 -20 18 15 -13 -6 08 -21 06 -5 -6 -5 18 -21

Again, some of the numbers are negative, so we add 26 to get them correctly:
08 05 12 12 15 06 18 15 13 20 08 05 06 21 20 21 18 05

Running this back through with A=1 gives us 

H E L L O   F R O M  T H E  F U T U R E

:) 

If we wanted to run it through the table, what we would do is first convert the original numbers into text. 10 16 26 06 18 | 04 20 26 01 | 14 11 03 | 08 06 08 15 21 03 becomes J P Z F R | D T Z A | N K C | H F H O U C

Then, we start 'subtracting' CLOUDY as follows. Assign the x axis as your code word (CLOUDY). Go down the 'C' column until you reach the row with J in it. That will give you H. Then, go down the 'L' column until you reach P, which gives you E, continue, again repeating 'cloudy' as many times as necessary.

Either way, you'll get a greeting from the future :) 


As with all my messing around with ciphers, I'd like to give a huge shout out to Rumkin.com. While I love to work things out by hand, playing with washi and working on my handwriting, Rumkin is an amazing resource to get it done quickly and cleanly. I hope you've enjoyed this walkthrough as much as I've enjoyed writing it. If there are any other nerdy puzzle filled podcasts out there, please let me know!

No comments:

Post a Comment