When an innocent looking sketch illustrating how the NSA and GCHQ intercept data from Google and Yahoo was shown to some of the search giant’s employees they reportedly “exploded in profanity”.

Now a Google engineer named Brandon Downey has made this profanity a little less second-hand, blasting the NSA in a blog post and comparing his struggle to defend the company against various aggressors with Frodo’s struggles in The Lord of the Rings.

“I'm just going to post my thoughts on this. Standard disclaimer: They are my own thoughts, and not those of my employer,” writes Downey.

Download the new Independent Premium app Sharing the full story, not just the headlines

“F*** these guys. I've spent the last ten years of my life trying to keep Google's users safe and secure from the many diverse threats Google faces. I've seen armies of machines DOS-ing Google. I've seen worms DOS'ing Google to find vulnerabilities in other people's software. I've seen criminal gangs figure out malware.

“But after spending all that time helping in my tiny way to protect Google -- one of the greatest things to arise from the internet -- seeing this, well, it's just a little like coming home from War with Sauron, destroying the One Ring, only to discover the NSA is on the front porch of the Shire chopping down the Party Tree and outsourcing all the hobbit farmers with half-orcs and whips.”

This analogy refers to an episode from J.R.R. Tolkien's The Lord of the Rings known as 'The Scourging of the Shire'. It was omitted from Peter Jackson's film adaptations but is sometimes thought to be an allegory for Tolkien's return to an industrialised England after fighting in WWI.

Downey’s comments, spotted by Quartz, were posted to his Google+ account and given the hashtags ‘nsa’ and ‘statesurveillance’. He was referring to the recent revelation that the US government has secretly broken secure links between Yahoo and Google data centers across the world.

The programme, codenamed ‘Muscular’, has been described as “unusually aggressive” and has contributed to the speedy deterioration of relations between the US government and the country’s tech giants.

Mike Hearn, a British colleague of Downey’s who also works on Google’s security team, echoed the feeling of disgust that infrastructure designed to safeguard against criminal behaviour had been undermined by the UK and US governments.

“We designed this system to keep criminals out,” writes Hearn. “There's no ambiguity here. The warrant system with skeptical judges, paths for appeal, and rules of evidence was built from centuries of hard won experience.

“When it works, it represents as good a balance as we've got between the need to restrain the state and the need to keep crime in check. Bypassing that system is illegal for a good reason.

“I now join [Downey] in issuing a giant F*** You to the people who made these slides. I am not American, I am a Brit, but it's no different - GCHQ turns out to be even worse than the NSA.”