Those who trade freedom for security deserve neither. Benjamin Franklin's platitude loses none of its force for being chronically in need of repetition. This week in the court of appeal a group of newspapers pleaded to be allowed to report the fact that a criminal trial was to be held in secret for the first time in Britain. A judge, Mr Justice Nicol, had earlier ordered that the press be gagged for reasons of national security. This was nonsense. There can be no way reporting the existence of a wholly anonymous secret trial threatens the integrity of the state. It threatens only its dignity.

The most obscene spectacle in London is not a courtroom but Connaught Street, W2. Two men in black fatigues lounge against a wall at the entry to a Georgian mews. They look like video-game gangsters, armed with revolvers and a machine gun apiece. They are guarding the back of Tony Blair's town house. Two armed guards also flank the front entrance. It is Bogotá or Beirut brought to Bayswater.

I cannot believe Blair's house either needs or deserves such a level of round-the-clock protection. The guns are pure machismo, showing off by the Metropolitan police. The same police were revealed last week as scheming to persecute cyclists entering Downing Street, apparently overruling No 10's own security. On Wednesday they casually shut down central London for a day just to get the monarch 400 metres across Westminster. They appear to answer to no one.

In each case the tired catchphrases are trotted out: of the war on terror, national security and "the innocent have nothing to fear". They have come to sustain everything from job creation for securocrats to risk aversion, protection insurance and now legal convenience. No one has the guts to countermand them. No minister, parliamentary committee, court or other institution feels it their place to do so, only sometimes the press.

The case before the court of appeal concerns the secrecy surrounding two unnamed men in a terrorism trial. We can now say they are accused of "preparing for terrorism", of the improper possession of a passport and of a document called "bomb-making".

The crown demanded total secrecy for the trial on the grounds that otherwise "there was a serious possibility that the trial may not be able to go ahead".

As counsel for the media said, for defendants to be anonymous, a court closed, and the press and public excluded are unprecedented. These restraints were a departure from open justice so extreme as to be "inconsistent with the rule of law and democratic accountability".

This was not all. The crown also demanded that mere mention of these restrictions be banned. Not only would British justice be closed but so would the fact of its lack of openness. It was as if power were embarrassed by its very potency. Mr Justice Nicol agreed, imposing a gag last month. It was this gag, appealed against by the press, that three judges threw out on Wednesday, though they have yet to decide on the secrecy of the trial itself.

I find it astonishing that these things should be occurring in peacetime Britain. Secret justice is more appropriate to Putin's Russia, communist China or former East Germany. Yet there are judges in Britain who are prepared to support closed justice – judges to whose oversight ministers frequently refer when accused of ruling by executive order.

Two decades ago, senior figures on the bench such as Lord Woolf and Lord Bingham laboured in the aftermath of miscarriages of justice in Northern Ireland, some of them the direct result of judicial secrecy. They were the most assiduous champions of the rule of law against an overbearing executive. These men seem to have given way to a new post-9/11 generation, gripped by President Bush's "creative alarmism" and a belief that they are in "a war to save civilisation". Some of them have become co-opted into the security apparatus, into Whitehall's various panels and commissions, where they barter liberty for an assumed safety.

This has to be dangerous. It is dangerous not just because all curbs on liberty are dangerous, especially those fuelled by the politics of fear. The past 20 years have seen a relentless ratcheting up of executive justice.

From drone warfare to Edward Snowden's revelations about mass surveillance by security agencies, from internment and control orders to the affair of the chief whip's bicycle, the impression is of terrorism being exploited as the fertiliser of untrammelled power. The worst facets of an authoritarian state are being given free rein, and with no countervailing balance.

National security should be a matter of profound respect. Just now the nation is commemorating the Great War and D-Day and its response to an existential threat to all Britain stood for in the 20th century. The nation's integrity was at risk, properly so called. This has nothing whatsoever to do with disparate groups of sinister men threatening to explode a bomb or shoot a politician.

Even if they killed hundreds, indeed thousands, it would not mean the end of the United Kingdom, let alone "the end of western civilisation". The nation is robust enough to withstand such outrages.

Whatever their warped motivation, terrorists commit common crimes and should be subject to common justice. They should not be accorded warrior status and the reward of a suspension of the rule of law. If open justice sometimes means a criminal going free, or even a bomb going off, that is the price of liberty. Pretending such justice might infringe the security of the state is beyond scaremongering. It is an abuse of language, unpatriotic, untrue.

Whenever I argue this, somebody retorts that I would not like it if someone I loved were killed by a terrorist. I am sure I would not, but then I also grieve death in an accident or at the hand of a madman. I hope only to have the courage to accept such a tragedy as the price of living in a free society. Rowing back on the rule of law is not security. It is cowardice.

• Comments on this article are off for legal reasons