In 1940, the mathematician G. H. Hardy (1877–1947) published *A Mathematician's Apology*. The book’s title may sound peculiar, but Hardy, a mathematician with a classical education, used the term “apology'” in its original sense of explanation, not contrition: the book explained why someone would want to be a mathematician. Hardy gave a number of reasons, one of which was that “the great bulk of higher mathematics is useless” [Hardy 1940, p. 58].

Hardy's attitude should be set in its historical context: He wrote those words at the beginning of World War II. Thus, he took solace in the fact that while *applied* mathematics “facilitates . . . modern, scientific, ‘total’ war” [Hardy 1940, p. 61], someone engaged in *pure* mathematics could have a clear conscience: “No one has yet discovered any warlike purpose to be served by the theory of numbers or relativity” [Hardy 1940, p. 60].

Of course, Hardy was wrong. Relativity makes GPS-guided “smart” bombs possible, and number theory is the basis for ransomware attacks on vital information. Indeed, one would be hard-pressed to find *any* subject that hasn't been conscripted for warlike purposes. The best we can hope for is that the good outweighs the bad; failing that, we can only hope that mathematics can be used to mitigate the harm.

In fact, even before Hardy wrote those words, abstract algebra—another “useless” area of mathematics according to Hardy—was being used in the war effort. In the early 1930s three Polish mathematicians, Marian Rejewski (1905–1980), Henryk Zygalski (1908–1978), and Jerzy Róẓycki (1909–1942), used the theory of permutations to break the encryption system used by the German military. After the invasion of Poland, the three scattered to different parts of free Europe to continue the fight against the Nazis. Their work was picked up by codebreakers at Bletchley Park where, most famously, a group including Alan Turing (1912–1954) built the “bombe,” an electromechanical computer that assisted in the codebreaking effort.^{[1]}

In the activities presented in this article, we'll take a look at the Enigma machine and the role abstract algebra played in breaking its cryptographic system.

**Figure 1. **Left to right: Polish mathematicians Henryk Zygalski, Jerzy Róẓycki, and Marian Rejewski during a walk

at the University of Poznań in 1932. Adam Mickiewicz University (formerly the University of Poznań), public domain.

[1] Sadly, Róẓycki died when a ship carrying him and several other cryptographers sank in the Mediterranean. Zygalski and Rejewski eventually made it to England, but due to some particularly stupid bureaucratic decisions, they were prohibited from working at Bletchley Park.