SAN FRANCISCO — Protesters are preparing to assemble in more than 30 cities to lash out at the FBI for obtaining a court order that requires Apple to make it easier to unlock an encrypted iPhone used by a gunman in December’s mass murders in California.

The protests organized by the Internet rights group Fight for the Future are scheduled to occur Tuesday outside Apple stores the U.S., the U.K., Hong Kong and Germany.

The U.S. protests will be in cities scattered across more than 20 states, including in New York, Chicago, San Francisco and Washington, where protesters plan to express their discontent outside the FBI’s headquarters.

The gatherings will come a week after the FBI went to court to force Apple to weaken the security built into most iPhones to help a terrorism investigation in San Bernardino, California. The FBI wants the Apple to remove a feature that erases the information stored on an iPhone after 10 unsuccessful attempts to enter a password, preventing unauthorized users from accessing the device.

The iPhone that the FBI is trying to examine was used by Syed Farook, who along with his wife killed 14 people in December.

Apple is fighting the court order issued in the case, arguing that the special software sought by the FBI could be used to break into millions of other iPhones. The FBI contends Apple is exaggerating the security risks of complying with the court order in a marketing ploy aimed at selling more iPhones.

Fight for the Future believes Apple’s concerns are warranted and is hoping the protests will persuade the Obama administration to take a stand against the way the FBI is trying to break into Farook’s iPhone, said Evan Greer, the group’s campaign director.

The White House so far has stood behind the FBI in its battle with Apple Inc.

Although the judge instructed Apple to create the software for the FBI, she said it could be loaded onto the phone at an Apple facility, and the Justice Department made explicit Friday that Apple could retain custody of the software at all times.

The specialized software would bypass a security time delay and self-destruct feature that erases all data after 10 consecutive, unsuccessful attempts to guess the unlocking passcode. This would allow the FBI to use technology to rapidly and repeatedly test numbers in what’s known as a brute force attack. In their filing Friday, prosecutors explained that investigators would be willing to work remotely to test passcodes, while Apple retained both possession of the phone and the technology itself.

That’s a good “compromise position” because “they’re giving all the power to Apple,” said Jason Healey, a former director on cyber policy at the White House.