Evidence gathered by software hidden by the N.S.A. to monitor North Korean activities proved critical in persuading President Obama to accuse the government of ordering the cyberattack on Sony,...