Even when two nations profoundly dislike each other it is normal to avoid vulgar abuse in any statements about the relationship, or lack of it. North Korea doesn't play by those rules any more than it plays by any others, and its present stand-off with the United States is but the latest opportunity for it to prove that infantilism can have a walk-on part in international diplomacy.

Sony Picture attacked by Russian hackers not North Korea
North Korea called The Interview 'illegal, dishonest and reactionary' Reuters

In the last few days it has repeated its charming description of President Barack Obama as a "monkey", racism being just one of the weapons it chooses to use against the country it has decided is its mortal enemy.

The US and North Korea are still technically at war: the conflict in 1953 that led to the division of Korea into two countries was ended by an armistice that was never followed by a peace treaty, and America has 28,500 soldiers stationed in South Korea to keep the North at bay.

Over the last 61 years there have been moments of tension, but North Korea has rarely been more than an irritating pinprick in the side of the world's leading superpower. Now, that appears to have changed.

North Korea has denied responsibility for a devastating cyberattack on the Sony Corporation, perceived as a punishment for the so-called comedy film The Interview, in which the North Korean leader, Kim Jong-un, is parodied and his imaginary assassination is depicted.

As a result of the attack, in November, highly embarrassing internal emails were leaked, some of them about leading Hollywood stars. Sony did not believe the denials and, claiming to fear terrorist attacks on American cinemas, reacted initially by cancelling the theatrical release of the film. This appalled Obama, who criticised Sony, and the film then had a wider release than expected, including on the internet.

This is what provoked the racist insult: the North Koreans, who had chosen to believe that Obama had been behind the film in the first place, now chose (with more cause) to blame him for the decision to release it after all. They called the film "illegal, dishonest and reactionary", which proves how little humour travels despite the cult of globalisation.

North Korea was also convinced that some attacks on its websites last week were down to the Americans, something the US has yet to confirm or deny. If America did retaliate in this way it would at least show the North Koreans that they cannot attack American websites with impunity; and given the sort of nation they are dealing with, the eye-for-an-eye doctrine may perhaps be the only means of making its point effectively.

But it seems an almost undignified way for a power as great as America to behave towards a country such as North Korea, however deeply unpleasant North Korea may be; but America probably has no choice but to react in these terms, because there may be no other way that it can convey the necessary message. For its part, North Korea said, with its customary understatement, that the whole US mainland would be under threat if the US chose to retaliate.

North Korea warns attack on White House and Pentagon over Sony leaks
By 2020, North Korea could have enough material for 79 nuclear weapons Reuters

There is no doubt that cyberterrorism is a deeply serious matter. It compromises business and the fundamentals of the way in which business operates. If you wish to undermine an enemy – especially an enemy whose embrace of capitalism is in your eyes the most enormous ideological crime – then sabotaging his internet is a superb way of doing it.

North Korea may be in the dark ages in almost every other respect, but its understanding of what makes key aspects of the modern world function is pretty acute.

But what America must now do is to try to develop a long-term strategy for dealing with North Korea – not just when it chooses to attack a main base of America's commercial infrastructure, but in every other aspect of the two countries' co-existence. Some cultural differences may be irreconcilable – the sense of humour question again, not to mention freedom of speech – but the world is a dangerous enough place as it is without North Korea getting out of control.

The threat is worse than cyberattacks. David Albright, the president of the US Institute for Science and International Security, believes North Korea is increasing its production of plutonium and highly enriched uranium at four separate sites and that by 2020 it could have enough material for 79 nuclear weapons. As it is, North Korea has enough plutonium, it is believed, for nine nuclear weapons: so the consequences of the ultimate sense of humour failure could be grave, especially given how unhinged the man is whose finger is on the nuclear button.

There seems no prospect of anything resembling talks between Kim's regime and America. If the State Department wants to sleep more easily, it must go into overdrive to make common cause with the Chinese about North Korea and the threat of nuclear proliferation there: because China can command a hearing in Pyongyang, and has almost as much to lose as America if Kim's current strategy continues, and North Korea becomes lethal rather than just an offensive irritant.

Dr Simon Heffer is a British commentator and author who has written columns for The Daily Mail, The Daily Telegraph, The Spectator and The New Statesman. He is the biographer of Enoch Powell, Thomas Carlyle and Ralph Vaughan Williams and recently published High Minds: The Victorians And The Birth Of Modern Britain.