Firms including Google, Yahoo and Facebook have been accused by a senior official at the National Security Agency (NSA) of knowing about government data collection, having previously denied any knowledge.

Rajesh De, the NSA general counsel, said all data gathered from technology firms occurred within the law and with the knowledge of the companies.

Speaking at a hearing of the US government's institutional watchdog, De explained that the Prism data collection programme occurred under the 2008 FISA Amendments Act.

"Prism was an internal government term that as the result of leaks became the public term," De said. "Collection under this program was a compulsory legal process, that any recipient company would receive."

Staunch denial

Earlier this year, Google's executive chairman Eric Schmidt insisted that he was completely unaware of the NSA data collection.

"I have the necessary clearances to have been told, as do other executives at the company, but none of us were briefed," he told the Guardian.

A Google spokesperson told IBTimes UK today that the firm had "nothing new" to say on the matter.

Google has always claimed to be very against government snooping, forming an alliance last year with other major tech companies to demand widespread reforms to government surveillance.

Right of the individual

"We understand that governments have a duty to protect their citizens," an open letter to Washington from the Reform Government Surveillance coalition read. "(But) the balance in many countries has tipped too far in favour of the state and away from the rights of the individual. It's time for a change."

Last week, Facebook founder Mark Zuckerberg personally telephoned US President Barack Obama to berate him about revelations that the NSA had been using a fake Facebook server to infect computers with malicious malware.

Despite introducing measures to apparently prevent intelligence agencies from accessing their data - such as Google's use of encrypted search and Facebook's rollout of HTTPS (hypertext transfer protocol secure) - large technology companies are making no secret of the fact that they collect user data for their own purposes.

A recent report revealed that Google was using its own educational apps, used by millions of students around the world, to "scan and index" their data for purposes that included advertising.

"Gmail scans and indexes email for multiple purposes," the firm said in a separate statement to IBTimes UK. "This scanning is done on all incoming emails, is 100% automated and can't be turned off."