Encrypted messaging apps such as WhatsApp “jeopardize public safety” and must be opened up to scrutiny by law enforcement agencies, Attorney General William Barr said Tuesday during a cyber-security conference at Fordham Law School.

“Converting the internet and communications platforms into a law-free zone, and thus giving criminals the means to operate free of lawful scrutiny will inevitably propel an expansion of criminal activity,” he said.

“If you remove any possibility that cops will be watching a neighborhood, the criminals already in the neighborhood are going to commit a lot more crimes.”

Apps such as WhatsApp and Telegram allow users to send messages that are coded so only the sender and user can read them.

That lets drug cartels, human traffickers and all manner of bad actors operate in the shadows and endanger the public, according to Barr.

Some tech companies have resisted calls by the law enforcement community to make encrypted data accessible to investigators, claiming that doing so would be burdensome or undermine consumer confidence.

“We regularly expect and often mandate that our companies take steps to ensure their product and services do not impose negative externalities on the public,” Barr said.

“‘My business plan is to sell sawed-off shotguns.’ That’s tough. We as a community have the right to say, ‘No, we don’t care if that’s your business plan. The barrel has to be this long.’”