As his court case looms, Julian Assange is facing a rising tide of hostility. In this exclusive interview he insists: 'We have not once, in four years of publishing, got it wrong'

Julian Assange awakes to talk, from the nap he has stolen in an armchair at the Norfolk country house where he is staying. He has been up all night disseminating, on his WikiLeaks site, US State Department cables and documents relevant to the momentous events unfolding in Egypt, and they make remarkable reading.

The American diplomats writing the cables leaked to Assange report many of the reasons for the Egyptian uprising: torture of political dissidents, even common criminals, to obtain confessions; widespread repression and fear; and – of special interest to anyone who follows WikiLeaks – the increasingly important role of internet activism, opposition blogging and communication with democratic movements within and without the country over the web.

As ever with the diplomatic memorandums published by WikiLeaks – an act of dissemination for which Assange has become public enemy number one in the US – the cables are, ironically, testimony to the professionalism and straight- talking of the US State Department. Assange concedes that the cables contain "a relative honesty and directness, and quite a lot of wannabe Hemingway".

This is exactly what WikiLeaks considers itself established to do, exactly the kind of moment in history that Assange's organisation feels it can illuminate for the world – and to which it may even have contributed, he claims, "by creating an attitude towards freedom of expression", and by being read by Egyptians themselves. This should be one of the great days in the history of his organisation: Assange and a group of his colleagues huddled over a thicket of laptop computers, downloading, following events, sharing news and occasionally whooping at it. It is one hell of an hour in WikiLand, but a weird one, too, for other things are also on Assange's mind.

Tomorrow a book he considers to be an attack on him will be published by journalists with whom he once closely collaborated at the Guardian, sister newspaper to the Observer. Neither the Guardian nor Assange now speaks of one another with affection. The front page of the International Herald Tribune on the kitchen table next door carries an article of record length by the executive editor of the New York Times, Bill Keller, charting what Keller sees as an odyssey through the dealings with a difficult man, after which a "period of intense collaboration and regular contact with our source" came to a close – and an acrimonious one at that. Keller's article appears reasoned, I say to Assange, who retorts that he finds it "grotesque".

Moreover, in eight days' time Assange must face an extradition hearing instigated by authorities in Sweden, wishing to question him over alleged sex offences, a subject that his lawyers had advised him not to speak about in this interview. The hearings in London are due for 7-8 February – and on the first night, "right in the middle of the hearings", says Assange, "BBC Panorama will broadcast a sleazy piece" about Wiki-Leaks. "It's a mad scramble to get books out that self-justify their roles in all this," claims Assange, "instead of getting on with the job of writing about the information and the cables themselves." It was not, he concedes, always this way.

I first met Julian Assange in late summer last year, when he was staying at the Frontline Club for journalists in London. We had convened to discuss, for an article in Frontline's quarterly broadsheet, what was then the biggest single leak of official material in history, pertaining to the war in Iraq. In partnership with Iraq Body Count – considered to be (and criticised by the left for being) the more exacting and forensic of groups seeking to quantify the toll of Tony Blair's and George W Bush's war – WikiLeaks revealed, via the Guardian and other outlets of its choosing, 16,000 previously unrecorded civilian deaths between January 2004 and the end of 2009, recorded in thousands of leaked US army reports.

Assange had, among many other interesting things to say, a cogent observation about warfare: "What these documents show is that the bulk of civilian deaths are the 'car crashes' of war, not the 'bus crashes' of war that are picked up by the media. It is the vast number slain in incremental events killing one, two or three people which go unreported, as opposed to the deaths of 20 or more, which are reported. The number of 'small kills' is huge – a family here, a kid there, someone in a house, someone caught in a crossfire. It is the everyday squalor of war that takes the life of most."

This finding was riveting for two reasons. First, because it authenticated my own experience in trying to demonstrate the calamitous levels of civilian casualties during the Iraq invasion in spring 2003. In the hospital in Nasiriyah from which Private Jessica Lynch had been "rescued" by US forces (with the help of Iraqi medical staff), I found the wounded Kaham Kassim and his wife, two of whose children were shot dead by US troops at a roadblock as they tried to flee town. A third – a five-year-old girl, Zainab – was dying when she and her parents were turned out of beds in a barracks to make way for wounded soldiers. I found several similar cases.

The other intriguing reason was the way Assange had arrived at his conclusion, which seemed more scientific than journalistic. He asked me to bear in mind that his background was as a computer hacker and specialist in quantum mechanics. He was fascinated by the "media information flow economy".

People forget Assange is as interested in physics as he is in ideology, and that much of his work has been motivated by an application of the laws of mechanics to information. At that first meeting, he pulled a book off the shelf and talked at length about the many propulsions and interests that had got it there – "multiple reasons why the book has arrived on that shelf". There was also "a miasma of interests behind the spread of information," he said, "and the reasons why a piece of information reaches you."And the conversation went on for seven hours in that compelling vein.

Those were the days when Assange would invite you to return and visit him in his room at Frontline when some elaboration on a point he had made came to mind. Before it all got nasty, before solitary confinement and forests of television cameras parked outside the Norfolk house belonging to Vaughan Smith – Assange's guarantor of an address on bail. Before Assange became uncomfortable with questions based on articles by Keller that throw his thought patterns off course. Before Assange came to feel vilified and betrayed by the media.

Yet there was still time to talk, on Friday, with the sun streaming into Ellingham Hall – though it felt mean to drag Assange away from Egypt.

One of the main points raised in Keller's article is that the New York Times' voyage through WikiLeaks' information put the paper on a high wire – or in a "clash of values" – between its commitment to publishing material of public interest and Keller's staff's "large and personal stake in the country's security" and loyalty to the US, especially in the face of terrorism aimed "not only against our people and our buildings but also at our values".

There have been suggestions elsewhere that WikiLeaks has supplied grist to the mill of America's enemies and even endangered the lives of those who are identified in material it has disseminated itself – identities that Keller's paper was careful to redact.

"How do you best attack an organisation?" retorts Assange rhetorically. First, "you attack its leadership… with the dozens of wildly fabricated things said about me in the press – such as that I was living in luxury in South Africa. I have never been to South Africa." Second, "you attack the cash flow": Assange recounts the "extra-legal" sanctions by Visa, MasterCard, PayPal and others that have "cost us 90% of our revenue". And then "you attack our moral standing. There have even been claims we have killed people. Although no person is infallible, we have to date a perfect record in two important respects. One: we have not once, in our four years of publishing, got it wrong. We have never published something that was false and said that it was true. Two: despite our publication of serious material on over 100 countries, no one has come to any harm; neither is there any specific claim that anyone has."

Two of WikiLeaks' sources are in jail, however: Bradley Manning, alleged source of the army diary leaks, and Rudi Elmer, the former Swiss banker who handed Assange two disks of allegedly confidential financial information in London two weeks ago. Elmer was re-arrested in Zurich last week and is now being held without charge in solitary confinement. "I can't talk about our sources," says Assange, "but I can talk about what is happening to them. Manning, over 240 days in solitary, harsh solitary conditions, and still not tried." In both cases, "there's an immediate decision to find someone to blame for the exposures, rather than find culprits responsible for the crimes. It is a matter of 'save face, or you will lost control'."

Another criticism often levelled at WikiLeaks is that bursting the banks of information in this way will only lead to the construction of new flood defences by powerful institutions; in other words to more, not less, secrecy.

"The reaction by large corporations and government power," says Assange, "to a substantial increase in disclosure to the public was thought about in depth in 2006, when we launched WikiLeaks." The idea that powerful institutions would "go off record" in such a way is fanciful, he argues; discovering their behaviour will always be possible by obtaining internal records. "For instance, when I obtained the manual for standard operating procedure at Guantánamo Bay, I was surprised to see that it included not only many inhumane practices, but it instructed guards to falsify records to the Red Cross. [Because] there is no way for the centre of an organisation to reliably have its peripheral elements reliably carry out its orders… there is a clear, authorised paper trail. Any form of large-scale abuse must be systemised." And the acquisition of that paper trail, he argues, is the way to expose the abuse.

In this situation, organisations have two choices, says Assange. One is to "engage in plans that the public will support if they are revealed", meaning that they will have nothing to fear from transparency. The other is to "spend additional resources to keep those plans secret". The second, more common, course entails a toll on the economic logic of the organisation, which Assange calls a "secrecy tax". Also, "when an organisation acts in a more clandestine manner", he says, "its own internal efficiency decreases, because information cannot flow quickly through the organisation. This is another form of secrecy tax." For organisations to be efficient, they should be transparent, he insists.

I put it to him that all this is heading in the right direction from the point of view of persuading organisations of the virtues of transparency. "It's not optimism", he says, suddenly animated, "it's part of the plan!"

Of all the thousands of columns about WikiLeaks, few opened up the discourse more than David Rieff in the New Republic last December, which invoked cyber-baron Bill Gates's doctrine of "universal connectivity" on the web almost as a new ideology. Rieff makes an analogy between the WikiLeaks saga and the legal and popular challenges to Microsoft over the restrictions to "universal connectivity" built into its products, saying "the state is like Microsoft, with its closed-source technology, while WikiLeaks is the open-source alternative".

Assange says: "We called their bluff regarding how much 'universal connectivity' the political system really wanted after the cold war". He talks about "an unusual alliance" during the cold war between liberalism and the "military-intelligence-diplomatic sphere", both of which sought to illustrate freedom of expression as epitomising "our cultural values… in pointing out the lack of freedoms in the Soviet Union".

But the end of the cold war coincided with "new technology permitting more to be published, more cheaply, to a wider audience than ever before" – so there ensued a "clash between the surface ideology and the real underlying self-interest"; between "the rise of the internet on one hand… and, on the other, the government's natural interest to tolerate as little dissent as possible".

And so it would go on if Assange were not distracted by what he sees as the forthcoming blizzard of books and TV programmes about him and the speed with which he has become a bête noire of the Anglo-American media.

"I think he's held a mirror up to the media," says Vaughan Smith, his host, "to the idea of the media as priesthood, and I don't think we come out of it very well." Smith, the owner and founder of the Frontline Club, was challenged by some of its divided membership at a meeting last week over his shelter of and perceived support for Assange, though most supported it.

Assange points out that "non-Anglo media organisations are broadly supportive", citing an editorial in Spain's El País, a book in Germany called WikiLeaks: Enemy of the State and the fact that Le Monde in France named him man of the year. But today even these discourses must come to an abrupt stop, as Assange's principal aide bursts into the room – "Quick, quick! The people have taken over Alexandria!" – and Assange, though sleepless, leaps from his chair.

With some relief, it seems, he grabs a laptop, swivels round to sit on the floor and taps, taps, excitedly…