Brazil debates internet law in wake of NSA scandal
Along with Russia, China and Iran, Brazil was one of the countries of most interest for US intelligence agencies, according to the leaks from the US National Security Agency (NSA).
But whereas those other countries may not have appeared too surprised by the extent of US spying, Brazil was outraged.
Documents leaked by the NSA whistleblower, Edward Snowden, indicated that the agency had monitored internal Brazilian government communications, had spied on the state oil company, and had even intercepted data from President Dilma Rousseff's own office.
In response, Ms Rousseff cancelled a trip to Washington. In an angry speech at the United Nations General Assembly, she accused the US of breaking international law.
"Friendly governments and societies that seek to build a true strategic partnership, as in our case, cannot allow recurring illegal actions to take place as if they were normal," she exclaimed. "They are unacceptable."
Together with Germany, Brazil also put forward a resolution calling for an end to excessive electronic surveillance.
Customers at the Cyber Gol internet café in Catete, a commercial district near the centre of Rio de Janeiro, overwhelmingly agree with President Rousseff's response.
"It's a scandal," Paula Fladel, a 42-year old businesswoman, tells the BBC.
"I was outraged at the arrogant, overbearing meddling that the US carries out in practically the whole of the world."
Joanne Lima, a 22-year old student, says the US has taken advantage of its technological expertise.
"They want to play the part of the world's policeman. Not only in Brazil, but in other countries too," she says.
"The Brazilian government must take stronger measures to protect our privacy."
In fact, Brazil is considering further action. At the end of October, President Rousseff granted what is termed "constitutional urgency" to new legislation on internet usage.
After two years crawling through congress, the Marco Civil da Internet - a civil rights framework for internet users and providers - must now be debated ahead of all other parliamentary business.
The bill includes measures to protect users' privacy and right to free speech and would prohibit internet service providers (ISPs) from discriminating between different types of content.
But in the rush to respond to her citizens' anger over US data intercepts, the president has insisted on an amendment which critics argue could lead to Brazil ending up with a substandard version of the net.
President Rousseff wants all internet companies operating in Brazil to store copies of personal information on their Brazilian clients in the country.
By doing so, the firms providing cloud services would become subject to local privacy laws.
But the most prominent supporters of the original version of the bill think that not only will the amendment fail to secure individual's data, it will also drive up the costs for companies operating in Brazil, and impede local innovation.
Ronaldo Lemos is the director of the Institute of Technology and Society in Rio de Janeiro and one of the architects of the Marco Civil.
"This forced local data storage will make internet companies flee from Brazil," he says.
"Brazilian internet users will have a second class service compared to Americans or Europeans.
"Websites offering services to Brazilians will have to worry about building a data centre in Brazil."
Data storage in Brazilian is costly in comparison to both neighbouring countries and the US.
Figures from 2012 indicate Brazil has more than 86 million internet users.
Social networks are hugely popular in a country where telephone services are still expensive and patchy.
The Latin American giant is second only to the US in terms of individual Facebook users. On making a new acquaintance, Brazilians are more likely to invite each other to continue the relationship on "Face" than they are to ask for a phone number.
Brazil also boasts the world's second-largest number of Twitter users.
With the social media market in the US and Europe close to saturation point, China's internet users limited in their freedoms, and India's digital revolution still in its infancy, Brazil is set to play an increasingly important role in shaping the global rules governing social media users' data.
Critics worry that President Rousseff's proposed legislation could set a precedent that other countries, with less regard for freedom of speech, might follow.
But Glenn Greenwald, the Brazil-based journalist who reported Edward Snowden's leaked material, says this is a natural reaction to the anger the NSA's activities have provoked.
"I think a lot of countries are going to start to look for ways in which they don't have to be dependent on US infrastructure," says the writer who previously reported for the Guardian newspaper.
"One of the ways that the NSA currently intercepts people's data is by physically invading their telecommunications systems through using American companies that have access to their systems.
"The more means that are cut off for the NSA to be intercepting this data, I think the more secure these systems will become."
Given the widespread opposition to the proposal, it is not clear whether it will survive the final draft of the bill, due to be voted on this week.
But the government has indicated that if its idea of local data storage does not form part of the Marco Civil, it will seek to draft separate legislation enshrining the proposal in law at a later date.