Several months later, Mr. Snowden said, he was writing his annual self-evaluation when he discovered flaws in the software of the C.I.A.’s personnel Web applications that would make them vulnerable to hacking. He warned his supervisor, he said, but his boss advised him to drop the matter and not rock the boat. After a technical team also brushed him off, he said, his boss finally agreed to allow him to test the system to prove that it was flawed.

He did so by adding some code and text “in a nonmalicious manner” to his evaluation document that showed that the vulnerability existed, he said. His immediate supervisor signed off on it and sent it through the system, but a more senior manager — the man Mr. Snowden had challenged earlier — was furious and filed a critical comment in Mr. Snowden’s personnel file, he said.

He said he had considered filing a complaint with the C.I.A.’s inspector general about what he considered to be a reprisal, adding that he could not recall whether he had done so or a supervisor had talked him out of it. A C.I.A. spokesman declined to comment on Mr. Snowden’s account of the episode or whether he had filed a complaint.

But the incident, Mr. Snowden said, convinced him that trying to work through the system would only lead to punishment. He said he knew of others who suffered reprisals for what they had exposed, including Thomas A. Drake, who was prosecuted for disclosing N.S.A. contracting abuses to The Baltimore Sun. (He met with Mr. Snowden in Moscow last week to present an award to him for his actions.) And he knew other N.S.A. employees who had gotten into trouble for embarrassing a senior official in an e-mail chain that included a line, referring to the Chinese Army, that said, “Is this the P.L.A. or the N.S.A.?”

Mr. Snowden added that inside the spy agency “there’s a lot of dissent — palpable with some, even.” But he said that people were kept in line through “fear and a false image of patriotism,” which he described as “obedience to authority.”

He said he believed that if he tried to question the N.S.A.’s surveillance operations as an insider, his efforts “would have been buried forever,” and he would “have been discredited and ruined.” He said that “the system does not work,” adding that “you have to report wrongdoing to those most responsible for it.”

Mr. Snowden said he finally decided to act when he discovered a copy of a classified 2009 inspector general’s report on the N.S.A.’s warrantless wiretapping program during the Bush administration. He said he found the document through a “dirty word search,” which he described as an effort by a systems administrator to check a computer system for things that should not be there in order to delete them and sanitize the system.