Where to Start? (Où commencer?)

19 1 0
                                    

Faire défiler vers le bas pour la traduction en français

So, say you are faced with a line of code. How does one even begin to decode it? There are many different types of code, and each requires a different technique.

First, you should consider the purpose of the code - who is writing it? If it is a correspondence from friend-to-friend, begin by treating it as a simple code, but if it was written by someone for a more serious purpose, or as a challenge, you may want to skip the simpler steps, and jump right into treating it as more than a substitution cipher (We'll look more on this in another chapter).

There are two main types of ciphers: Mono-alphabetic, and poly-alphabetic.
Caesar's shift, and other substitution ciphers (where each letter is substituted for another symbol/character) are all mono-alphabetic, because there is only one substitute/code alphabet.

Poly-alphabetic ciphers include the Vignere cipher, the Enigma, The One-time pad, and many others. (If you are not familiar with any of these ciphers, I may explore them individually at greater depth in another chapter - look in the contents. Or else use our old friend Google. The Code Book by Simon Singh is also a great resource)

Lets look at an example:
 Bob is a junior-high school student, and wishes to send a message to his friend Max. You intercept the message, make a copy, and pass the original on. But woe to you! The message you intercepted is in code! It looks like this:

10,12!       2,24     44,24,36         40,-4,22,34     34, 24     26, 18, -4, 44           32,24,0,0,4,30      -4,6,34,4,30          32,0,10,24,24,18?
 
Now, being a code lover, you may want to jump right in and try A=1 B=2, or A=26 B=25 or any other variations like that. But first you should look at the code for a minute. What do you notice?

First of all, lets look at how the code is broken up.
 It is not in one long line, but instead separated into different length groups. These could be words, or it could simply be a diversion.
If they are words, then we can see 3 two-letter words in this code. The first of them seems to be a greeting: "10, 12 !" - could this be the word "Hi"? 👋 This tells us 10 and 12 are probably H and I, respectively. That's interesting - in the alphabet, H and I are next to each other, so you would expect to see 10,11 or 11, 12 in a normal numerical shift. 
then there is also "2,24" and "34,24" - notice how the number 24 is repeated?
Lets make a list of some two-letter words ending in the same letter:
- at, it
- do, go, so, no, to
- be, he, me, we
Now we have narrowed down some options for those numbers.

We could continue like that, finding words and letters, but lets pause and look at the range of numbers, as this will tell us some information about the type of code it is. The easiest way to do this is to write all the numbers out in order.

-4, 0, 2,  4,  6, 10,  12, 18,  22,  24 ,  26 , 30, 32, 34, 40, 44

Now that they are in order, it is easy to see some patterns.
Firstly, they are all even - which would explain why the highest number is almost double the normal 26 letters of the alphabet. 
But what about that -4? and the 0?  perhaps the substitution begins -4, or even lower.

Now that we've explored this a bit, we can begin to try some variations, and actually start to "solve" the code.
The most obvious way is to begin at A = -4, and go up by 2 for each letter, finally reaching Z = 46
Lets create a key - a key is a table  used to translate one alphabet into another. 

A= -4                                                                 B =-2                                                       
C= 0                                                                  D=2
B=4                                                                   F=6
G=8                                                                  H= 10
I=12                                                                   j= 14
K=16                                                                  l=18
M=20                                                                   N=22
O=24                                                                P=26
Q=28                                                                R=30
S=32                                                                  T=34
U=36                                                                    V=38
W=40                                                                    X=42
Y=44                                                                      Z=46

The Basics of Code Breaking // Les Bases de la Rupture de CodeWhere stories live. Discover now