Microsoft and Apple are battling the US government over the right to keep their users' data safe, and according to a report by The New York Times, the American tech companies are winning.

At least they’re winning in the public relations game, as the general notion today is that those companies are doing everything they can to protect their users’ privacy.

The US government, on the other hand, argues that having strong encryption, the one we see in Apple’s and Google’s products (the iOS and Android) increase the risk to national security, as they cannot monitor potential threats.

The Microsoft vs USA case is particularly interesting. The US government took Microsoft to court, asking the company to hand over data about a suspected criminal – data it stores on its servers in Dublin, Ireland.

If Microsoft loses this battle, it could mean that other foreign countries, such as China or Russia, could get their hands on data about US citizens, stored in servers in the States.

“Clearly, if the U.S. government wins, the door is open for other governments to reach into data centers in the U.S.,” Brad Smith, Microsoft’s general counsel, said in a recent interview. Companies and civil liberties groups have been sending in briefs of their own, largely opposing the government’s surveillance powers.

Chinese firms already have plans to build facilities on American soil that would store electronic communications, so the question may be more than hypothetical, New York Times writes. Microsoft argues that Congress will ultimately have to weigh in on the issue, since it is as much a political matter as a legal one.

Microsoft and the US government are set to argue it out this week when both parties appear in a federal appeals court on Wednesday.