FBI Director James Comey fired back on Wednesday at Silicon Valley companies that are calling for stronger encryption of their products.

"Some prominent folks wrote a letter to the president yesterday that I frankly found depressing," Comey said in a discussion at Georgetown University Law Center, referring to a letter signed by Apple, Google, Facebook, Microsoft, and other companies, as well as civil-liberties groups and Internet-security experts. "Their letter contains no acknowledgment that there are societal costs to universal encryption."

There can be benefits to securing devices from hackers, Comey acknowledged, but he argued there are also "tremendous costs" to society by preventing law enforcement from obtaining evidence for investigations.

In their letter on Tuesday, the tech companies urged Obama to reject any proposal to weaken cybersecurity. The administration should instead focus on promoting wider adoption of strong encryption, the companies argued. "Strong encryption is the cornerstone of the modern information economy's security," they wrote.

Both Apple and Google recently made end-to-end encryption the default setting on their mobile operating systems.

But Comey warned that widespread encryption would put terrorists, spies, and criminals beyond the reach of law enforcement—even with court orders.

"I read this letter, and I think these folks don't see what I see or they're not fair-minded," Comey said Wednesday. "Either one of those things is depressing."

Michael Rogers, the director of the National Security Agency, outlined a compromise solution last month in which the government would have one key to the product and the company would keep the other. That proposal would ensure appropriate government access to information without undermining security, Rogers argued.

But many security experts doubt that such a solution could work.

"Whether you call them 'front doors' or 'back doors,' introducing intentional vulnerabilities into secure products for the government's use will make those products less secure against other attackers," the companies and groups wrote in their letter this week.