In the 2014 film The Imitation Game, it is said of the protagonist Alan Turing, the famous codebreaker of Bletchley Park, that "sometimes it's the people no one imagines anything of who do the things that no one can imagine". This adage can equally apply to one of Ireland's lesser-known heroes of World War II.

During the war, one of Nazi Germany's most notorious communication codes was broken by a mild-mannered librarian and family man from west Limerick, Dr Richard J Hayes. His day-job was as director of the National Library of Ireland - but during wartime Europe, he secretly led a team of cryptanalysts as they worked feverishly on the infamous "Görtz Cipher", a fiendish Nazi code that had stumped some of the greatest codebreaking minds at Bletchley Park, the centre of British wartime cryptography.

But who was Dr Hayes? He was a man of many lives. An academic, an aesthete, a loving father and one of World War II's most prolific codebreakers. But how has a man who achieved so much been largely unheard of by most Irish people? The truth is Hayes' story has been hidden in plain sight for years.

Earlier this year, I came across an old article in a newspaper property section about the sale of a house at 245 Templeogue Road. The article had been shown to me by a teaching colleague who quipped "there's a story there" to me as I read through it. The house had been known colloquially as the 'Nazi house' and its story was that of local lore in Dublin 6. It was erroneously said that the Art Deco house looked like a Swastika in aerial photographs.

Truth, however, is always stranger than fiction. In 1940, it was used as an IRA safe house and a man named Hermann Görtz had stayed there on an ill-fated mission to Ireland to spy for the Third Reich. Given my interest in history and a keen eye for a potential documentary idea, I decided to investigate the matter further.

After much research, I came across the name of Dr Richard Hayes. He had interrogated Görtz during his incarceration in Arbour Hill prison and subsequently broke the communication code he was using. A similar cipher had baffled staff in Bletchley Park, and such was its importance, MI5 had an entire hut with 16 staff working on breaking it.

Astonishingly, Hayes wasn't a military man at all. He had been seconded to Irish Military Intelligence for his obvious intellect. He spoke several languages, including fluent German, and was also a highly skilled mathematically. He uniquely possessed all the talents needed for the job that was at hand.

Totally unassuming

I was fascinated that a man such as Hayes was almost virtually unheard of in Ireland, given his achievements in the field of cryptanalysis and his contribution to the Allied war effort. The striking thing was that the more I read about Hayes, the more it became apparent how unassuming he was. He cycled to work every day in the library and after work he cycled to McKee Barracks near Phoenix Park to work on the German codes that had been intercepted during the day.

Often he would take messages home to work on while simultaneously raising his young family. In his spare time, he compiled a bibliography of Irish manuscripts that was still being used up until the 1990s. Despite Hayes' obvious achievements, finding written material on him was a difficult task. He was merely a footnote in the more 'interesting' stories of others from that period.

A 'colossus' in cryptography

But he is spoken about in glowing terms in MI5 and OSS accounts of World War II as "a colossus of a man" and "having gifts that amounted to genius" in the field of cryptography. His contribution was so important that if he hadn't done the work he did at the time he did it, Görtz could well have scuppered Allied plans for the invasion of Europe in June 1944.

The strategic deception of Germany through counter-espionage was the major tactic being used by the British and Americans during the war. Any information leakage from Ireland could have had disastrous consequences, and Ireland was very fortunate to have had Hayes in situ in the right place at the right time. As Dr Mark Hull, an associate professor of military history at the US Army Command and General Staff College at Fort Leavenworth in Kansas, remarked to me: "I would hate to think of the consequences if he wasn't."

The striking thing is that much of this work was done with very poor resources and without the complete backing of the government. Hayes wrote to De Valera quite prophetically in 1946: "We must be prepared for the next emergency with a nucleus of codebreaking staff, no matter how small. We must start in the next war where we left off in this one, not surely from scratch again."

The fact that many prominent TDs and ministers of the day attended Görtz's funeral in 1947 and that Hayes' own funeral was a small family affair tells its own story.

Still Hayes masterminded the Irish counter intelligence programme during World War II and helped ensure that Germany felt it could not directly invade Ireland. Whitehall in London is adorned with statues of Montgomery and Churchill, and Alan Turing has been honoured with a statue in Manchester, yet to most people in Ireland, Hayes and other Irishmen who played such a crucial role in World War II sadly remain largely forgotten.

It is my hope that now, 41 years after the death of Richard Hayes, the story of his life reignites public debate on how we commemorate World War II in Ireland. Sometimes heroes aren't statesmen, they aren't soldiers, they aren't statues carved of marble on city streets. Very often it is those who work quietly in the shadows to whom we owe the greatest debt of gratitude.

Documentary On One: Richard Hayes: Nazi Codebreaker is on RTÉ Radio One today at 2pm, and repeated tomorrow at 7pm

Indo Review