President Donald Trump's rhetoric on North Korean nuclear aggression has been widely criticized for being too inflammatory, but former United Nations Secretary-General Ban Ki-moon said he believes the Republican's underlying message is inherently the right one.

"I know there are some different interpretations on what President Trump has been saying, but his underlying message has been clear: While he's ready to engage in dialogue, such North Korean behavior will never be tolerated," Ban told CNBC on Thursday.

The president has "shown a strong message of deterrence ... It is the right message," he said on the sidelines of the Barclays Asia Forum.

In early October, Trump publicly declared that diplomatic talks with North Korean leader Kim Jong Un were a waste of time — even as Secretary of State Rex Tillerson said Washington had active lines of communication to Pyongyang.

The possibility that Kim's regime may soon be capable of attaching a nuclear warhead to an intercontinental ballistic missile has unnerved the White House, which said in April that its official North Korea policy was "maximum pressure and engagement."