Judge Sheri Pym of US District Court in Los Angeles had asked on Tuesday that the Cupertino giant give "reasonable technical assistance" to FBI personnel trying to unlock Syed Rizwan Farook's iPhone 5C.
The handset is protected with Apple's standard encrypted four-digit "passcode", which makes it impossible for investigators to access data stored on it.
In a letter to customers published online, Cook wrote that he will oppose the demand. He said that the judge was asking Apple " to build a backdoor to the iPhone."
"Specifically, the FBI wants us to make a new version of the iPhone operating system, circumventing several important security features, and install it on an iPhone recovered during the investigation."
Cook explained that such software does not currently exist, and should be created ad hoc to help the investigation. He said that Apple "consider [this backdoor] too dangerous to create", as it would put its customers' "personal safety at risk."
Tim Cook absolutely sticks it to the FBI https://t.co/PXFbeUw2Pr— Jonathan Haynes (@JonathanHaynes) February 17, 2016
He said that, if invented, the backdoor would be a Pandora Box, that could be exploited by anyone who gets hold of it.
He also hinted at possible misuses on the part of the government itself — although the FBI claims that the system would be only employed to crack the San Bernardino case.
"The government is asking Apple to hack our own users," the letter reads.
"We can find no precedent for an American company being forced to expose its customers to a greater risk of attack."
"The government could extend this breach of privacy and demand that Apple build surveillance software to intercept your messages, access your health records or financial data, track your location, or even access your phone's microphone or camera without your knowledge."
Cook's letter is just the latest chapter in an ongoing encryption and privacy battle between the US government's security agencies and the tech world.
.@tim_cook can you create a petition for all us customers to sign that tells FBI we prefer daily data security over rare terrorist threats?— Drew Wilson (@drewwilson) February 17, 2016
The FBI has already spoken several times about the necessity to insert backdoors in encrypted messaging services, in order to uncover criminal or terrorist activities.
Every sentence in this letter is a quotable bit of fierce rage against the FBI. Apple (and Tim Cook more specifically) are not happy at all.— Benjamin Mayo (@bzamayo) February 17, 2016
Just one week ago, Senator Dianne Feinstein — the chair of the US Senate's Select Committee for Intelligence — said in a hearing that all Daesh, also known as Islamic State, needed to to carry out a terror attack in the US was an Internet connection and encrypted messaging applications.