An Enigma code-breaking machine used to crack German ciphers in the Second World War was brought to Uxbridge College as part of a national tour.
Students learned about how the machine works and how codes are set and broken, and took part in code-breaking activities, during the visit on 11 and 12 June.
The machine is one of those used by British code-breakers at Bletchley Park and belongs to author and television presenter Simon Singh, who wrote The Code Book.
Enigma was originally used by the Germans to encipher their own communications, but British and Polish mathematicians exploited weaknesses in how the technology was used.
Breaking the Enigma ciphers gave the Allies a key advantage, which, according to historians, shortened the war by two years thus saving many lives.
The tour was part of the Millennium Mathematics Project, based at Cambridge University, which runs a variety of activities designed to bring maths to life.