Sundar Pichai, Google’s CEO, backed Apple chief Tim Cook’s opposition to building a back door into the iPhone for the FBI, bypassing inbuilt security features.

“Forcing companies to enable hacking could compromise users’ privacy,” tweeted Pichai in support of a public letter written earlier this week by Cook.

A federal judge ordered Apple to alter its iOS software so law enforcement could gain access to an iPhone that it said was used in the San Bernardino mass shooting in December.

“We know that law enforcement and intelligence agencies face significant challenges in protecting the public against crime and terrorism,” continued Pichai.

“We build secure products to keep your information safe and we give law enforcement access to data based on valid legal orders,” he added.

“But that’s wholly different than requiring companies to enable hacking of customer devices & data. Could be a troubling precedent,” he continued.

His comments initiated an intense back and forth on Twitter. Some backed his and Cook’s positions, others were more sceptical. “When did corporations like Google and Apple go above the law?” was one comment. “Went around the time the government went above the constitution,” came a tart reply.

Tim Cook’s letter argued a similar point, stating the FBI was making unprecedented use of a piece of eighteenth century law to get its way.

The authorities have argued their back door into iOS is a one-off demand. But Cook demurred. “Once created, the technique could be used over and over again, on any number of devices. In the physical world, it would be the equivalent of a master key, capable of opening hundreds of millions of locks — from restaurants and banks to stores and homes. No reasonable person would find that acceptable.”

Some on Twitter were in favour of Cook and Pichai’s stance. “I stand behind Google and Apple in this important fight for the populous [sic]. Thank you,” was one comment, which drew a sharp response from an opponent. “I’m sure it’d be different if your family was killed and the answer was in a phone as to how and why.”

Pichai’s final tweet on the subject, “looking forward to a thoughtful and open discussion on this important issue”, was one sentiment everyone could get behind.