A National Security Agency contractor has been arrested for allegedly stealing highly classified government codes developed to hack into foreign government networks.