For his part, Batey made important breakthroughs in decrypting the Abwehr Enigma system that helped MI5 to control the entire German spy network in Britain. The intelligence was crucial to the Double Cross system - under which MI5 turned German agents sent to Britain and used them to feed the Abwehr false information. It also revealed what the Germans did and did not know about the D-Day invasion plans. Crucially, the Allies were able to use the double agents to ''reveal'' to the Germans the presence of a bogus US Army group stationed in East Anglia and south-east England that was to land in the Pas-de-Calais. As a result, Hitler kept two key German armoured divisions that had been destined for Normandy in the Calais area. Batey was born at Longmoor, Cumberland; his father, John, had been invalided home from the Somme in World War I, and his mother, Elsie, supported the family on her wages as a part-time teacher. Batey was educated at Carlisle Grammar School, from where he won a scholarship to read mathematics at Trinity College, Cambridge. It was there that he was recruited to Bletchley Park by a former scholar at Trinity, Gordon Welchman. In 1942, Batey felt guilty that he was doing a reserved ''cushy'' job while his contemporaries were fighting, so he asked to be released to train as a pilot. He was informed that no one who knew that the British were breaking Enigma could be allowed to fly in the RAF because of the risk that he might be shot down and captured.

He then suggested that he join the Fleet Air Arm, flying over the sea in defence of British ships, arguing that he would be either killed or picked up by his own side. Worn down by his persistence, his superiors reluctantly agreed. On his solo flight during training, Batey came in to land so low that the examiners had to dive to the ground to avoid decapitation. Nonetheless, he passed - probably because of the desperate need for new pilots. In November 1942, shortly before he left for advanced flying training in Canada, Batey married Mavis Lever (they are pictured together), also a code-breaker. However, no sooner had he arrived in North America he was ordered back to Bletchley because he was considered more valuable working on the Abwehr Enigma than flying naval aircraft. After Knox made the initial breakthrough into the machine, in August 1943 Batey solved the Enigma ciphers of the Sicherheitsdienst, the Nazi party's intelligence wing. Three months later, he cracked the cipher used by the Spanish military attaches in Berlin and Rome to report back to Madrid on German and Italian military plans and assessments. He later went on to write much of the official history of the ISK section, which has still not been released by British authorities.

After the war, Batey used his formidable intellect in another direction: he passed the Foreign Office examination and served in the high commissioner's office in Ottawa from 1947 to 1951, and then as private secretary to Philip Noel-Baker, Secretary of State for Commonwealth Relations. He was transferred to several other civil service departments, one of which involved dealing with guided weapons, and in 1955 was appointed secretary of the Royal Aircraft Establishment at Farnborough, working there for 12 years. In 1967, Batey got the job of Oxford University's financial officer, and five years later was invited to become treasurer of Christ Church. When he retired in 1985, he was presented with bookshelves made from the original timber of the frame of Great Tom, the bell in Tom Tower, which sits over the main gate to Christ Church and was designed by Sir Christopher Wren. Batey was recently asked to contribute to a history of his alma mater, Portrait of Trinity - an enterprise to counter the damage done to the college's image by its having produced four members of the so-called Cambridge spy ring (Kim Philby, Guy Burgess, Anthony Blunt and John Cairncross). He reassured the college that it had also made a positive contribution to British intelligence operations, with five of the leading code-breakers - Welchman, Stuart Milner-Barry, Bill Tutte, Rolf Noskwith and himself - all recruited while at Trinity.

Batey retained his faculties to the end. Given the standard compos mentis test by his doctor shortly before his death, he answered every question correctly and then said: ''Now, young man, what do you know about Fourier analysis?'' before proceeding to give the startled doctor a lecture on the subject. Batey is survived by his wife, son and two daughters. TELEGRAPH