Skip main navigation

New offer! Get 30% off one whole year of Unlimited learning. Subscribe for just £249.99 £174.99. New subscribers only T&Cs apply

Find out more

Secret codes

In this video, Dr. Yossi Elran explains about the connection between mathematical operators and two kinds of secret codes.
So, we’ve talked a lot about operators on numbers, We’ve even spoken a bit about logic operators. What about operators on letters? Well, it’s funny. Operators on letters, really change the letters, and make something that is legible - illegible! This is a nice way of thinking about secret codes. What are secret codes? You take a sentence, a phrase, a paragraph, even a word, encrypt it - that’s the operator, and you get something that you cannot read. There are many, many kinds of secret codes. In fact, secret codes are so broad a topic, that you’re going to have to do a course which hopefully we’ll create, that is totally dedicated to secret codes.
However, I want to give you just a small taste of two kinds of secret codes, and they differ in the way that we operate on or manipulate the letters.
We’re going to do this with an example of this famous sentence: “Ground control to Major Tom”. One kind of an encryption is called substitution - substitution cipher. In a substitution cipher you substitute every letter in the plaintext with another letter. This is very, very well known, even appears in the bible, Julius Caesar used it a lot and it’s called a Caesar cipher. Here’s a very, very simple example, where we’ve just encrypted every letter in “Ground control to Major Tom” into the letter that comes afterwards. So G goes into H, R to S, O to P, U to V, N to O, D to E and so on. Each letter with the letter after it.
So, from “Ground control to Major Tom” we get a sentence: HSPVOE, DPOUSPM, UP, NBKPS, UPN. And of course that’s illegible. Of course, it’s not difficult to decipher this or to crack this code, because it pops up immediately that each letter is encrypted by the letter, previous. It can be made more difficult by shifting each letter 3 or 17 forwards or backwards or even just randomly associating each letter with another letter or another number, and this is just an archetype of substitution ciphers.
Notice here also, another way of deciphering these codes, is by using statistics and seeing for instance that there’s a lot of O’s over here and in the sentence that corresponds to having a lot of P’s here in the scrambled message. That’s one kind of operation, substitution. Another kind of operation is called transposition. In transposition, you take a sentence and transpose it, mix it up.
So, this sentence over here: GDRMT, RCOAO, OOLJM, UNTOX, NTORX is the sentence “Ground control to Major Tom” with the letters scrambled in different order. You can see that the same letter O which is dominant in the original sentence “Ground control to Major Tom”, is also dominant in the message, in the encrypted message, so it’s the same letters but they’re all scrambled up. And this is the way we scrambled them, we just wrote them inside a 5 by 5 table and then we wrote it in the rows and drew out the numbers in the columns.
So, “Ground control to Major Tom” and the X’s just fill in the blanks at the end is written in the rows and we draw out the letters
in the columns: GDRMT, RCOAO, OOLJM, UNTOX and NTORX. So we’re going to give you a very small challenge on secret codes to end the course.

This is where all that we have learnt comes together. Secret codes. First, to get a brief introduction, please take time to watch the short video.

Secret codes can be viewed as a symbology, except that now different symbols encode letters instead of numbers. These symbols can be signs (like Morse code or Braille which are just encodings and not ‘secret’), or they can be other letters, or even the same letters themselves.

One can encode a message letter by letter, exchanging each letter with another symbol (these are substitution ciphers), or one can encode the whole message by scrambling up the order of the letters in the message (transposition ciphers).

But when we encrypt a message what are we really doing? We are operating on text with an operator that transforms the text into another symbology.

And when we want to try and break a code we have to work out what the symbology is and also what the encoding operator does. In other words, given an illegible encoded text, we have to work out what the operator is – is it a substitution cipher or a transposition cipher and how does the operator work? And we also have to work out the symbology in order to ‘break’ the secret code.

Cryptography is a huge topic in mathematics with many day-to-day applications, that deserves a full-fledge course. Still, I would like to challenge you with two secret codes, one a transposition and the other a substitution code that I have made up and see if you can ‘break’ the codes. I’m just going to give you the secret messages, and you can ‘break’ them for yourselves. I also have a special request – make up your own secret code, write it down in the discussion and let us all try and ‘break’ the codes. Here are my two:

Message 1:


HINT: First create an empty rectangular box 15×6. The first column of the rectangular box should contain 15 letters, the other columns should contain only 14 letters.

Message 2:


Good Luck!

This article is from the free online

Maths Puzzles: Cryptarithms, Symbologies and Secret Codes

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now