Brazil’s recent indignation over news that the U.S. spied on President Dilma Rousseff turned to embarrassment on Monday when the newspaper Folha de S. Paulo revealed that Brazil spied on Iranian, Iraqi, Russian and U.S. diplomats from 2003 to 2004.

Agents for Brazil’s intelligence agency, known as Abin, reportedly followed and photographed Russian diplomats involved in military-equipment negotiations and tracked the movements of diplomats from Iran and Iraq in their embassies and homes. Abin operatives also kept under surveillance office locations where U.S. Embassy personnel stored communications equipment that Brazilians feared was used for espionage. (The U.S. Embassy told Folha the equipment is not meant for spying but for basic emergency communication, and it was previously approved by Brazil’s telecom authority.)

Rousseff’s collaborators acknowledged the operations -- which were conducted under a previous administration -- in a four-point statement that described the spying as “counterintelligence operations” meant to “protect national interests” and in “absolute adherence to the law.” The government also warned that “the leaking of reports classified as secret constitutes a crime and those responsible will be processed according to the law.”

The irony of it all is overwhelming. Brazil’s government only found out the U.S. had spied on Rousseff thanks to former National Security Agency contractor Edward Snowden, who leaked U.S. intelligence reports that were "classified as secret.”

And Rousseff hasn't exactly taken reports of the U.S.'s surveillance activities lightly. She postponed a trip to Washington to protest what she told the United Nations General Assembly in late September was “a grave violation of human rights and of civil liberties.” Her government joined Germany (Chancellor Angela Merkel’s phone may have also been tapped) at the UN in pushing for a probe of the case and calling for a right to privacy in the face of digital spying.

How does Brazil justify one type of spying over another? Justice Minister Jose Eduardo Cardozo tried to make sense of that on Tuesday; he spoke of U.S. misdeeds: “I see completely different situations. What we had in relation to Brazil and other countries was a breach of secrecy, of the rules of the Brazilian Constitution. In other words, messages were violated; telephone calls were violated -- violations that were an affront to Brazilian sovereignty.”

Cardozo insisted Brazil’s own spies never violated other country’s borders, and he took issue with the methods the U.S. used to spy on Rousseff: “What one cannot do is violate the rights of people, the sovereignty of people. That seems to me a crucial difference. If we do not make that distinction, it would give the impression that we are using the same methods we denounce. That is not true.”

True, run-of-the-mill surveillance is different than tracking e-mail messages and mobile phone conversations on a massive scale, or on an individual level, as it reportedly happened to Rousseff. Still, the uncomfortable fact may be that Brazilian spies simply lack the technology to do more than they did.

Simple arithmetic tells the story better. Abin, an organization with an estimated 1,800 employees, has a budget of 500 million reais ($216 million) this year. In contrast, U.S. intelligence spending, the so-called “black budget” -- which was estimated this year at $52.6 billion -- covers dozens of agencies and sustains 107,035 intelligence community employees. The NSA alone has a $10.8 billion budget.

“How would the Abin act if it had all the resources of the NSA?” Fernando Rodrigues, a columnist for Folha, asked in a Wednesday piece. “Those questions of course have no answers. They would have to be tested in practice -- a nonexistent scenario.” Let's venture to guess that in such a scenario, U.S. President Barack Obama would want to be mindful of what he said about Brazil over the phone.

Some Brazilians seem to believe more regulation is the solution. On Tuesday, Vladimir Safatle argued in a Folha column that “the best defense is to prohibit governments from having the right to store sensitive information about its citizens.” That is hardly realistic -- and certainly not enforceable on a global scale.

Benito Paret, president of Rio de Janeiro's information technology industry association, provided a more useful takeaway. “Brazil cannot give up in the technology race, not only because it falls behind in what is the main industrial sector of the 21st century, but for basic security and for the country’s strategic defense,” he wrote in a Wednesday op-ed for the O Globo newspaper. He suggested fostering a stronger IT industry with better-trained professionals.

Meanwhile, Brazilian politicians, mindful of the presidential election next October, have continued to make U.S. spying a major political issue. Appearing to face up to the U.S. can gain Rousseff political points with her supporters. On Tuesday, telecommunications executives told a congressional inquiry commission they had no dealings with U.S. spy agencies and added that the NSA probably tracked Rousseff’s communications using devices that capture telephone radio waves.

Hypocrisy probably won't stop Rousseff and her allies from continuing to use the NSA scandal to gain political popularity at home. But in doing so, they turn a blind eye to the hard truth: The revelations -- about both countries -- show that snooping is an arms race. Hacking has become more important than taking photographs and hiding microphones in lampshades. And, as in any arms race, deeper pockets prevail.

(Raul Gallegos is the Latin American correspondent for the World View blog. Follow him on Twitter. E-mail him at rgallegos5@bloomberg.net.)