(Image: Wikimedia Commons)

NEW YORK -- Former NSA officials turned whistleblowers say a discontinued program could have prevented some of the worst terrorist attacks in peacetime history, but agency bureaucracy and inefficiency got in the way.

Weeks prior to the September 11 terrorist attacks, a test-bed program dubbed ThinThread was shut down in favor of a more expensive, privacy-invasive program that too would see its eventual demise some three years later -- not before wasting billions of Americans' tax dollars.

Four whistleblowers, including a congressional senior staffer, came out against the intelligence community they had served, after ThinThread. designed to modernize the agency's intelligence gathering effort, was cancelled.

Speaking at the premier of a new documentary film "A Good American" in New York, which chronicles the rise and demise of the program, the whistleblowers spoke in support of the program, led by former NSA technical director William Binney.

The documentary's main charge: The program had enough metadata that could've established a relationship among the September 11 hijackers, but greed and incompetence led to the agency spending billions on a different program, said Binney. The rival program, Trailblazer, which took ThinThread's place after the attacks, was favored by the agency's leadership as it garnered more funds from Congress.

Trailblazer was sunk four years later after it was widely regarded by the Bush administration as a failure.

"It was just too cheap," said Binney, about ThinThread, which he helped to pioneer and built in the years prior. "It was just a little bit ahead of its time for NSA to accept it."

That was because the agency had more data than it knew what to do with, said Binney, a sentiment he echoed previously, saying the NSA had a "collect it all and figure it out later" mentality.

ThinThread was a program developed by a small team of people in NSA headed by Binney -- including would-be whistleblowers Kirk Wiebe and Ed Loomis. The program took the world's metadata -- from phone calls to geolocation, who is talking to whom and when -- and digested it to dig up connections between suspects and those on watchlists. The program, which Binney said cost a fraction of what rival programs required to build and maintain, also included legal restrictions and privacy filters that would encrypt and scramble US-related communications to prevent illegal and warrantless domestic snooping.

Despite the numerous tests showing high marks of success, the small band of analysts were unable to convince NSA administration to fund the project -- largely because they say it didn't garner enough funds from Congress.

"It cost $3.2 million to build it from scratch," said Binney. "And it was fully automated, and it didn't require people to run it. It was electronically downloadable... it wouldn't take any money to deploy it."

In its place, three weeks before the September 11 attacks in 2001, the NSA commissioned Trailblazer, a more intrusive, multi-billion dollar program that was designed to spy on cellphones and email traffic.

"[Trailblazer] was the largest failure in NSA history," said Binney. "Fundamentally they traded your security -- mine, and everybody else's -- for money. It's that simple"

Binney, Wiebe, and Loomis all left the NSA in 2001 just weeks after the attacks.

Binney said -- and the other whistleblowers agreed -- that the program could have "absolutely prevented" the attacks on New York.

An NSA spokesperson did not return a call asking for comment.

The story on its own would fall apart if it were just one lone actor, angry at the missed opportunity, knowing that one was right over another. But the three whistleblowers and a House staffer, Diane Roark -- whose job it was to oversee the NSA's account -- who came forward had little to gain but everything to lose. They would all have their houses raided in the near future for what they believe was speaking out against the waste in the wake of Trailblazer's demise.

Thomas Drake, a former NSA executive, would later be charged with espionage by the Obama administration -- a case that was largely dropped -- for helping the Dept. of Defense's inspector general with its report into Trailblazer.

NATIONAL SECURITY As the Snowden leaks began, there was "fear and panic" in Congress Just a few minutes after the first NSA leak was published, the phones of US lawmakers began to buzz, hours before most of America would find out over their morning coffee. Read More

The inspector general's report, released in 2004, contained significant criticisms of the program; however, many unclassified parts of the report remain redacted and unreadable.

Patrick Eddington, a former CIA analyst who now works for the Washington DC-based think-tank Cato Institute, hinted that the government may face a legal challenge over the redactions.

Since then, the NSA has continued to ramp up its intelligence gathering mission to indiscriminately collect as much as it can, as Snowden documents have shown. Snowden later said it was in part Binney and Drake's cases which inspired him to come forward.

Binney, now in his early-70s, said Snowden would be just "one head" of the hydra after the most recent round of leaks, which began in mid-2013.

The Intercept, a news and analysis online publications founded by Laura Poitras and Glenn Greenwald, that now publishes the remains of the Snowden files, has also started publishing documents from a new whistleblower about the US drone program -- which was first hinted about at the end of Poitras' film, "Citizenfour," which documented the debut of the Snowden leaks.

The identity of the so-called "second Snowden" remains unknown to the general public. But Binney had three words of advice for them:

"Get a lawyer."