Tim Berners-Lee is known as the gentle genius with the mild touch, a man who is strikingly modest despite having created one of the epochal inventions of the modern age, the world wide web. But get him on the subject of what the National Security Agency and its British equivalent, GCHQ, have been doing to crack encryption used by hundreds of millions of people to protect their personal data online, and his face hardens, his eyes squint and he fumes.

"I think that's appalling, deliberately to break software," he says in an entirely uncharacteristic outburst of ire. Of all the reasons he is concerned about Edward Snowden's disclosures relating to UK and US spying on the web – and there are many, as we shall see – it is the cracking of encryption revealed by the Guardian in partnership with the New York Times and ProPublica that seems to rile him most.

"Internet security is hard," he says with emphasis. "All systems have undiscovered holes in them, and it's only a question of how fast the bad guys can discover the holes compared with how fast the good guys can patch them up."

We are talking in his office in the wildly shiny and curvaceous Frank Gehry building at MIT in Cambridge, Massachusetts, where Berners-Lee leads the World Wide Web Consortium (W3C), a global community working to develop standards for the web. He continues with the encryption theme: "So it's naive to imagine that if you introduce a weakness into a system, you will be the only one to use it. A lot of the IT industry feels that's a betrayal."

Berners-Lee is astounded by the internal contradiction in the way London and Washington have handled the threat of cyberwarfare. The two governments have elevated the fight against organised hacker gangs and militarised cyber-attacks from states such as China to the rank of a top national security priority. Yet at the same time their spying branches have actively aided cybercriminals by weakening encryption.

"It's foolish from their point of view," he says, adding that it's also ethically misguided: "Any democratic country has to take the high road; it has to live by its principles. I'm very sympathetic to attempts to increase security against organised crime, but you have to distinguish yourself from the criminal."

Many people will know of Berners-Lee from his cameo role in the opening ceremony of the London Olympics. Towards the climax of Danny Boyle's spectacle, the stage opened up and the spotlight fell on the computer scientist sitting at a desk in the middle of the Olympic Stadium typing the words: "This is for everyone."

In a sense, all Berners-Lee's worries about Snowden's disclosures flow from this one simple slogan. "What do I mean when I say the web is for everyone?" he says. "I mean that everybody should be empowered by it, not just to read it but to have their voice heard and to participate in the democratic process."

Berners-Lee was convinced about the importance of what he calls "universality" from the instant in 1989 when he circulated to a few colleagues a memo proposing the creation of a web of information that would connect everything and everyone through links. Over time, though, he has come to realise there is a second imperative that is almost as vital as the first.

"What is obvious now is that not only must the web be for everyone, we also need everyone to be for the web. The ability to use the web, and the power of it, comes with an obligation: individual web users have to stick up for their rights. The obligation of a web user is to look at the way the internet is provided and complain very loudly if it deviates from being neutral."

Berners-Lee is not your average web user, but he certainly has been complaining very loudly about the deviations he perceives. He warns that the universality and openness of the web, for which he has so long campaigned, is "under very serious threat" from the systematic surveillance of people's internet metadata in programs such as the NSA's Prism and GCHQ's Tempora.

"You can argue about the legality or illegality of what the NSA and GCHQ were doing," he says. "But look at the ethics of it." The secret foreign intelligence surveillance court, often referred to as the Fisa court, that is supposed to be overseeing internet spying by the NSA, "was dysfunctional and unaccountable. Even if the court had been blocking a lot of things the NSA was doing, it would still have been unaccountable".

Well before the Guardian began publishing stories drawn from Snowden's leaked files, Berners-Lee was concerned that surveillance could damage the web by reducing confidence in its privacy. "When you think about privacy you have to think about how intimate our use of technology has become," he says. "When someone is worried about a social or medical issue, about their sexuality or whether they have cancer, they can put their trust in the complete secrecy of the web. Maybe they are a minor, and too embarrassed to go through their parents. It's important to preserve the ability to do things over the internet that are very intimate."

A loss of faith in privacy caused by government collection of metadata could have a chilling effect, he believes. "The chilling effect is where the teenager does not click on the button and ends up being misinformed. Or when somebody does not want to admit they are depressed and commits suicide because they are worried they were being watched when they clicked on a site. The chilling effect is when people know something is wrong but don't report it because they fear it will damage their career or put them in jail."

There's another, potentially even greater, danger that flows from interfering governments – that it could stymie what Berners-Lee calls "intercreativity", or the act of creativity that happens when people interact freely and safely with each other on the web. He tried to embed that quality in the architecture of the web right as he devised it at its very inception.

"Intercreativity is where people share half-formed ideas, brainstorm, put parts of a solution together over great distances through the web. It's clear that you need a very safe space for people to brainstorm. When people think their ideas will be reviewed, they will not do that. When you take away the safe space, you take away a lot of the power of human problem-solving."

Berners-Lee's personal brand of intercreativity is visibly on display on the whiteboard in his office. It is covered in a dense swirl of words, symbols and flow lines in several colours – a mad professor's frenzied splurge of ideas. To the uninitiated, the scribblings are gobbledegook. Take the sequence scrawled on one corner of the board: "html js / deeps / me. forts / msg / BBT subscribe files / ADD support / Facebook".

Berners-Lee talks in much the same way as he writes on the whiteboard, his thoughts rushing over each other in such a flurry he sometimes stumbles over his words. He browses widely in his search for examples to illustrate a point, drawing from internet geekery, politics and social sciences with such seamlessness that it provokes the feeling that the world wide web is nothing but a binary expression of its creator's own roaming mind.

Which leads us to talk about the most existential threat to the web that Berners-Lee fears could result from state surveillance – the risk that the simple act on which the power of the web depends, the ability to link from one page to the next in just one click, could be jeopardised. Already, governments such as Brazil are looking at ways to uncouple their internet networks from the US to curb NSA snooping, raising warnings that the internet is about to be Balkanised.

Any move in that direction would damage a central principle of the internet, that it should be multiply-connected. "If you try and really split up the web, then it fails," he says bluntly. "The power of the web is that you can link to anything. If there's any category of things you can't link to then the value of the whole system drops tremendously, so much so that people would no longer use it."

Any country that tries to create what he calls a "walled garden" of the internet would find the value of its GDP drop through the floor. Trade would be disrupted, cross-cultural exchange wither. "Boy, would it increase the cost of the system! It would be a horrible constraint and it wouldn't really help – it wouldn't stop the NSA getting its hand on the data."

Berners-Lee is clear-eyed about the various threats posed by state surveillance, but it doesn't end there. He is also clear about what needs to be done to redress the problem. He begins by saying he agrees with the British and US governments that they have to be able to pursue criminal activity on the internet. "Clearly we do have to have investigative police powers," he says. But he goes on: "Clearly too we need to have people to guard the guards themselves, and in both the UK and US we have been complete failures in setting up that system. We can't be naive. We've failed. When you look at who guards the guards, there has been only one answer to that: in practice it has been the whistleblowers."

Berners-Lee believes that the challenge of devising a new system of checks and balances that will protect the universality and vibrancy of the web while allowing the NSA and GCHQ to carry out necessary investigative functions needs to be met by an engaged and informed public. "The future of the internet must be in multi-stakeholder governance," he says, in which state agencies and large internet companies participate, but at arm's length.

Next year, the 25th anniversary of the birth of the world wide web as defined by that first memo he circulated in 1989, is the perfect moment, he suggests, to devise what he calls a charter of rights for the internet.

I ask him how he would he frame such a charter were he to write it himself. He answers the question with a stream of consciousness, firing out bullet points about the fundamentals he would expect as an internet user:

• "I can behave as though I'm not being spied on.

• "If I'm being spied on, I know it's by somebody I trust for reasons that I approved, even if it's done secretly, and I know there's a system in place that ensures it is accountable to the public.

• "I can communicate with everybody and I won't find my packets suddenly delayed because I go to an abortion site and my ISP provider disapproves of abortions.

• "That the internet is neutral politically from the point of view of race, colour, creed, sexual preference – all the things where we do not discriminate."

Berners-Lee, who was brought up in south-west London and still spends a part of every month in the UK, has a special message for his country of birth. He is convinced such a proactive search for an internet charter could be transformative for the UK. After all, he quips, isn't the British constitution famously not worth the paper it isn't written on?

"Maybe it's time for Brits to decide that being constitution-less has lasted long enough. That it's time to put down some basic rights. We've seen our rights being violated, so let's write down what they are. Let's include the rights of the internet, let's include the independence of the fourth estate which is parallel but different. And let's include something that Britain can learn from America – the right to freedom of speech."

A life of sharing information

1955 Born in London

1976 Graduated in physics, Oxford University

1980 While working at Cern, the Geneva-based European laboratory for particle physics, he proposes a hypertext project to allow sharing information between scientists. Calls it ENQUIRE

1989 Proposes an internet-based initiative for global information sharing which he calls world wide web Aim is 'to allow all links to be made to any information anywhere"

1990 Writes the first web client and server. His specifications of URLs, HTTP and HTML are refined as web technology spreads

1994 Founds the World Wide Web Consortium (W3C), an organisation that seeks to lead the web to its full potential, at the at Massachusetts Institute of Technology where he is a professor

2009 Sets up World Wide Web Foundation that campaigns to end the global digital divide between those who are on the web and those who aren't.