Case Study: Alan Turing Cryptography Competition

Organisations involved: The University of Manchester

Case study written by: Charles Walkden, Andrew Hazel, Greg Chamberlain, Katie Steckles and Peter Rowlett (This case study is written based on an interview with Charles Walkden and Andrew Hazel for this project; in the text, “we” refers to Charles and Andrew, and “I” refers to one of Charles or Andrew.)

Intended audience: Secondary school students

Maths content: Cryptography and codes, modular arithmetic, number bases, ciphers

Audience group: Lower secondary or Middle school, Upper secondary or High school

Audience interest level: Receptive, Engaged

Topics: Codes and cryptography, number

Origins of the Project

Promotional image for the event, showing a piece of paper covered in Wingdings symbols with an encoded message, and a purple University of Manchester pen with Alan Turing’s face on it resting nearby

The idea for the Alan Turing Cryptography Competition came from the celebrations of Alan Turing’s Centenary in 2012 - there was an organising committee which was coordinated by people at the University of Leeds, and they did a callout to ask if we wanted to do something.

Initially we thought about doing something local to the north west, partly just to strengthen some of the links between the University and the local schools and use the networks that we have for those, including our active schools-college liaison network. But we realised we could do something online so that more people had access - potentially a large number of people. Originally it was intended to focus around schools in the north west, but then it went viral and we noticed we were getting schools around the country taking part in it.

To start with, we didn’t have a grand master plan, but we knew that one of the key age groups to engage was secondary schools - there’s quite a lot of activities already for sixth form, and while that feels like the natural target audience for universities, actually secondary school’s important too, because you want students to choose to do maths and science A-levels if you want a chance of them doing maths and science at university.

The other, more pragmatic reason is that there’s the National Cipher Challenge which is targeted at sixth formers and is a lot more computer based, and we didn’t want to directly compete with them. We wanted to design the early puzzles to be accessible to nearly everybody.

Practicalities

Screenshot of the Alan Turing Cryptography competition website

Initially, the competition ran as 6 puzzles, released every two weeks (although a few years in, this was revised to a week between the first three sets, and then 2 week gaps as they get a bit harder). The puzzles get progressively more difficult through the competition - starting really straightforward to get people interested.

The puzzles are embedded in a story - usually a mystery - told from the view of a couple of ageless children. The story often has a theme, which could be a a particular area of research which the University is particularly prominent in (such as graphene); some cultural heritage around the University (for example the John Rylands Library); or some aspect of Turing’s life (for example, morphogenesis and mathematical biology).

The story structure also enables you to drop hints for some of the codes - had we not had these hints it would have been too challenging because it would not have been clear where to get started - so we used it to seed ideas.

Students sign up on the website in teams of up to 4, and they have to be registered by teachers. We also get a not-insignificant of home schooled people taking part as well, who form teams with their friends, or sometimes siblings. A small number of students decide to take part on their own, but the team structure is there as we wanted to emphasise that mathematics is a collaborative activity.

The scoring for the competition is relative - you get a certain number of points depending on how quickly you answer it after the first person to submit the correct answer. This means if there’s a really hard code, you don’t have to second guess how long it’s going to take people to get it. It also means that people can still feel they’ve achieved - we say “you’ve got 2 weeks to solve this” rather than saying “you have to solve this in a day”.

To motivate people to solve the puzzles, we have prizes for the winners, but also a number of ‘spot prizes’ which are just randomly drawn from all the teams who submitted the right answer with 1 or 2 weeks of the code being released. This means people can feel it’s still worth their while submitting, even if they’re not the fastest.

We also have an online leaderboard where you can see which teams have solved which puzzles and how many points they’ve got.

There’s also a forum where students can chat to each other - this often resulted, particularly for the later ones where they don’t get it within seconds - a phenomenon where as soon as one team gets it (and there are people out there clicking refresh on the leaderboard) there’s a sudden flurry of activity on the forum of “Oh, have you seen this team got it? That means it’s doable! We’ve got to get cracking on this.”

The questions for the competition are written by us - the hardest part is coming up with the story and deciding how the codes fit in to it. Sometimes it’s quick - just generating some random symbols - and other times more work is involved, like if the question involves a video.

Three images of puzzles, including a mocked-up dot matrix printout with ATCG codes, a computer screen showing binary codes, and a ‘ransom note’ message made from letters torn out of a newspaper 
Examples of puzzles from the competition

Often the story comes first and then the codes - for example, when we did a challenge themed around morphogenesis and mathematical biology, it took about 10 seconds from having that idea to thinking “Oh, DNA sequencing! Do a code involving the As, Gs, Ts and Cs”.

Usually, the middle part of the challenge is easiest to come up with - variations on substitution ciphers. Coming up with interesting but easy questions for the start of the challenge is quite difficult once you’ve used Caesar ciphers and other well-known ones.

And coming up with questions for the harder end - in a way that is interesting, isn’t immediately Googleable, but isn’t so hard that it’s completely impenetrable - can be quite difficult. You can use a substitution cipher and obfuscate it a bit, but coming up with genuinely interesting things is usually quite hard.

We also usually try to sneak some little bits of maths in there as well - co-ordinate based codes, geometrical shapes drawn from instruction codes, or doing things with a modulus. We can then talk about it in the solutions to say “actually this is a bit of real maths”. There’s also the opportunity for a few in-jokes in the story - like a taxicab with the number 1729, which we explained in the solutions.

The website for the challenge was built by one of our team, and maintained by a colleague of ours - it’s been tinkered with slightly, but once you’ve decided on the structure, there’s now little maintenance required - but that was a considerable investment of time at the beginning.

As well as the online activities, we run live events at the end of each year’s competition where we get the winners and up to about 200 students from across the country to visit us in Manchester for the Alan Turing Cryptography Day.

Photograph of the interior of the Alan Turing Building, showing research offices and corridors with yellow walls and a full-height window at the end of the building. A few people are visible standing around and there is a pop-up banner of Alan Turing on the ground floor 
The Alan Turing Building, which houses the University of Manchester Maths department

The event runs from lunchtime up until mid afternoon - we give them lunch, then there are a number of live cryptography challenges that we give them, as a mini-competition. There’s no story - just 3 fun things for them to do related to cryptography. Often these are things that wouldn’t work as well online - for example, making cardboard tube Enigma machines.

The format of the mini-competition is much simpler: the first 3 teams to hand in the correct answers win prizes. Then we take them to a large lecture theatre, where someone from our sponsors SkyScanner talks to them for a few minutes, then we get someone to do an outreach-type talk - essentially to try and give a feeling of what it’s like to be in a lecture at university or show them something interesting.

We also had money from the university’s WP budget to fund schools in our Widening Participation programme to send students to events at the uni. For a lot of these students, particularly year 7 and year 8s this could be the first time they’ve been to a university and there’s a lot of benefits to that, so when we ran live events alongside the competition, we get a number of WP schools taking part.

We finish the day with a Q&A if we have time, then a formal prize-giving.

Our sponsor, SkyScanner, was contacted through someone in the department, who knew that they - as many companies do - had a certain amount of money they’re committed to spend supporting various charitable or other activities. We put together a case and asked if they would consider it, and they’ve supported us ever since.

The first Cryptography day was run using funding from the IMA and LMS, but we invited SkyScanner along to the first one. They liked it so much they offered to increase the sponsorship to cover that as well. They are mostly hands-off as a sponsor - one year they asked us if we could be a bit more proactive in embedding some of their things in the story, which we did - you can spell out quite a few things if you look at airport codes! - I had visions of us having to do something like that every year, but since then it’s basically been, you know, “we think this is good” and they’ve not interfered with the actual content.

As well as the actual competition itself, we’ve had a few things come out of the cryptography competition which wouldn’t have happened without it. For example, when The Imitation Game film came out we got invited by them to set up a mini competition on cryptography based on that, which we ran in pretty much the same way as the cryptography competition. but obviously aimed at adults (and anybody else who wanted to take part). That got quite a bit of attention in the press as a way of promoting code-breaking mathematics, so that worked quite well. We also got invited for a few years to things like the Big Bang Fair and stuff like that, where one of the activities was based on code-breaking.

The pandemic has had an impact on the competition. In 2020 Cryptography Day had to be cancelled at short notice (it was due to take place shortly after the UK went into lockdown). The online nature of the competition means that it could, in principle, have run as normal even during the covid restrictions. However, we chose to run the competition in a stripped-down ‘lite’ version. There were no prizes, and no detailed story linked to the codes (the story became the two child protagonists sending codes to each other to crack as something to do whilst bored in lockdown – we felt that that was quite appropriate given the circumstances).

The reason for the stripped-down version was the low availability of administrative staff resource to liaise with teachers, prize-winners, etc, and constraints on our own time - given the pandemic - meaning that we wanted something that could be written quickly. There was no cryptography day in 2021. The number of students taking part in the online competition was comparable to recent pre-pandemic years. For similar reasons, we intend running a stripped-down version in 2022 as well.

Accessibility

While the event is run as a competition, this doesn’t mean it’s only accessible to top students who can give up loads of time to it and do really well.

The design of the competition meant that the competitive element could still function as motivation - since it’s not an all-or-nothing scenario, even a team that hasn’t got top place can still win prizes. The way we’ve set it up means that even up to the last chapter, if the team that is top cannot solve the last chapter, and the next team might have got lower scores than them, they can still win overall if they solve it quickly enough.

Even though there are prizes for winning, it’s not like you’re in a close competitive environment with other people nearby - in principle, it’s you with your computer/phone and maybe with some friends, and you don’t have anyone shouting or name-calling - I’ve never seen anything like that on the forums. Also, although we have set it up as a competition, it doesn’t have to be run as a competition by teachers at schools - it can just be an activity, and we know of some schools who do this.

The highest level maths we include in the competition questions is number bases and modular arithmetic - it’s all material that you could in principle have as a fun extension class if you went into a secondary school.

It should be possible to decode all of them by hand - obviously, it helps to have a computer, and for the later ones being able to program makes it fast - but it should still be feasible in reasonable time, once you’ve got the idea, to do it with pen and paper.

Almost all of the challenge is still possible for students to do if they don’t all have access to the internet - the codes are almost all possible for the teacher to print and give to students in class. Occasionally we do a video-based code - e.g. morse code, but it’s flashing lights embedded in a video, or something embedded in an audio file - but for accessibility reasons we have a transcript of all this ready to use if there is somebody with hearing or visual impairments.

Evaluation

Since the start of the competition we’ve learned a lot about how to run it and made changes over the years.

One big change was to the structure of prizes - we had too few larger value prizes in the first year. We’d assumed that we basically had to bribe people to take part while having high value prizes; we learned that that just doesn’t work because it gets overly competitive and nasty, and we got caught out by that.

After that, I think from the second year, we decided that it was much better - the prizes for overall first, second and third are still more than any of the others, but they’re not significant any more; it’s just about spreading around the money so there are more lower level prizes for people.

We always had the spot prizes but we messed around with the distribution of them - so we’ve got a lot more for the early chapters now than we had, and that’s partly because there are a lot more teams that complete the early chapters, by design, to share that out.

Realising that we’d got that wrong, and actually it’s better for motivation purposes - it doesn’t need to be very much and it’s better to have the broad spread.

We haven’t done any formal evaluation of the project - all the evaluation we’ve had is either informal from the students themselves via the forum, or after the cryptography day itself, or informally through teachers. The feedback we’ve had from teachers is that they do use these things, and they use past years’ competitions in their lessons.

The Cryptography Day has always gone down well - the feedback we’ve had from teachers on that is that it’s often hard to find maths things to take students to; lots of other subjects, you can go to a castle or museum, but maths is always a bit harder. They appreciate that the day is not just sitting in a lecture: there’s an activity as well that’s combined; and it’s a similar sort of thing as well with the codes - we try and make one dead easy, one in the middle, and one actually quite challenging.

GDPR has also meant it’s difficult to keep in touch with past participants and see how their participation has affected them. There are some schools that have been engaged with it from the beginning with the same teachers, so you do get an informal measure from that as to how the students are doing, and you might find out what happened to them, but we can’t contact them directly.

One other big point of learning was one year when we had some help from the university with web hosting - the website fell over right at the start of the competition. When you have several hundred people all clicking refresh at 4 o’clock on Monday, essentially it’s a denial of service attack and the website fell over. There was a tweak that needed to be done to limit the volume of traffic.

More information

Project website: Alan Turing Cryptography Competition Archive

The Imitation Game Cryptography Competition