Apple CEO Tim Cook has written an open letter explaining why the company is opposing an order to help the FBI hack into an iPhone belonging to one of the San Bernardino shooters. 

On Tuesday, a U.S. Magistrate Judge ruled that Apple must provide specialized software to the FBI that would cripple an iPhone security encryption feature. The feature erases all of the data contained on the phone after too many unsuccessful passcode attempts.

The ruling came after federal prosecutors said they can't access an iPhone that was used by Syed Farook, because they don't know his passcode.

Last December, Farook and his wife, Tashfeen Malik, killed 14 people and injured 22 others, after opening fire on a room full of his co-workers in San Bernardino, Calif. The two were later killed in a gun battle with authorities.

In the letter, Cook said that by demanding that Apple help override the encryption feature, the U.S. government was taking an "unprecedented step which threatens the security of our customers.

"This moment calls for public discussion, and we want our customers and people around the country to understand what is at stake," the letter warned.

'A backdoor to the iPhone'

Cook said that Apple is outraged by the acts of the San Bernardino shooters, and has "worked hard" to support the government's efforts to solve the crime.

The company has provided the FBI with any requested data it has in its possession, Cook said.

"Apple complies with valid subpoenas and search warrants, as we have in the San Bernardino case. We have also made Apple engineers available to advise the FBI, and we've offered our best ideas on a number of investigative options at their disposal," the letter said.

However, the FBI's request to have Apple produce software to override the encryption feature is something the company considers "too dangerous to create."

"They have asked us to build a backdoor to the iPhone," Cook said in the letter.

The FBI essentially wants the company to create a new version of the iPhone operating system that would circumvent several security features, and install it on the iPhone that was recovered during the San Bernardino investigation, Cook said.

"In the wrong hands, this software – which does not exist today – would have the potential to unlock any iPhone in someone's physical possession," the letter said.

This would mean that if the software fell into the wrong hands, anyone could potentially use it to look at the data contained on any iPhone.

He likened such software to a "master key," that would be capable of opening hundreds of millions of building locks, from "restaurants and banks to stores and homes."

Cook also stressed that while the government may argue that the use of this software would be limited to this specific case, "there is no way to guarantee such control."

Genie in a bottle

Technology analyst Carmi Levy said the case highlights the balance technology companies have to strike between protecting consumers' privacy and helping law officials in criminal investigations.

"On the one hand you want law enforcement to have the tools to do what they need to do," he told "But on the other hand, you don't want the government to essentially have carte blanche to listen in on the affairs of ordinary, innocent citizens."

Levy said the technology community in particular is sensitive to this issue, as many large tech firms came under harsh criticism when details of the National Security Agency's mass surveillance program leaked to the press in 2013.

In the fallout from the NSA scandal, many large U.S. firms were accused of helping the surveillance program, Levy said.

He also dismisses the notion that the specialized software will only be used in this one instance, and that it won't somehow fall into the wrong hands.

"Once the genie is out of the bottle, there's no way to get it back in," he said. "It's rather inevitable that if Apple allows this to happen now, that sooner or later hackers, thieves and criminals will be using the same technique to read our iPhones and iPads."

And while this case is taking place in America, Canadians will be affected by the developments too, Levy said.

"This can and will have an impact on Canadians," he said, noting that millions of Canadians own and use iPhones and iPads.

Furthermore, Canadian technology law often tends to follow the American lead, especially in significant test cases like this one, Levy said.

“It’s worthwhile for Canadians to watch what’s happening south of the border, because eventually it’s likely going to apply here as well,” he said.

Edward Snowden, the ex-CIA employee who leaked the details of the NSA surveillance program to the press, tweeted his views on the court order on Wednesday.