Head of US agency resigns following computer hack