Tashfeen Malik​​​, one of two suspected shooters in last week's San Bernardino killings, was educated in a women-only madrassa in Pakistan, as well as a Pakistani university. A spokesman for the latter said she was "an average student."

APPLE CEO Tim Cook has refused a federal magistrate’s order to hack its users in connection with the investigation of the San Bernardino, California shootings.

In a fierce statement shared on the company’s website on Tuesday, Cook asserted such a move would undermine encryption by creating a backdoor that could potentially be used on other future devices.

His response came after an order from US Magistrate Judge Sheri Pym that Apple Inc help the Obama administration break into an encrypted iPhone belonging to one of the shooters in the December attack.

The first-of-its-kind ruling was a significant victory for the Justice Department in a technology policy debate that pits digital privacy against national security interests.

But Cook said “this moment calls for public discussion, and we want our customers and people around the country to understand what is at stake”, arguing that the order “has implications far beyond the legal case at hand.”

Cook said that the order would undermine encryption by using specialised software to create an essential back door that he compared to 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.”

The court ruling related to the December 2 attacks by Syed Farook and his wife, Tashfeen Malik.

The couple shot dead 14 people at a holiday luncheon for Farook’s co-workers. They later died in a gunbattle with police.

Federal prosecutors told the judge in a court proceeding — that was conducted without Apple being allowed to participate — that investigators can’t access a work phone used by Farook because they don’t know his passcode and Apple has not co-operated.

Under US law, a work phone is generally the property of a person’s employer. The judge told Apple to provide an estimate of its cost to comply with her order, suggesting that the government will be expected to pay for the work.

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.

The ruling by Pym, a former federal prosecutor, requires Apple to supply highly specialised software the FBI can load onto the county-owned work iPhone to bypass a self-destruct feature, which 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.

It was not immediately clear what investigators believe they might find on Farook’s work phone or why the information would not be available from third-party service providers, such as Google or Facebook, though investigators think the device may hold clues about whom the couple communicated with and where they may have travelled.

The couple took pains to physically destroy two personally owned mobile phones, crushing them beyond the FBI’s ability to recover information from them.

They also removed a hard drive from their computer; it has not been found despite investigators diving for days for potential electronic evidence in a nearby lake.

Farook was not carrying his work iPhone during the attack. It was discovered after a subsequent search. It was not known whether Farook forgot about the iPhone or did not care whether investigators found it.

The phone was running the newest version of Apple’s iPhone operating system, which requires a passcode and cannot be accessed by Apple, unlike earlier operating systems or older phone models.

San Bernardino County provided Farook with an iPhone configured to erase data after 10 consecutive unsuccessful unlocking attempts. The FBI said that feature appeared to be active on Farook’s iPhone as of the last time he performed a backup.

Investigators are still working to piece together a missing 18 minutes in Farook and Malik’s timeline from December 2. Investigators have concluded they 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.

FBI Director James Comey told members of Congress last week that encryption is a major problem for law enforcement who “find a device that can’t be opened even when a judge says there’s probable cause to open it.”