Skip main navigation

Secret Codes

Read this article where Yossi Elran explains about two kinds of secret codes.
Secret code
© Davidson Institute of Science Education, Weizmann Institute of Science

Secret codes are exciting! From the dawn of mankind to seconds ago, from scouts to intelligence agencies, everyone has been using them.

The mathematical study of secret codes is called Cryptography. Cryptography is a huge topic in math, with many day-to-day applications, that deserves its own fully fledged course, but it just wouldn’t be right giving an introductory course on recreational math without mentioning secret codes.

Two very brief classic secret codes.

A substitution cipher is a secret code where the letters in a message are replaced by another symbol with a one-to-one correspondence. The symbol may be another letter, or perhaps a number or some pictorial sign.

A transposition cipher is a secret code where we encode the entire message by scrambling up the order of the letters in the message.

Using statistics, it is usually easy to distinguish between transposition and substitution ciphers. The letter frequency of a message encrypted with a transposition cipher will be similar to the letter frequent of the language the message was written in. This is not true for substitution ciphers.

Secret code challenge

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, post it in the comments below and let us all try and ‘break’ the codes.

Here are my two, both are nursery rhymes.

Message 1 – a transposition cipher:


HINT: First create an empty rectangular box 14×7. The message ends with three dots…

Message 2 – a substitution cipher:

Sph Omrk Gspi Aew e qivvc sph wsyp, Erh e qivvc sph wsyp aew li; Li geppih jsv lmw tmti, Erh li geppih jsv lmw fsap, Erh li geppih jsv lmw jmhhpivw xlvii!


Post your solutions to the secret messages in the comments below. Don’t forget to post your own secret code for us to try and break, and, most important, don’t peek at the answers before you crack the codes for yourself. Remember – honesty :-).

Good Luck!

© Davidson Institute of Science Education, Weizmann Institute of Science
This article is from the free online

An Introduction to Recreational Math: Fun, Games, and Puzzles

Created by
FutureLearn - Learning For Life

Our purpose is to transform access to education.

We offer a diverse selection of courses from leading universities and cultural institutions from around the world. These are delivered one step at a time, and are accessible on mobile, tablet and desktop, so you can fit learning around your life.

We believe learning should be an enjoyable, social experience, so our courses offer the opportunity to discuss what you’re learning with others as you go, helping you make fresh discoveries and form new ideas.
You can unlock new opportunities with unlimited access to hundreds of online short courses for a year by subscribing to our Unlimited package. Build your knowledge with top universities and organisations.

Learn more about how FutureLearn is transforming access to education