Skip over navigation
Cambridge University Faculty of Mathematics NRich logo
menu search
  • Teachers expand_more
    • Early years
    • Primary
    • Secondary
    • Post-16
    • Events
    • Professional development
  • Students expand_more
    • Primary
    • Secondary
    • Post-16
  • Parents expand_more
    • Early Years
    • Primary
    • Secondary
    • Post-16
  • Problem-Solving Schools
  • About NRICH expand_more
    • About us
    • Impact stories
    • Support us
    • Our funders
    • Contact us
  • search

Or search by topic

Number and algebra

  • The Number System and Place Value
  • Calculations and Numerical Methods
  • Fractions, Decimals, Percentages, Ratio and Proportion
  • Properties of Numbers
  • Patterns, Sequences and Structure
  • Algebraic expressions, equations and formulae
  • Coordinates, Functions and Graphs

Geometry and measure

  • Angles, Polygons, and Geometrical Proof
  • 3D Geometry, Shape and Space
  • Measuring and calculating with units
  • Transformations and constructions
  • Pythagoras and Trigonometry
  • Vectors and Matrices

Probability and statistics

  • Handling, Processing and Representing Data
  • Probability

Working mathematically

  • Thinking mathematically
  • Developing positive attitudes
  • Cross-curricular contexts

Advanced mathematics

  • Decision Mathematics and Combinatorics
  • Advanced Probability and Statistics
  • Mechanics
  • Calculus

For younger learners

  • Early Years Foundation Stage

Cipher Challenge Toolkit

Age 11 to 18
Challenge Level Yellow star
  • Problem

We have created some Excel spreadsheets containing various tools which automate techniques frequently used in codebreaking.

There are two versions. The first version uses macros. If it doesn't work on your computer or network, try the second version without macros.

Each sheet contains instructions on how to use it.

In general, you only need to change entries in cells highlighted red (the exception is transposer 2 and 3, for which the instructions show the steps you should follow). 

There are four functions in the spreadsheet:

1) Frequency analysis - counts the number of occurrences of each letter in the ciphertext so that you can compare it to the letter frequencies of normal English text. This helps you to determine the sort of cipher that might have been used. 

If the distribution is very similar to normal English, it may be that a transposition cipher has been used.

It also contains a table showing the most common digraphs (pairs of letters), which is also helpful for determining the encryption alphabet.

2) Substitution decoder - decodes the ciphertext according to the encryption alphabet you provide.  

3) Transposers 1, 2, 3 - transposer 1 writes the ciphertext in a rectangular grid of a size you specify. Transposer 2 splits the text into one letter per cell, and transposer 3 effectively reads down the columns for you. 

4) Vigenere - this sheet decrypts a vigenere cipher given a keyword. You can read more about Vigenere ciphers on Wikipedia.

The toolkit should help you decode the messages, though you may find it easier to use pencil and paper for some of your decoding work.

You may wish to explore the formulae used in the spreadsheet to see if you can make sense of how they work. You could then adapt them, or write your own formulae, or extend the formulae if your message is very long.

Notes and Background

You can read all about cryptography in the Plus article Cracking Codes.

You may also like

The Best Card Trick?

Time for a little mathemagic! Choose any five cards from a pack and show four of them to your partner. How can they work out the fifth?

Substitution Cipher

Find the frequency distribution for ordinary English, and use it to help you crack the code.

Probably a Code?

Is the regularity shown in this encoded message noise or structure?

  • Tech help
  • Accessibility Statement
  • Sign up to our newsletter
  • Twitter X logo

The NRICH Project aims to enrich the mathematical experiences of all learners. To support this aim, members of the NRICH team work in a wide range of capacities, including providing professional development for teachers wishing to embed rich mathematical tasks into everyday classroom practice.

NRICH is part of the family of activities in the Millennium Mathematics Project.

University of Cambridge logo NRICH logo