Recent days have brought encouraging, albeit slight, signs of progress in Egyptian-sponsored talks to end the fighting in Gaza. The immediate conditions are likely to be the halting of further rocket attacks from Gaza, the opening of the border crossings and the end of weapons smuggling into Gaza. No truce will be credible without these measures.

The tragedy is that they could have been advanced without a new conflict and could have become the start of a longer conversation about peace. It underlines the folly of maintaining the fiction that Hamas is beyond the pale and cannot be a partner in talks towards first a ceasefire, and then a settlement, when Hamas leaders have already indicated that they could, in the right circumstances, accept a two-state solution on the basis of the pre-1967 borders.

The fact that a small but reputable British non-governmental organisation, Forward Thinking, which consults me for diplomatic advice, has been in close contact with the Hamas political leadership over the last four years, has raised some eyebrows. How, given Hamas's image and record, can this be in Israel's interests?

Some senior Israelis must believe it can be, because we have been transparent with the Israelis about our work and privately encouraged across the Israeli political spectrum. The reason is a fundamental and important one. If you want permanent peace, it is no good talking only to the representatives of your adversary who are more than halfway to agreeing with you and who do not represent the majority. That was the flaw behind Washington's Annapolis process in 2007. No solution is possible between Israel and Palestine unless the centres of gravity of Israeli and Palestinian public opinion are capable, with an effort, of touching each other. Majorities on both sides, at least before the bombing started last month, want peace and a normal life, and would support a diplomatic initiative that led to that.

Since January 2006, when to their surprise they won a fair election, Hamas have been closer to the Palestinian centre than Fatah, whose corrupt and ineffective performance lost them support. Hamas as a movement covers quite a range of views, some of them unacceptably angry and violent. Rockets from Gaza aimed at Israeli towns are pointless and must stop: no vehement protest, even over brutal occupation, should kill civilians on the other side.

But the more thoughtful strand of thinking in Hamas recognises the need for a political process and is ready to engage in the search for a durable solution to the conflict with Israel. It was open to further encouragement when Hamas was keeping the peace on its side in 2006 and 2008. Hamas, which in fact has no deep-rooted argument with the west or Christianity, no political alliance with Tehran or Hezbollah, no respect for al-Qaida and no "charter" for the destruction of Israel in its political programme, just wants the Israeli occupation to end.

Whatever its leaders think they are accomplishing by the assault on Gaza, it is damaging Israel's image and interests and making a long-term solution of Israel's security problems harder – as Avi Shlaim's powerful article in the Guardian last week explained. If the border crossings had been opened in the autumn of 2008, as Israel had agreed to do as part of last year's ceasefire terms, the rockets on Israeli towns would have stopped; the image of a Gaza prison would have evaporated; more than 1,000 Gazans and 13 Israelis would still be alive; Hamas representatives in Gaza, Damascus and the West Bank could have met to evolve their strategy for a negotiation; and the UN and the international Quartet could have got down to some intensive diplomatic work. In preferring the gun, I fear that Israel is making a two-state solution more remote. Is that the real political objective of the attack, which has never been clearly stated by the Israeli government?

We need stronger voices for civilised reason in Britain, in Europe and in the US. Peace prospects in the Middle East have been set back. The humanitarian consequences are appalling. A more radical Arab and Islamic world, which is one possible outcome from this mess, is a real danger for our own national interests. The British government is right to be calling for an immediate halt to the military action, though the foreign secretary, David Miliband, has accepted that they did too little too late when a peaceful route was available. Israel-Palestine's bilateral problems are the world's problems, and there is no use in seeking a remedy without a fundamental push for justice for all the people involved, equally, on both sides.