Code or cipher? They’re both interesting

Our young blogger Megan explains what she finds fascinating about the world of codes, ciphers and encryption.

When you think of the general term ‘code’, there are normally two types of people: those who instantly go “computers!” and those who go “secret messages!”

The ‘computer’ people are thinking of computer code (or ‘source code’) which, although interesting, I know very little about. It’s a collection of computer instructions written as ordinary text by a programmer, which is then transformed by an assembler or complier (a programme that transforms code) into binary machine code that is understood by the computer.

You may have heard of ‘binary numbers’, a system that represents numbers (such as 1, 2, 3, 4 etc.) using two symbols; 0 and 1. So, the numbers 1, 2, 3 and 4 are represented as 1, 10, 11 and 100. Binary is a type of code and – in my opinion – is quite complicated. I’m definitely not fluent in it!

I’ve really only just scratched the surface of computer coding, but that’s a basic summary, because, you see, I’m one of the “secret messages!” people and that’s what I want to write about.

These sorts of codes (and ciphers, ‘cause they’re actually two different things) are more like puzzles and – like any puzzle – they’re easy once you know how to crack them. Personally, I love puzzles, especially codes and ciphers; they are just awesome! I’ve been doing puzzles for years, the stuff like Sudoku and crosswords, as well as these great Easter egg hunts that my dad makes up. Instead of just hiding the eggs, he creates a whole treasure hunt type thing, as each clue leads to an egg and another clue hidden with it. However, the clues are cryptic clues using puzzles like anagrams that have to be decrypted before working out the meaning of the clue, and as we’ve got better at them my dad has made them harder and harder. It’s so much fun, and I recommend you try something similar too!

In cryptology, a code is a method used to encrypt a message of great importance and a code book is needed to encrypt and decrypt the phases or words. If you watched the TV show Sherlock, then you’ll remember the second episode in the first series, The Blind Banker, in which people are being murdered and there is only a single clue left behind. Well, we find out later that this symbol is part of a code for an underground network, and they have a codebook of sorts. They use the guidebook of London as the codebook to encrypt their messages, along with numbers from a lost language that direct the receiver to pages and words that eventually spell out the hidden message.

A cipher, meanwhile, is an encrypted message at the level of individual letters or small groups of letters, like that ‘secret cipher’ you made when you were younger—when you swap the letters of the alphabet round so A=Z, B=Y, C=X D=W etc. and you would pretend to be spies. Surely I’m not the only one who did that?

These secret messages can be transformed by code and then by a cipher. This is called ‘multiple encryption’ or ‘super encryption’ and aims to make cryptanalysis more difficult. This is one of my possibilities for uni, studying cryptology and becoming a cryptanalyst ‘cause this stuff is so cool and incredibly interesting!

Ciphers are the dominant technique in modern cryptology, as codes are more susceptible to cryptanalysis and require a codebook.

A code that I’m sure everyone has at least heard of is Morse code; the one with ‘dots’ and ‘dashes’ or ‘dits’ and ‘dahs’. Morse code is named after Samuel F. B. Morse, the inventor of the telegraph, and each Morse code symbol represents either a letter or number –or a prosign – each with its own unique sequence of dots and dashes. For example:

A = . –
B = - . . .
C = - . - .
1 = . - - - -
2 = . . - - -
3 = . . . - -

The duration of a dash is three units and a dot is one unit, with one unit of silence in between each dot or dash. The letters of a word are separated by three units, and each word is separated by a space of seven units.

When talking about Morse code, most people jump to the abbreviation ‘SOS’ or ‘. . . - - - . . .’ , which many believe to mean ‘Save our souls’, but which could also be something like ‘Save our ship’ or ‘Send out succour’.

One of the simplest and most well known encryption techniques is the ‘Caesar cipher’, also known as ‘Caesar’s cipher’, the ‘shift cipher’, ‘Caesar’s code’ or ‘Caesar shift’. It is a type of substitution cipher, meaning each letter in the unencrypted text (or plaintext) is replaced by a letter a fixed number of positions down the alphabet. For example, if we have a left shift of 4 then E=A, F=B, G=C and so on. This method is named after none other than Julius Caesar (big surprise), who used it for his private messages.

One of my favourite parts about deciphering ciphers is that once you work out which type of cipher it is and have written it out as plaintext you feel quite clever— and seriously, who doesn’t love feeling clever?

My aim for this piece of writing was to get other people interested in codes and ciphers like I am. If you are, then I definitely recommend that you read (if you haven’t already) Dan Brown’s Angels and Demons, The Da Vinci Code and The Lost Symbol. I would probably also recommend Inferno, but I haven’t read it yet and I can’t recommend something I haven’t read myself!

Codes and ciphers are all around us on a day-to-day basis. Even the device you are reading this on has to use millions of lines of binary machine code (simply computer code) to display this piece of writing for you. It’s really interesting, so don’t hesitate to read more into codes and ciphers even if it’s just for fun, because they are!