Gen. Keith Alexander, the director of the National Security Agency, called on the public Wednesday to help defend his agency's powers as Congress mulls restrictions aimed at protecting privacy.

"We need your help. We need to get these facts out," Alexander said during a cybersecurity summit at the National Press Club. "We need our nation to understand why we need these tools."

He warned that if Congress hampers the NSA's ability to gather information, it could allow for terrorist attacks in the United States similar to last week's massacre in a mall in Nairobi, Kenya.

ADVERTISEMENT

"If you take those [surveillance powers] away, think about the last week and what will happen in the future," he said. "If you think it's bad now, wait until you get some of those things that happened in Nairobi."

He said the United States is fortunate to be able to have "esoteric" discussions because the NSA and other agencies are effective in stopping terrorists.

Following leaks by Edward Snowden this summer about the scope of the NSA's surveillance, numerous lawmakers, including Senate Judiciary Committee Chairman Patrick Leahy Patrick Joseph LeahyBattle over timing complicates Democratic shutdown strategy Hillicon Valley: Russia 'amplifying' concerns around mail-in voting to undermine election | Facebook and Twitter take steps to limit Trump remarks on voting | Facebook to block political ads ahead of election Top Democrats press Trump to sanction Russian individuals over 2020 election interference efforts MORE (D-Vt.), have moved to rein in the agency's power. The lawmakers have expressed particular outrage about the NSA's bulk collection of domestic phone data.

In a speech Tuesday laying out his plans for restricting the NSA, Leahy said Congress should end the phone data program.

"The government has not made its case that this is an effective counterterrorism tool, especially in light of the intrusion on Americans’ privacy rights," Leahy said.

The House came within seven votes of defunding the program in July.

Alexander emphasized that, under the program, the NSA only collects data such as phone numbers, call times and call durations, and does not listen in on any phone calls.

He said the program is crucial for "connecting the dots" and foiling terrorist attacks.

"I can tell you, although I can't go into detail, it provides the speed and agility in crises like the Boston Marathon tragedy in April and the threats this summer," Alexander said.

He also downplayed recently revealed "compliance incidents" in which NSA analysts violated legal rules.

He said that under the NSA's overseas executive order authority, the agency has identified only 12 incidents in which analysts purposefully violated rules. He said all 12 analysts were punished, and most opted to retire.

Alexander said most of the violations under other authorities were unintentional and often did not harm anyone's privacy. He said many of the violations involved an analyst accidentally typing a wrong number.

He said all violations are reported to the Foreign Intelligence Surveillance Court, Congress, the Justice Department and other agencies, and that all illegally collected data is deleted.

"Some of these, as you've read and you've seen from the court's opinions, would make you say, 'Wow, I'd really like not to have this one get out.' But we will do the right thing in every case," Alexander said.

He said that Snowden betrayed the agency's trust and bristled at suggestions that he is a hero.

The NSA analysts who work long hours tracking terrorists and the ones who risk and even lose their lives overseas are the real heroes, the NSA chief said.

Alexander, along with other top intelligence officials, will testify in a classified hearing Wednesday before Leahy's Judiciary Committee. He will also testify in a public Senate Intelligence Committee hearing Thursday.