CUPERTINO (CBS SF) — Google’s CEO is backing up Apple’s decision to fight a federal magistrate’s order to help the FBI hack into an encrypted iPhone belonging to one of the San Bernardino shooters.

Following Cook’s letter, a slew of tech and political leaders, both supporting and rejecting Cook’s comments, weighed in on social media, including Google CEO Sundar Pichai.

READ MORE: Napa Valley Grape Growers Say Dry Year Survivable But Fear Prolonged Drought

Cook said that allowing a backdoor to cellphones could potentially undermine encryption for millions of other users.

Cook’s response to the order, dated Tuesday and posted early Wednesday on the Apple’s website, set the stage for a legal fight between the federal government and Silicon Valley.

Cook’s comments come after U.S. Magistrate Judge Sheri Pym ordered Apple to help the FBI break into an iPhone belonging to Syed Farook, one of the shooters in the Dec. 2 attack that killed 14 people and injured even more. Farook and his wife, Tashfeen Malik, died in a gun battle with police.

Pichai took to Twitter Wednesday afternoon, saying:

Pichai goes on to say that, “We build secure products to keep your information safe and we give law enforcement access to data based on valid legal orders, but that’s wholly different than requiring companies to enable hacking of customer devices & data. Could be a troubling precedent.”

Others commenting on Apple’s decision, included Edward Snowden, who posted a tweet saying:

California Senator Dianne Feinstein, however, disagrees with Cook. She said Wednesday, “I believe that as a government we have every responsibility to see that Apple provides that information.”

She said, as the vice-chairman of the U.S. Senate Select Committee on Intelligence, she would put forward a law that would require Apple to cooperate.

A new anti-trafficking bill introduced in the California legislature in January could require that all smartphones sold in the state be capable of decryption and unlocking by the phone’s manufacturer or its operating system provider, essentially overriding the user’s passcode.

Pym’s ruling requires Apple to supply software the FBI can load onto Farook’s county-owned work iPhone to bypass a self-destruct feature that erases the phone’s data after too many unsuccessful attempts to unlock it. The FBI wants to be able to try different combinations in rapid sequence until it finds the right one, the Associated Press reports.

Investigators have concluded the shooters were at least partly inspired by the Islamic State group; Malik’s Facebook page included a note pledging allegiance to the group’s leader around the time of the attack.

Cook argued that the order “has implications far beyond the legal case at hand” and would make a “master key, capable of opening hundreds of millions of locks.”

“In the wrong hands, this software — which does not exist today — would have the potential to unlock any iPhone in someone’s physical possession,” Cook wrote. “The FBI may use different words to describe this tool, but make no mistake: Building a version of iOS that bypasses security in this way would undeniably create a back door. And while the government may argue that its use would be limited to this case, there is no way to guarantee such control.”

Apple has provided default encryption on its iPhones since 2014, allowing any device’s contents to be accessed only by the user who knows the phone’s passcode. Previously, the company could use an extraction tool that would physically plug into the phone and allow it to respond to search warrant requests from the government, according to the Associated Press.

The magistrate’s order requires that the software Apple provides be programmed to work only on Farook’s phone, and said Apple has five days to notify the court if it believes the ruling is unreasonably burdensome.

TM and © Copyright 2016 CBS Radio Inc. and its relevant subsidiaries. CBS RADIO and EYE Logo TM and Copyright 2016 CBS Broadcasting Inc. Used under license. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. The Associated Press contributed to this report.

MORE NEWS: Fatal Rollover Crash Closes Portion of Highway 101 in San Jose Friday Night

By Hannah Albarazi – Follow her on Twitter