A former undercover CIA officer turned congressman says the FBI — by trying to force Apple to defeat its own security protocols — is barking up the wrong tree.

The FBI has demanded that Apple help it unlock a phone used by San Bernardino killer Syed Rizwan Farook, but Apple is refusing for the sake of its customers’ cybersecurity and privacy.

Rep. Will Hurd, R-Texas, said Tuesday that the FBI request might be too intrusive. He said there’s a way to “protect our civil liberties, defend our digital information, and chase bad guys all at the same time.”

His conclusion: “There’s a lot of problems I think we can solve with big data.”

Hurd was speaking Tuesday at a forum in Washington organized by the software company Cloudera.

He asked the audience — professionals who analyze, visualize, and combine huge data sets to gain insights — to pitch in to help the government use information for better intelligence.

He said he wants to connect “micro intelligence” officers, like “mall cops,” with local law enforcement all the way up to the intelligence community to solve national security problems. “There’s a lot of information,” he said. “We just have to access it.”

That view was echoed by another speaker — Andrew Hallman, CIA director of digital innovation — who asked the audience how to “rewire neural pathways” between government agencies and security partners to become “anticipatory” about terrorism threats and other crime rather than “reactionary.”

But big data collection can have its own civil liberties problems. For instance, big data analytics — compiled from demographic information, court records, education, and more — can be used unfairly to flag people with certain characteristics or backgrounds as dangerous or threatening, subjecting them to additional surveillance.