SEOUL, South Korea — North Korea on Sunday denied responsibility for hacking the computers of Sony Pictures Entertainment but appeared to relish the attack that crippled the computer systems of the Hollywood company, which is set to release a comedy that involves a plot to assassinate its leader, Kim Jong-un.

Sony Pictures is producing “a film abetting a terrorist act while hurting the dignity of the supreme leadership,” a spokesman of the National Defense Commission, Mr. Kim’s top governing agency in Pyongyang, was quoted as saying by the North’s Korean Central News Agency.

The spokesman said North Korea did not know why Sony was targeted, but he speculated that the attack “might be a righteous deed of the supporters and sympathizers with” North Korea in its struggle to “put an end to U.S. imperialism.”

A hacking attack last month shut down the computer systems of Sony Pictures and exposed a trove of internal data, including salary figures. North Korea has since emerged as a possible suspect because it has been criticizing Sony Pictures for producing “The Interview,” a comedy starring Seth Rogen and James Franco that involves the assassination plot against Mr. Kim.