Silicon Valley worked for years to persuade the public to live their lives online, to trust websites with credit card numbers, clouds with business documents and phones with intimate emails and photos.

Now, thanks in part to Washington, D.C., those confidences are at risk of unraveling — and the tech industry, relatively new to the ways of the Beltway, now finds itself in an uncomfortable spotlight at the center of national politics.

The NSA confirmed late Thursday that it has a program called PRISM in which counterterrorism investigators had secret access to communications from servers of nine key companies.

Each of the entities named — Google, Apple, Facebook, Microsoft, Paltalk, Skype, YouTube, AOL and Yahoo — has denied any knowledge of PRISM. All issued statements, many of which insisted they never provided the government “direct access” to their servers. Beyond that cryptic semantic construction, though, there’s not much more they can say now.

“We are sticking to our statement,” a Google spokeswoman said when asked about the backlash.

President Barack Obama, during his stop Friday in San Jose, Calif., said the classified Internet probing did not involve Americans or people on American soil — and that such endeavors are warranted to strike a balance between safety and civil liberties.

“I think it’s important to understand that you can’t have 100 percent security and then have 100 percent privacy and zero inconvenience,” he said. “We’re going to have to make some choices as a society.”

Regardless, the NSA news could send a shiver down the spines of consumers and raise several vexing questions. If these companies didn’t know the government had this kind of access, how can they assure people their data is safe? If they did know, are they lying about their complicity? Either way, how will anyone be able to trust companies that have for years been insisting your secrets are safe with them?

“It’s a classic D.C. sh — storm of the worst kind — nobody can defend themselves because it’s all about national security,” said a Microsoft executive speaking on condition of anonymity. “When it’s over, the best we can hope is that people believe that it’s in our interest to protect their data and we do everything we can. Will that be enough? Our word?”

That’s the incurable headache Big Tech — and anyone who relies on the Internet for business — woke up to on Friday. With the major companies silent, the megaphone belongs to privacy advocates who have long warned about precisely this situation. And those groups are pouncing on Silicon Valley’s long-standing opposition to support legislation limiting what they can do with user data.

“They could have done a lot more a lot sooner, and their reluctance to support the European efforts will have a negative legacy,” said Marc Rotenberg, executive director of the Electronic Privacy Information Center. “The U.S. doesn’t have an approach to privacy protection. We have an approach to Internet surveillance.”

Some believe the tech world has played the Washington game a little too well. Loath to cross a sector that is growing and creating jobs at a time of economic struggle, Congress has feasted on Big Tech’s lobbying dollars and largely avoided legislating in ways that might limit their ability to profit.

Now, the public may view the two as in concert — an image that won’t wear well in the current controversy.

“The government and companies are sometimes inextricably linked,” said Gigi Sohn, president of Public Knowledge, an advocacy group that promotes open Internet. “So it’s going to take a very brave company to say to the government, ‘I know you want to stop terrorists but sorry, we’re not going to turn over the data we have.’”

That has happened, as when Twitter — one of several prominent Silicon Valley companies uninvolved in the government operation — dramatically fought a government subpoena. But now it feels like all of that was window dressing, a routine public relations effort to reassure users that their information is safe, Rotenberg said. And more and more of it resides in clouds, he noted, far from the control of users.

Companies haven’t talked financial impact, but those connected to the industry shrug. The chance, they say, that people will abandon Google Maps or stop text messaging remains minimal. “While the impact will be out there, it will be more mind-set than a drop-off in usage by people,” a tech source said.

Few think this will lead to a serious schism between the industry and Washington — although there could be some changes in posture regarding online privacy protections.

“Because Silicon Valley and tech companies have by now established such extensive ties to Washington on so many fronts, you’ll see a walling-off of this issue” of the NSA program, said Rogan Kersh, provost and political science professor at Wake Forest University. “The other elaborate set of business relationships — lobbying, political and policy relations — those continue unabated.”