What is the NSA's mission?The National Security Agency is the U.S. government's primary eavesdropping agency. It intercepts, decodes, and analyzes foreign communications — such as emails, telephone calls, and other "signals intelligence." The Fort Meade, Md.–based agency, which has an annual budget of about $10 billion and employs some 40,000 people, has long carried out this mission in the shadows. But a series of leaks by former agency contractor Edward Snowden has revealed the stunning scale of its global surveillance operation. It's now known that the NSA scoops up and stores billions of internet communications and cellphone records from the U.S. and around the world every day, which can then be studied by the agency's legion of code breakers, data miners, and counterterrorism specialists. When President Obama receives his daily intelligence briefing, "at least 75 percent" comes from the NSA's cyberspies, said Mike McConnell, director of national intelligence under President George W. Bush.

Why was the NSA created?It was set up by President Truman in 1952 to consolidate the military's jumble of code-breaking operations into a single, powerful agency capable of cracking the Soviet Union's communications. The NSA, whose existence remained classified for decades, quickly became the intelligence community's crown jewel. It ringed the USSR with 100-foot-tall, 1,000-foot-wide antennas that intercepted wireless signals as they bounced between the earth and the ionosphere. It stationed spy ships in the seas, and sent reconnaissance planes and satellites into the skies. Very quickly, the sheer volume of information harvested by the NSA dwarfed the "human intelligence" gathered by CIA agents in the field. "The CIA is good at stealing a memo off a prime minister's desk," said one former NSA director. "They're not much good at anything else."

Were the NSA's intercepts useful?At times, enormously so. The NSA was the first agency to spot Soviet missiles in Cuba in 1962. It provided advance warning of China's first nuclear bomb test in 1964, and its monitoring of Soviet Premier Leonid Brezhnev's limousine telephone gave American negotiators crucial inside information during arms limitation talks in 1972. But NSA intercepts also led to some colossal blunders. In August 1964, the agency reported that U.S. destroyers in the Gulf of Tonkin had been attacked by North Vietnamese boats twice in three days. But the second attack, used by President Johnson to justify an escalation of U.S. involvement in the Vietnam War, never occurred. The NSA had overheard North Vietnamese radio operators discussing the first battle, and misinterpreted it as a live combat report. "It was one of the greatest intelligence mistakes in history," said Matthew Aid, author of the NSA history The Secret Sentry.

Does the agency spy domestically?Yes, though these efforts are sometimes of dubious legality. From the '50s to the early '70s, the NSA operated a program called "Shamrock" that saw U.S. telegram companies hand over up to 150,000 messages a month — including many telegrams from ordinary Americans — which agency analysts studied for evidence of Soviet spying. Under Presidents Johnson and Nixon, the NSA worked with the FBI and CIA to monitor the communications of civil rights leaders and anti-war protesters, including Martin Luther King Jr. and Jane Fonda, as well as members of Congress. The exposure of those programs by Idaho Sen. Frank Church led Congress to enact the Foreign Intelligence Surveillance Act in 1978, which created a secret court to hear warrant requests from intelligence services.

How did 9/11 change the agency?The attacks forced the NSA to adapt to the digital age. After Sept. 11, 2001, embarrassed the nation's intelligence community, NSA officials launched a massive effort to capture, store, and analyze emails, texts, and online chats and videos used by terrorist networks. "They took on a new mission that required sifting vast amounts of data to find a few important signals," said Stewart Baker, a former senior Homeland Security official. The NSA ordered America's largest telecom firms and internet service providers to hand over raw data as it transited their networks. It tapped directly into the fiber-optic cables that constitute the internet's nervous system, and recruited scores of Silicon Valley experts — including Max Kelly, Facebook's former chief security officer — to help it navigate the new digital landscape.

How much data is collected?The agency says it "touches" 1.6 percent of all traffic being carried on the internet — about 29.2 petabytes of communication data a day. That's the equivalent of collecting all the text held in the Library of Congress 2,990 times every day. Intelligence officials argue that these intercepts have provided crucial insights into Iran's nuclear weapons program, aided the U.S. military's operations in Iraq and Libya, and helped disrupt dozens of potential terrorist attacks around the world. But some former employees claim the NSA's ability to collect data is now outpacing its ability to analyze it. "Despite all this collection, the NSA missed the Boston bombing, the underwear bomber, and the Times Square bomber," said James Bamford, a historian of the NSA. "The problem is the bigger you build the haystack, the harder it is to find the needle."

The NSA's hard driveThe NSA has mastered the art of collecting vast amounts of communications data. It now has somewhere to store it. Last year, the agency opened a $1.7 billion data center in the Utah desert, which houses 100,000 square feet of high-performance servers. The computers use 65 megawatts of electricity — about the same as a small city — and generate so much heat that they require 1.5 million gallons of cooling water a day. William Binney, a former NSA technical director turned whistleblower, estimates that the warehouse's servers can handle five zettabytes of data, which would fill 1.25 trillion DVDs. That means the agency has enough storage to hold "100 years' worth of worldwide communications, [phone records] and emails," said Binney, "and then have plenty of space left over to do any kind of parallel processing to try to break codes."