In fact, when, Gen. James R. Clapper Jr., the director of national intelligence, had an impromptu dinner in early November with his North Korean counterpart during a secret mission to Pyongyang to secure the release of two imprisoned Americans, he made no mention of Sony or the North’s growing hacking campaigns, officials say.

Image Gen. James R. Clapper Jr. says he had dinner last fall with the man who later oversaw the Sony attack. Credit... Mark Lennihan/Associated Press

In a recent speech at Fordham University in New York, Mr. Clapper acknowledged that the commander of the Reconnaissance General Bureau, Kim Yong-chol, with whom he traded barbs over the 12-course dinner, was “later responsible for overseeing the attack against Sony.” (General Clapper praised the food; his hosts later presented him with a bill for his share of the meal.)

Asked about General Clapper’s knowledge of the Sony attacks from the North when he attended the dinner, Brian P. Hale, a spokesman for the director of national intelligence, said that the director did not know he would meet his intelligence counterpart and that the purpose of his trip to North Korea “was solely to secure the release of the two detained U.S. citizens.”

“Because of the sensitivities surrounding the effort” to win the Americans’ release, Mr. Hale said, “the D.N.I. was focused on the task and did not want to derail any progress by discussing other matters.” But he said General Clapper was acutely aware of the North’s growing capabilities.

Jang Sae-yul, a former North Korean army programmer who defected in 2007, speaking in an interview in Seoul, said: “They have built up formidable hacking skills. They have spent almost 30 years getting ready, learning how to do this and this alone, how to target specific countries.”

Still, the sophistication of the Sony hack was such that many experts say they are skeptical that North Korea was the culprit, or the lone culprit. They have suggested it was an insider, a disgruntled Sony ex-employee or an outside group cleverly mimicking North Korean hackers. Many remain unconvinced by the efforts of the F.B.I. director, James B. Comey, to answer critics by disclosing some of the American evidence.

Mr. Comey told the same Fordham conference that the North Koreans got “sloppy” in hiding their tracks, and that hackers periodically “connected directly and we could see them.”