Mavis Batey was a British student of 19, midway through her university course in German Romanticism, when she was recruited for a top-secret assignment during World War II.

“This is going to be an interesting job, Mata Hari, seducing Prussian officers,” she recalled thinking years later. “But I don’t think either my legs or my German were good enough because they sent me to the Government Code and Cipher School.”

In May 1940, Batey – then the unmarried Mavis Lever – joined the team of code breakers at Bletchley Park, the British cryptography headquarters at a Victorian estate about 50 miles north of London. Trained in the enemy’s language, she became a key contributor to a wartime project that remained classified for decades.

By the time of her death on Nov. 12 at 92, Batey was regarded in England as a national heroine. Working with Alfred Dillwyn “Dilly” Knox and other celebrated code breakers, she learned to decipher what she called the “utter gibberish” of encrypted German communications.

Batey worked on a “need-to-know” basis and did not understand at the time the significance of her efforts. In recent years, with the release of British wartime records, it was revealed that her code-breaking helped the Allies cripple the Italian navy in 1941 and assisted the 1944 Normandy invasion.

Winston Churchill, Britain’s wartime prime minister, was said to have called the Bletchley Park code breakers his “geese that laid the golden eggs but never cackled.” They toiled in secrecy to decipher the encoded messages spat out by the Axis powers’ Enigma machines.

“No one knew how the blessed thing worked,” she once told an interviewer, referring to the Enigma, a machine that resembled a typewriter and scrambled messages.

Knox, by her description, was an “eccentric genius” so consumed by his work that he on at least one occasion stuffed his pipe with bits of sandwich rather than smoking tobacco.

“He would ask, ‘Which way does the clock go round?’” Batey recalled in an interview with the Daily Telegraph. “If you were stupid enough to answer ‘clockwise,’ he would always answer, ‘Not if you’re the clock!’ That summed it up: You had to be prepared to think in a different way.”

Batey’s first major contribution came in March 1941, when she helped decipher Italian naval communications revealing an impending attack on British ships ferrying supplies from Egypt to Greece. One message declared the arrival of “day X minus 3.”

She was the cryptographer on duty to decode a subsequent message explaining in detail the Italian battle plans. The information was passed to Adm. Andrew Cunningham, the commander of Britain’s Mediterranean fleet.

Cunningham led the British in a preemptive attack on the Italian navy. That encounter, the Battle of Cape Matapan, was a decisive victory for the British and effectively devastated the Italian fleet for the rest of the war.

Batey helped crack the even more complex Enigma codes employed by the Abwehr, the German military intelligence service. She and her colleagues helped confirm the success of an anti-espionage operation in which captured Nazi spies were used to transmit false information to the Axis. The tactics were used most notably to fool Germans into believing that the D-Day invasion would take place not in Normandy, but at the Pas-de-Calais.