The competing goals of protecting Americans’ emails and other private electronic messages and helping the U.S. intelligence community decode them to foil terror plots are on a “collision” course, the Obama administration acknowledges.

"We understand that encryption is a very important part of being secure on the Internet," FBI Director James Comey told the Senate earlier this week. "We also all care about public safety. We also all see a collision between those things right now.”

Comey’s remarks Wednesday before the chamber’s Judiciary Committee follow the deadly San Bernardino terror attacks, the Paris suicide bombings last month and several others recent strikes in which the attackers and planners apparently communicated through encrypted messages.

Comey said at least one of the two shooters at the anti-Prophet Muhammad event in Texas in May had exchanged 109 encrypted electronic messages with "an overseas terrorist.”

“This is a big problem,” he said.

To be sure, the federal government and Silicon Valley have struggled for years to find a middle ground, dating back at least to the controversial, post-9/11 Patriot Act, followed by NSA contractor Edward Snowden in 2013 revealing the federal government’s massive phone meta-data collection program.

Comey tried Wednesday to downplay the situation, saying, “We all agree we have to figure out whether we can maximize both of those values, safety and security on the Internet and public safety. That's good news. We're not at war. We care about the same things."

However, others in Washington portray a more tense relationship.

California Democratic Sen. Dianne Feinstein, co-chairman of the Senate Intelligence Committee, says she personally went to Silicon Valley to meet with the top lawyers in most of the companies but has yet to receive any help.

“I think that Silicon Valley has to take a look at their products,” she told MSNBC last month. “If you create a product that allows evil monsters to communicate in this way, … that is a big problem.”

Comney, Feinstein and others have asked for U.S. intelligence officials to have so-called “back door” access to encrypted messages, which now can be transmitted through apps and electronic gaming devices.

“They have apps to communicate on, which cannot be pierced even with a court order,” Feinstein said.

At least one telecommunications company says the data on its newest smartphones cannot be decoded. And the administration has backed away from pressing Silicon Valley on the issue, arguing in part that giving access to U.S. intelligence officials would also give access to rival nations, cyber-hackers and other bad guys.

Investigators are now looking into the possibility of encrypted and other communications between terror groups including the Islamic State and the Muslim husband-wife team in the San Bernardino, Calif., attacks.

The wife, Tashfeen Malik, 29, entered the United States in 2014 on a fiancée visa,
despite apparently having terror ties while in her home country of Pakistan.

Her 28-year-old husband, Syed Farook, is a U.S. citizen but also was apparently “radicalized” and was communicating with terrorists before the Dec. 2 attack in which he and Malik fatally shot 14 people and wounded nearly two dozen others at a holiday party.

“Even with a court order you can’t get to what they’re saying,” Feinstein also has said.