Here we go again. The U.S. Justice Department and Apple are waging yet another battle over the contents of an alleged terrorist’s iPhone. And once again, Apple is taking the right position, while the government is prioritizing its short-term needs over the long-term security of consumers worldwide.

At issue are two older iPhones belonging to Mohammed Alshamrani, a second lieutenant in the Saudi Arabian Air Force who was taking a flight training course last year at a naval air base in Pensacola, Fla. On Dec. 6, authorities say, Alshamrani shot almost a dozen people at the base, killing three before being shot and killed by a sheriff’s deputy. The FBI has both of Alshamrani’s iPhones, but it says it cannot unlock them without his password. So any secrets they may have contained remain encrypted and unreadable.

On Monday, Attorney General William Barr took his complaints about iPhone impenetrability to the public. “It is very important for us to know with whom and about what the shooter was communicating before he died,” Barr said. “We call on Apple and other technology companies to help us find a solution so that we can better protect the lives of the American people and prevent future attacks.”

His comments echoed the ones made by then-FBI Director James B. Comey as the feds struggled to unlock an iPhone used by one of the terrorists who killed 14 people at a holiday party in San Bernardino, Calif., in 2015. The resolution to that fight is instructive, however: The FBI dropped its efforts to force Apple to develop software to unlock its phones after finding a private contractor that could do it. The FBI may be able to solve its Pensacola problem the same way; according to the Wall Street Journal, there are at least two companies that sell unlocking tools for older iPhones.

Seemingly every type of security breaks at some point, fueling a never-ending cycle of exploits, patches and updates. Those vulnerabilities may be good for law enforcement, but they’re terrible for the public. As we’ve seen in countless incidents where hackers have stolen credit card and Social Security numbers, held hospital and municipal computer systems for ransom, absconded with trade secrets and exposed intimate images and texts, the public is under relentless cyber assault.

We need more protection for our data, not less. And you don’t get better security by pressuring companies to ensure that their digital locks can be picked on demand.

“We have always maintained there is no such thing as a backdoor just for the good guys,” Apple said in response to Barr’s request. “Backdoors can also be exploited by those who threaten our national security and the data security of our customers.” In other words, any openings Apple creates for the FBI would inevitably be demanded or exploited by repressive and lawless governments eager to spy on their own citizens — China comes to mind — as well as by criminals, none of whom should have the U.S. government’s help to achieve their malign ends. That’s the long-term damage the Justice Department is threatening, and Apple should keep resisting it.

FROM AN EDITORIAL IN THE LOS ANGELES TIMES