By PAUL ELIAS, Associated Press

SAN FRANCISCO (AP) — The FBI's director said Friday the agency is collecting data to present next year in hopes of sparking a national conversation about law enforcement's increasing inability to access encrypted electronic devices.

Speaking Friday at the American Bar Association annual conference in San Francisco, James Comey said the agency was unable to access 650 of 5,000 electronic devices investigators attempted to search over the last 10 months. He said the problem is only going to get worse without a discussion about the technology.

Comey says encryption technology makes it impossible in a growing number of criminal cases to search electronic devices. But he said it's up to U.S. citizens, rather than the FBI or government officials, to decide whether to modify the technology to help law enforcement access the devices.

Comey's concern with encryption emerged earlier this year when the FBI engaged in a high-profile legal fight with Apple over accessing data from a locked iPhone used by one of the two shooters in the San Bernardino, California, terrorist attack. The legal fight remained unresolved because the FBI dropped its court challenge after it said it found a way to access the shooter's iPhone.

Silicon Valley companies say encryption safeguards customers' privacy rights and offers protections from hackers, corporate spies and other breaches.

"The San Bernardino litigation was necessary, but in my view, it was also counterproductive," Comey said during his 20-minute speech. "It was necessary because we had to get into that phone. It was counterproductive because it made it very hard to have a complex conversation."

Comey said he hopes a calmer conversation about encryption and its effects on public safety can be started in 2017 after the presidential elections pitting Republican Donald Trump and Democrat Hillary Clinton. Comey chided Clinton on July 5 for being "extremely careless" in using private email servers for government communications while serving as secretary of state, but he recommended no criminal charges.

On Friday, in response to a question about the decision, Comey said, "I don't want to talk about the case itself anymore, after four hours and 40 minutes without a bathroom break" testifying before Congress about the FBI's investigation of Clinton's email practices while secretary of state.

But he said that it was "unprecedented for the FBI to show the kind of transparency" it did in discussing its investigation of Clinton and recommendation to prosecutors to forgo criminal charges.