China has been violating an agreement with the United States aimed at stopping cyber espionage through the hacking of government and corporate data, a senior U.S. intelligence official said on Thursday.