The head of technology giant Apple has said privacy is a "basic human right" and no government or private company should be able to access personal information.

Tim Cook, CEO of the US firm, also said invading people's privacy would not solve the issue of terrorism and would punish the "99.999% of people who are good".

His comments come amid a debate in the UK over whether security agencies should be given access to people's personal data, such as emails, to help detect potentially-violent extremists.

But Mr Cook told the Daily Telegraph: "None of us should accept that the government or a company or anybody should have access to all of our private information.

"This is a basic human right. We all have a right to privacy. We shouldn't give in to scaremongering or to people who fundamentally don't understand the details.

"History has taught us that privacy breaches have resulted in very dire consequences. You don't have to look back too far or be a historian to see these things. They are readily apparent.

"You don't want to eliminate everyone's privacy. If you do, you not only don't solve the terrorist issue but you also take away something that is a human right. The consequences of doing that are very significant."

Mr Cook added that those plotting acts of terrorism could disguise their data through encryption and making firms such as Apple make information available to authorities would only impact law-abiding people.

He told the paper: "Terrorists will encrypt. They know what to do. If we don't encrypt, the people we affect (by cracking down on privacy) are the good people. They are the 99.999% of people who are good."

In the wake of the Paris shootings last month, British Prime Minister David Cameron vowed that a new Conservative government would introduce "comprehensive" legislation to ensure there was no "safe space" for terrorists to communicate over the internet.

But the draft Data Communications Bill, which is deemed essential by Home Secretary Theresa May but bitterly opposed by Deputy Prime Minister Nick Clegg, has been kicked into the long grass by a coalition impasse on the issue.

Last week there was a call by some peers in the House of Lords to make the so-called snoopers' charter law, saying parliament had a duty to act.