Dont code-crackers have to be good at math?Cryptanalysis, prior to the 30's, was largely linguistic. Through WWII, there was still a significant linguistic component.
Turing was a mathematician and computer scientist. He headed the code-breaking team at Bentchley Park in WWII. He used mathematical analysis to break the German codes. Tolkien was wise to refuse the job. He was not a mathematician, and had a somewhat negative opinion of science in general. At any rate Tolkien would have been totally useless in building a machine of electric circuits to break the German codes.