WASHINGTON (CBSNewYork/AP) — Apple Inc. CEO Tim Cook says his company will resist a federal magistrate’s order to hack its own users in connection with the investigation of the San Bernardino, California shootings.

The federal ruling on Tuesday orders Apple to disable the security feature in San Bernardino shooter Syed Farook’s phone that automatically erases all data if an incorrect passcode is entered 10 times.

“It’s been over two months now, we’re still working on it,” said FBI Director James Comey.

“The federal judge is looking at what is in the best interest of safety, and so they are looking at the circumstances and saying “Hey, look, Apple you need to help the FBI out,” former FBI agent Jeffrey Harp told CBS2’s Don Champion.

MORE: Read Apple CEO Tim Cook’s Full Letter Here

Police Commissioner Bill Bratton released a statement Wednesday morning commending U.S. Magistrate Judge Sheri Pym for the order.

“As the threats from ISIL become more divergent and complex, we cannot give those seeking to harm us additional tools to keep their activity secret,” Bratton said in a statement. “I reiterate my call on Congress to act immediately in passing legislation to provide law enforcement the tools we need to keep America safe.‎”

But Apple is ready to challenge the ruling all the way to the Supreme Court, CBS2’s Alice Gainer reported.

Paperwork could be filed as early as next Tuesday or possibly the following week, sources told CBS News. The appeal would also seek a stay pending the outcome, sourced said.

If Apple disables the feature, the FBI plans to use computers to break Farook’s passcode without running the risk of data loss. Agents hope the phone will help them figure out why Farook and his wife picked their target and if they had any help.

Encryption and user security are hot-button issues in the tech world.

The ruling only allows Apple to write special code to disable the security feature in Farook’s iPhone.

But in a statement posted early Wednesday on the company’s website, Cook argued that such a move would undermine encryption by creating a backdoor that could potentially be used on other future devices.

Cook said this “master key” could fall into the wrong hands or that the government could extend its reach of privacy and demand Apple track locations, or access a cell phone’s camera without the owner knowing, WCBS 880’s Alex Silverman reported.

“There have been people that suggest that we should have a back door. But the reality is if you put a back door in, that back door’s for everybody, for good guys and bad guys,” Cook had said during a recent “60 Minutes” interview.

Dan Ackerman, with CNET said once you do that, no phone is safe, CBS2’s Alice Gainer reported.

“Tech companies have realized that in order to avoid this conflict of interest, they need to tie their own hands so that they don’t have the ability to access data on customer phones,” he said.

Experts say tech-savvy terror groups take advantage of this.

“Islamic terrorists know that, why do you think they’re using it? Because it creates a channel of information to other members of which we can’t access, and they know we can’t,” said Paul Viollis, host of “The Security Brief.”

Bratton and Mayor Bill de Blasio lashed out against Apple’s refusal to cooperate.

“These companies, whether they mean to or not, are unfortunately making it easier for terrorists to do their devilish acts,” said de Blasio.

“Going forward we are increasingly blind, for terrorism purposes and for general law enforcement purposes, with the new devices and the continuing effort to make them even more secure against even court orders authorizing law enforcement to have access,” Bratton said.

Bratton said when the right to privacy is being used for criminal purposes, that’s when the courts come into play, WCBS 880’s Rich Lamb reported.

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.

Sen. Charles Schumer said the bigger picture needs to be addressed, 1010 WINS’ Juliet Papa reported.

“You can’t just litigate this on a case-by-case basis,” he said. “It takes too long, it hampers law enforcement. We need a solution.”

A solution, he said, that protects privacy rights but allows law enforcement the tools they need.

The mass shooting in San Bernardino last year left 14 people dead and 21 others injured.

Investigators are still working to piece together a missing 18 minutes in their timeline from the Dec. 2 shooting and they believe the phone could help establish where the couple went and who they contacted.

(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.)