Some have urged President Trump to open negotiations with him. But it is unclear whether Mr. Kim is interested in talking, or what if anything he might demand in exchange for freezing or abandoning his nuclear program. He has made building a nuclear arsenal a top priority, arguing that it is the only way the North can guarantee its security and develop its economy.

His ultimate motives, like many details of his life, are uncertain. Since taking power, Mr. Kim has yet to travel abroad or host a visit from another head of state. Only a few people outside North Korea have been allowed to meet him, among them the former basketball star Dennis Rodman, a Japanese sushi chef and the vice presidents of Cuba and China.

What little is known of Mr. Kim’s record suggests ruthlessness — and some ideological flexibility.

South Korean intelligence officials say Mr. Kim has executed scores of senior officials, including his own uncle, a wily power broker who had been seen as his mentor. He is also assumed to have ordered the assassination of his half brother, who was poisoned by VX nerve agent at the Kuala Lumpur International Airport in Malaysia in February.

Yet Mr. Kim is also credited with loosening state controls on the economy and engineering modest growth, and regaining some of the public confidence that the dynastic regime enjoyed under his grandfather and lost under his father, whose rule is remembered for a devastating famine.

“Smart, pragmatic, decisive,” Andrei Lankov, a North Korea expert at Kookmin University in Seoul, said of Mr. Kim. “But also capricious, moody and ready to kill easily.”