In the early 1950s, GC&CS transferred to GCHQ at Cheltenham and the Nissen huts of Bletchley have now morphed into a vast modern building called the doughnut. There in 1970 James Ellis showed there must be ciphers where full knowledge of the encryption method would still leave you at a loss to do the decryption — it's called public key cryptography. In 1973, Clifford Cocks, also at GCHQ, was told about Ellis's idea and came back half an hour later with a mathematical method of doing it. This was all entirely secret, of course, but in 1978 three people — Ron Rivest, Adi Shamir and Leonard Adleman — rediscovered it, and it's now called the RSA algorithm. Here's the idea.
You take a huge number N — 600 digits, say — bigger by far than the number of particles in the universe. Transfer your secret message into a string of numbers and split it into pieces, each less than N. Encrypt the message by doing a sequence of simple mathematical operations but at each stage take only the remainder after dividing by N. The enemy can intercept the encrypted message, know the big number N along with the exact sequence of operations, but still be at a loss. Doing the decryption is equivalent to factorising the big number N, but even with the best methods available that would take more time than the age of the universe. Creating the big number N is easy: you take the product of two 300-digit prime numbers. You — or your computer — knows the factorisation, but no one else does.
Little surprise then that GCHQ uses mathematicians, including academics from the universities, though they can't talk about what they do and aren't even supposed to think about it when they're back home. Britain is good at secrecy, as Bletchley's history shows. But I have a nagging doubt. It's all very well to have a spankingly modern building and use the latest mathematics, but there are some odd people in the world. Hackers can access Pentagon secrets from attics in North London, and in his book The Man who Mistook his Wife for a Hat, Oliver Sacks describes two autistic, computationally challenged brothers who could turn out huge prime numbers at the drop of a hat. And then there are quantum computers, which in principle could quickly do the factorisation. But no one has built one of any size — or have they?
I hope GCHQ still has a few Nissen huts, with eccentric people working in them, though we probably won't read about them for another 50 years.