SAN FRANCISCO (Reuters) - U.S. senators grilled Apple Inc and Facebook Inc executives over their encryption practices on Tuesday and threatened to regulate the technology unless the companies make encrypted user data accessible to law enforcement.

Slideshow ( 2 images )

At a U.S. Senate Judiciary Committee hearing, Democrats and Republicans presented a rare united front as they invoked child abuse and mass shooting cases in which encryption has blocked access to key evidence and stymied investigations.

“You’re going to find a way to do this or we’re going to go do it for you,” said Senator Lindsey Graham. “We’re not going to live in a world where a bunch of child abusers have a safe haven to practice their craft. Period. End of discussion.”

Facebook has been wrestling with multiple governments since announcing its plan to extend end-to-end encryption across its messaging services earlier this year. Its WhatsApp messaging app is already encrypted.

In October, U.S. Attorney General William Barr and law enforcement chiefs of the United Kingdom and Australia called on the world’s biggest social network not to proceed with its plan unless law enforcement officials are given backdoor access.

Facebook rejected that call in a letter signed by WhatsApp head Will Cathcart and Messenger head Stan Chudnovsky which it released along with the company’s written testimony.

“The ‘backdoor’ access you are demanding for law enforcement would be a gift to criminals, hackers and repressive regimes,” they wrote. “That is not something we are prepared to do.”

Apple weathered a legal fight over encryption in 2016, when the Federal Bureau of Investigation sought access to an iPhone owned by a slain sympathizer of Islamic State in San Bernardino, California, who had murdered county employees.

That stand helped bolster the company’s reputation for protecting user privacy, while Facebook has been mired in a series of scandals in recent years over its handling of personal data.

In their testimony, Facebook’s messaging privacy chief Jay Sullivan traded barbs with Apple privacy head Erik Neuenschwander, each suggesting lawmakers focus their scrutiny on the other company’s business.

Sullivan said repeatedly that Facebook does not build devices or operating systems, and suggested the company was open to “on-device scanning” proposals that would automatically identify matches for illegal content.

“We don’t have forums for strangers to contact each other ... and our business doesn’t have us scanning material of our users to build profiles of them,” said Neuenschwander.