The latest revelations about the breadth of the US government’s intelligence dragnet, an apparent effort to monitor a broad range of domestic internet and phone communication in search of foreign terrorists, is a reminder that when it comes to surveillance, the land of the free is more like Syria or Iran than we might think.

But don’t worry! Even as the National Security Agency monitors US internet activity, the State Department has been financing technology that will allow people to set up their own networks—the old “internet in a suitcase“—to get around monitoring by governments like Iran’s.

Iran holds a presidential election on June 14. When the last election in 2009 sparked protests both on the streets and online, the government reacted by blocking access to Twitter and Facebook, beefing up online surveillance, and starting work on an Iranian intranet to allow it central control over access to the world wide web.

Last week, the US announced that it would lift sanctions on certain hardware and software, including anti-tracking programs and virtual private networks that Iranians could use to circumvent the Ayatollah’s watchful eye. It also introduced new sanctions on individuals and companies, like Ofogh Saberin, that censor Iranian internet access.

To add a third layer of irony, the equipment Iran is using to build its surveillance and censorship apparatus is likely American. A Reuters investigation found that Iran’s government-controlled telecommunications firm bought US-made surveillance equipment from a Chinese company as part of a $130.6 million deal, to dodge international sanctions. The goods came from companies that included Microsoft, Oracle, Cisco, Symantec and HP.

The differences between the Iranian and US approaches to internet control are still large. Iran blocks entire services and censors expression, while installing extensive monitoring software without apparent legal fetters. The US government hasn’t attempted censorship, and its monitoring is subject to laws, congressional oversight, and judicial approval. However, those legal restraints are turning out to be a lot more permissive than anyone had thought.