At the height of the London riots in 2011, when David Cameron mooted the idea of shutting off direct messaging from phones, the Iranians offered to send over human rights monitors to check that our Government was complying with international law. Who would have credited the mullahs with such delicious taste for mischief?

Two years on, the world’s most authoritarian regimes are having more fun at the expense of the Brits and our close allies, the Americans. This time the critique is more damaging because it carries some validity. The revelations about massive surveillance carried out by the National Security Agency in Washington and its sister organisation, GCHQ, over here have severely undermined both governments’ claims to be furthering the cause of civil liberties around the world.

With the whereabouts of Edward Snowden still unclear, recent coverage has focused on the behaviour and motivation of the whistleblower and his supporters. The personalities are certainly colourful, not least that of the ego-fuelled WikiLeaks founder Julian Assange and his motley band. Curiously much of the British coverage appears to have made light of the actual substance of Snowden’s revelations.

The scale of the harvesting of data about citizens around the world is mind-boggling. There is nothing selective about what the Americans, British and others have done. They have sought to collect everything anyone could possibly have communicated, just in case they had done something wrong. The latest allegations are among the most damning yet. These suggest the US has been systematically bugging offices of the EU around the world. European governments and MEPs have understandably responded with fury.

On Friday I asked a senior Asian diplomat if he thought the Chinese would have been surprised by any of the stories. Not at all, he replied. They had long assumed the Americans were doing this. The anger might not be genuine, he said, but the envy was. The Chinese were doing all they could to catch up: as are the Russians, as are all regimes ranging from the dictatorial to the merely dodgy.

A few weeks ago, before the Prism revelations emerged, I was having a similar conversation with a British diplomat. The difference between us and them, the official told me, is that we abide by international norms and they don’t. We have an independent judiciary, strong parliamentary oversight and clear rules on transparency and accountability.

Whitehall has long been in a quandary. One part of it, the Foreign Office, has been pushing a sincerely held agenda to promote free expression around the world, particularly in the Middle East, encouraging bloggers, activists and others to speak out for human rights.

Down the road at the Home Office they have been pursuing an equally sincerely held view that the internet is a dangerous place. The only way to keep track of all the bad people roaming cyberspace and the streets is to collect data on all 60 million of us plus any foreigners we happen to be in contact with. Plans to introduce the Communications Data Bill or “snoopers’ charter” have been put on hold thanks to determined resistance by Nick Clegg and others.

Now we know they didn’t really need the legislation — they’ve been doing it anyway, without bothering to recourse to the law. The sugar-coated assurances given to me by the British diplomat are, how can I put it politely, less than convincing.

So does all this put us on a par with Vladimir Putin and China’s new President Ji Xinping? Of course not. There is no moral equivalence, or anything close to it, on free expression or all the other rights that constitute a healthy democracy.

But what has changed is our Government’s credibility when it comes to telling others what to do. Next time we urge the Chinese to stop data intercepts around the world, they will turn round and laugh. Next time we encourage the Russians not to bug the communications of organisations they deem to be harmful to the state, they will stick up two fingers. The person targeted in Beijing or Moscow might be an artist or a blogger trying to draw attention to corruption. That is not the same, for sure, as a potential terrorist we may be trying to monitor over here. But such nuances will be lost in translation. “You’re doing it: we’re doing it. What’s the difference?”

It goes without saying that anti-terrorism and cyber-security are vital tasks of government. The issue is one of balance and accountability. Whenever politicians or security chiefs talk of “doing whatever it takes”, then democracy suffers.

A couple of weeks ago I was at an internet conference in Tunisia, perhaps the only success story that remains from the so-called “Arab Spring”. In Egypt, as vast, angry crowds take to the streets to demand the resignation of the Islamist president Mohammed Morsi, the mood is of bitterness and division. Elsewhere in the region progress is either slow or non-existent. Activists have long accused the West of picking and choosing its enemies and allies. Why get rid of Gaddafi in Libya while rolling out the red carpet for Saudi Arabia and Bahrain?

That complaint is not new. This one was: “I now suspect that all along the Americans were handing over my emails and my phone calls to the king.” So said a Jordanian when I asked her about the state of opposition in her country. Her response to the Prism leaks is deeply depressing. I’ll never know whether she is right. Nor will she. The fact that she thinks it is bad enough. The freedom not to be monitored is fast catching up with the freedom to speak. And even if the motives are benign (and let’s be generous for a moment), the Americans and the British now find themselves in a dark place.