To all those computer hackers exulting in pizza-encrusted bedrooms across central Europe — the US presidential election was influenced! The CIA said so! — I would say this: yes, yes, perhaps. But listen: when it comes to altering the course of history through hacking, Britain is waaaay ahead.

Indeed, if you want to hear about intercepted communications properly changing the world, there is one incident in particular, 100 years ago this week, that had a much more seismic effect.

The hacker hero of this story is a witty Old Etonian, a young publisher with a love for amateur dramatics. And the secret message, obtained by tapping telegraph wires (the hacking of its day) and then subsequent decoding, was from the German foreign secretary to his ambassador in Mexico.

The Zimmermann Telegram, as it came to be known, was critical to the Americans entering the first world war, which was crucial for the Allies to gain victory. More than this, in January 1917, the efforts of the young codebreaking genius Nigel de Grey, and his eccentric colleagues, shaped the thinking of President Woodrow Wilson on America’s future role as a supremely powerful interventionist force that lasted until… well, about now. So, geeks: think on and look sharp.

Nigel de Grey, then a 30-year-old Balloon Corps veteran transferred to the Admiralty intelligence department, would become one of the most senior figures at Bletchley Park during the second world war. He would also go on to have a vital role in constructing the modern post-war form of GCHQ. But the interception of the Zimmermann Telegram was a uniquely pivotal — and for many years classified — moment. And it is one that his grandchildren Michael and Anthony are still learning more about even now. ‘Obviously we are overwhelmed with pride,’ says Michael de Grey. ‘The more so for hearing so many people say just how vital Nigel de Grey’s work was.’

At the beginning of 1917, in the aftermath of the Somme and with the land war slogging bloodily on, the Germans planned a new and terrible submarine offensive in the Atlantic. The idea was to target all merchant shipping heading for Britain. No matter where they came from, cargoes and crews would be blasted into the dark icy depths. That even meant ships from America.

At this stage in the conflict, America was determinedly neutral. Such actions, the Germans knew, might change that. So Arthur Zimmermann, the German foreign secretary, got in touch with his ambassador in Mexico: in for a penny, in for a pound. Zimmermann wanted to encourage Mexico to attack the US. He would promise Mexico the return of Texas. Germany would help out with money and arms. That way the US would be fighting on multiple fronts and its power diffused. It sounds mad now. But it was a genuine proposition.

Here is where the hacking came in. German telegraph cables across some parts of Europe had been cut but they could still send messages via circuitous neutral routes. One of the connecting cables, used by Americans, ran under a Cornish village prior to crossing the Atlantic seabed. The British codebreakers were secretly tapping it. And so it was that they got hold of the encoded message from Herr Zimmermann.

Back in a rather dusty corner of the Admiralty, Nigel de Grey, together with a volcanic horror called Alfred ‘Dilly’ Knox, and William Montgomery, set to work. This department, Room 40, was the forerunner to Bletchley. Codebreakers then tended to be classicists rather than mathematicians. They were no less ungovernable. De Grey was rather brilliant on languages, but he also had the extra element of lateral-thinking genius. One section of the department had — randomly — a large bath at the end of a corridor. Dilly Knox monopolised it, often sitting naked and quite still in the hot water, miles away in abstruse thought.

The German codes they were tackling — even before the advent of the fiendish Enigma code-generating machine — were exquisitely complex, so much so that the Germans assumed they could never be cracked. This was some time before machinery could be involved to help break the codes; crypt-ology involved almost unimaginable mental gymnastics, plus blackboards and chalk.

Nonetheless, having got hold of the tele-gram, the team decoded it in a couple of days. They instantly understood the awesome nature of what they had: if the US president and people could see this proof of German treachery in black and white — Zimmermann encouraging others to attack — then that would change everything. At a moment in 1917 when the Allies were facing the prospect that the Germans might win, this was an astounding discovery.

De Grey himself described the Buchanesque scene when he took the find to his boss, Admiral William ‘Blinker’ Hall:

“ We had got a skeleton version, sweating with excitement because neither of us doubted the importance of what we had in our hands… As soon as I felt sufficiently secure in our version, even with all its gaps… I ran all the way to [Blinker’s] room… I burst out breathlessly, ‘Do you want America in the war, Sir?’ ‘Yes, why?’ said Blinker. ‘I’ve got a telegram that will bring them in if you give it to them.’

In Blinker’s version of the event, he referred to de Grey as ‘dear boy’.

What then followed was a complex dance of deceit and concealment, for it was vital that the Germans did not twig that their codes were being broken on an industrial scale. It was also vital that the Americans did not know that the British were tapping their cables, so it was made to look as though the cypher-snatch had happened in Mexico.

A few weeks later President Wilson, who had been so determined to keep the US out of the carnage, was presented with Zimmermann’s plot. There was initial scepticism, but the British codebreakers allayed it. The day before Zimmermann’s letter was made public to the press, President Wilson told colleagues: ‘If you knew what I know at this present moment, and what you will see reported in tomorrow morning’s newspapers, you would not ask me to attempt further peaceful dealings with the Germans.’

Publication brought conspiracy--theorist howls against the media. According to the historian Adam Tooze, an American--German activist called George Sylvester Viereck protested bitterly to newspaper proprietor William Randolph Hearst that ‘the alleged letter… is obviously a fake; it is impossible to believe that the German foreign secretary would place his name under such a preposterous document.’

Some weeks later, Arthur Zimmermann confessed that the message was real. America entered the war in April 1917.

Because of decades of official secrecy, the codebreaker who changed the future was never given a hint of public acknowledgement. It was only some years after his death that his brilliant work could be summoned from the shadows.

Michael de Grey was only eight when his grandfather died; but he remembered the funny and fond letters he was sent by Nigel on birthdays, handwritten in different coloured inks, some words replaced with drawings. ‘He did everything,’ says Mr de Grey. ‘He wrote music — his wife Florence was a singer — and he acted. He was with dramatics societies such as the Windsor Strollers and The Old Stagers in Canterbury.’ In between the wars, he ran a very upmarket art dealership affair called the Medici Society, and occasionally wore a cloak. He and Winston Churchill discussed art.

Curiously, in those interwar years, Nigel was quite forgotten about by the code-breakers of the Government Code and Cypher School, until the darkness of Nazism crept over. The Admiralty wrote to him in early 1939, says his grandson, asking if he had any sort of experience in the field of intelligence. Nigel’s sardonic reply brought a scramble of apologies and exhortations that he return to the cryptology fold. The business of codebreaking was so secret that even its own heroes could disappear.

Nigel de Grey was relatively small of stature — hence his nickname ‘the Dormouse’. ‘But there was a line of steel running through him,’ says Michael de Grey.

That line of steel was needed at Bletchley Park; incredible though the operation to smash the German Enigma codes was, the pressure of the work was extremely intense and there were huge interdepartmental disputes. De Grey, reunited with his fiery Room 40 colleague Dilly Knox, did his best to maintain order from his office in the Directorate.

As Michael de Grey wonders, when someone has that weight of responsibility in your hands, how do they manage the stress?

This is what makes Nigel’s hinterland so relevant. As well as his love of music — most of the codebreakers had an instinctive understanding of its structures — he was mad about gardening, about shooting, about woodwork. These, combined with the acting, were a vital pressure valve.

Today, Nigel de Grey is one of the names most revered by the cryptanalysts of GCHQ in Cheltenham, themselves the successors to the geniuses of Bletchley Park. His part in establishing codebreaking as one of the most vital means of defending the realm now spans a century — just as it looks like America may start pulling back from that global interventionist vision.

Sinclair McKay is the author of several bestselling books about Bletchley Park. ‘The Road to Bletchley Park’ exhibition is in Block C at Bletchley Park. For information go to www.bletchleypark.org.uk.