Clear new laws are needed to cover security services' powers to monitor online activity, the UK's terror watchdog has said.
David Anderson QC, the independent reviewer of terrorism legislation, said the UK needed "comprehensive and comprehensible" intrusive powers rules.
Existing legislation was "fragmented" and "obscure", he said in a 300-page report.
Ministers want new laws to help police and agencies monitor online threats.
But critics have dubbed government proposals a "snoopers' charter", warning the plans will infringe privacy.
Home Secretary Theresa May said the report provided a firm basis for consultation on the new legislation which would come in the autumn.
Mr Anderson's report, called A Question Of Trust, was commissioned as part of the government's plans to modernise what types of activity security agencies can capture in their pursuit of criminals and terrorists.
The current legislation pre-dates most internet-led communications such as apps and social media.
The report recommends that:
- Security and intelligence agencies should have powers to carry out "bulk collection" of intercepted material but there must be "strict additional safeguards".
- Judges should authorise requests to intercept communications, limiting the home secretary's current role in deciding which suspects are so monitored.
- Proposed "snoopers' charter" powers must be subjected to "rigorous assessment" of whether they would be legal or effective.
- The definition of communications data should be "reviewed, clarified and brought up to date".
Investigatory powers explained
- Communications data: The information that reveals who was in contact with whom and when, but not the actual content. Agencies already have some of these powers, such as to gather logs of phone calls or emails.
- Intercepted communications: The actual content of the message, such as a secret recording of a phone call or capturing the actual words in an email. Agencies need ministerial authorisation to gather this information.
- New communications data powers: The government wants agencies to be able to gather any type of online communication if they need it to combat serious crime or terrorism.
Mr Anderson said: "Modern communications can be used by the unscrupulous for purposes ranging from cyber-attack, terrorism and espionage to fraud, kidnap and child sexual exploitation.
"A successful response to these threats depends on entrusting public bodies with the powers they need to identify and follow suspects in a borderless online world. But trust requires verification."
He went on: "Each intrusive power must be shown to be necessary, clearly spelled out in law, limited in accordance with international human rights standards and subject to demanding and visible safeguards. The current law is fragmented, obscure, under constant challenge. It is time for a clean slate."
He said that in the digital world, as in the real world, "no-go areas" for intelligence and law enforcement agencies should be minimised.
"The agencies do not look to legislation to give themselves a permanent trump card," he wrote. "Neither they nor anyone else has made a case to me for encryption to be placed under effective government control."
The 'snoopers' charter'
By Dominic Casciani, BBC home affairs correspondent
Ministers want to extend current powers - but critics such as campaign group Liberty say that the proposals amount to a "snoopers' charter".
Just to be clear - the powers themselves shouldn't necessarily be characterised as secret because they are set out in legislation. But the actual techniques devised thanks to those laws are.
Interception means using intrusive techniques to listen in or read real communications. In the old days of black and white television, that meant opening mail or tapping a phone line. In the modern world, the principle could be applied to all manner of communications.
Collecting bulk data is where there is a warrant to collect lots of information as part of an operation where one or both of the senders or recipients is based overseas.
GCHQ can seek a warrant to collect this information - although it must also explain if it is going to end up collecting private information of people unrelated to the operation.
Now, depending on your position, bulk collection is either mass surveillance or "target discovery" - security jargon for fishing for bad people you previously didn't know existed.
The government's forthcoming communications data legislation was first mooted by Tony Blair's government and then dropped - before being revived under the coalition.
Ministers dropped the plan following a coalition row after the Liberal Democrats blocked it. The home secretary wants it passed before some related emergency powers expire at the end of 2016.
Speaking in the House of Commons, Mrs May welcomed Mr Anderson's report, insisting that the UK must not overlook how threats were evolving.
She said: "They include not just terrorism from overseas and home grown in the UK, but also industrial, military and state espionage.
"In the face of such threats, we have a duty to ensure that the agencies whose job it is to keep us safe have the powers they need to do the job," she added.
And Shadow Home Secretary Yvette Cooper said Labour had backed the Anderson review because it had already concluded current laws were no longer fit for purpose.
"Technology has moved on. But neither the law nor the oversight have," she said. "Reforms are needed. We need to get them right. In a democracy we need to protect both our liberty and our security."
National Police Chiefs' Council chairman Sara Thornton said crime was increasingly being committed or arranged online - whether by fraudsters, rapists, child abusers or terrorists.
"In recent years, more blind spots have developed where police cannot effectively trace criminal activity," she said.
"Children have been driven to self-harm by harassment and bullying online but our attempts to investigate and stop it are curtailed by our inability to see who is talking to them on social media."
Rachel Logan, of Amnesty International, said she was pleased that Mr Anderson's report agreed the country's surveillance laws needed a "radical overhaul".
"We'll need to see the fine detail here and we'll be arguing strongly for proper limits on the powers of the snoops and the spooks," she said.
Professor Anthony Glees, from the University of Buckingham's Centre for Security and Intelligence Studies, told the BBC that Mr Anderson was "barking entirely up the wrong tree" by recommending that unelected judges should authorise requests to intercept communications.
"Judges have a duty to uphold the law, politicians have a very primary duty to deliver national security and in these cases, which are all about national security, it is entirely right that an elected politician should decide," he said.