We usually think of tech companies as invading our privacy – and with good reason – but in the current political climate where the FBI is aiming to vilify the encryption that is increasingly used to protect everyone’s private information, those same tech giants may be our best ally in protecting our privacy against the US government.

A frontpage New York Times story on Monday details the escalating legal and political fight between tech companies like Apple to protect user data from spying governments and criminals versus the FBI’s insatiable appetite to make sure there aren’t any communications beyond its reach.

The Times described how the Justice Department (DOJ) has recently served warrants on Apple for iMessages allegedly involving “guns and drugs,” but that because Apple designed iMessage and FaceTime to be end-to-end encrypted – only the two people messaging each other can decrypt the conversations, and not even Apple has access to them – the company told the government it could not hand over the messages.

The Times went on to describe how many people inside the FBI and DOJ have pushed for the government to take Apple to court and force the company to weaken its security for all users to be able to hand over messages, because criminals sometimes use the services too (despite the law clearly stating that Apple does not have to redesign its system to facilitate surveillance just because the government asks). And apparently both agencies are peeved that the White House hasn’t pushed stronger for a law that would force Apple and other companies to do just that.

For those who care about privacy, this continued fight is really disturbing for a variety of reasons. But here’s the thing: the government is fighting a losing battle. They can continue their push, which can still hurt Americans’ cybersecurity, our privacy and even the US economy. But either way, encryption is here to stay, and there’s nothing they can do about it.

Besides Apple, WhatsApp – one of the world’s most popular messaging apps – has already started encrypting many of its conversations and is making progress towards encrypting all of them. On top of that, the companies “say they are seeing greater demand than ever for built-in encryption,” according to the Times, and there are countless open-source applications that do the same thing that have existed for two decades, and they are getting easier and easier for the general public to use. (Terrorists, whom the government have been using as its bogeyman to terrify people into believing encryption is a bad thing, have actually been using encryption for decades, well before tech companies ever started implementing it, and outlawing it isn’t going to stop them.)

Besides, why would the government be trying to weaken our cybersecurity at the exact moment they say that cybersecurity is a major problem? The world’s most respected cryptographers are already on the record saying that giving the government backdoor access in end-to-end encrypted systems would be technically impossible unless you also want to provide hackers even more ways to steal information. Stanford’s Jonathan Mayer wrote a detailed post about why it would be logistically impossible as well, even if it was possible to do safely, given so many platforms rely on each other.

And officials continue to ignore the Russia and China problem. That is, as soon as we require Apple and other companies to design their systems so they can always access everyone’s text messages, those companies will have no recourse once authoritarian governments ask for the same. If the US government wants US-based companies to stop doing business in large parts of the world, or move their operations to other countries that better respect users’ privacy and security, attempting to force them to disable encryption is a great way to do it.

Unfortunately, no matter what happens in the US, Prime Minister David Cameron seems intent on weakening encryption in England and has had none of the reservations that the Obama White House has about speaking out about a subject he clearly has no idea about. Former Guardian reporter James Ball wrote months ago how such a plan would devastate the tech industry in England, and indeed, some companies have seen the writing on the wall and have started moving out of the country.

As law professor Ryan Calo argued over at Fusion, whether you like them or not, tech companies may be our best hope in this fight to save end-to-end encryption against governments worldwide. While open-source end-to-end encryption tools like Signal are the most secure option out there for communicating, tech company applications are used by billions of people. (For example, Google and Facebook own eight out of the top 10 most-used phone apps in the United States.)

That’s not to say these companies are doing enough. Many of them, like Google and Facebook, can go much farther than they already are, and we should all continue to call them out for their own data collection and privacy violations. But given how much these companies are entangled in our lives, our privacy and their willingness to fight back are often intertwined.