San Francisco: In a previous incarnation, Marc Zwillinger — the man behind Apple’s legal strategy for taking on the US government — used to order up wiretaps for the Department of Justice.

Yet during the past decade, the 46 year old has become one of Silicon Valley’s go-to lawyer for fighting off surveillance orders from America’s three-letter agencies. A bit of a tech wonk, who memorizes footnotes and page numbers in government briefs, Zwillinger has helped Yahoo battle America’s intelligence community in a secret court, counseled Facebook’s Whatsapp on dealing with police, and is coordinating a national legal strategy for America’s most valuable company on why it shouldn’t help the government unlock a terrorist’s phone.

Zwillinger is founder and managing partner of the firm ZwillGen. His involvement, along with the other four lawyers Apple hired for the case, offers a clear indication that the company is not just angling to protect its anti-surveillance “marketing brand”, as the government suggests , but rather is girding for a prolonged legal battle that could affect digital rights for years to come.

On 16 February, a US magistrate in California ordered Apple to help the government weaken the security controls on an iPhone used by the San Bernardino gunman. Apple has appealed, arguing it would set a legal precedent that would make it liable to help weaken any phone and destroy customer trust. People close to the case and familiar with Judge Sheri Pym, the magistrate involved and former federal prosecutor, suspect Apple may lose the first round.

But the company is preparing for an appeal process that could go all the way to the supreme court.

The public face of Apple’s legal team for the case is Theodore Olson, partner at Gibson Dunn & Crutcher.

He arguably has spent as much time in front of the supreme court as any American lawyer. The Republican convinced the high court in 2000 that George W Bush did win that year’s presidential election after a controversially close result, and went on to serve in the Bush administration.

Perhaps most relevant for this case, Olson has unusual authority in weighing in on a terrorist attack such as San Bernardino. His wife was on board American Airlines flight 77 when terrorists hijacked it on September 11. “Remember, terrorists wish to change our lives. They wish to take away our civil liberties,” he said during a recent interview on ABC about the Apple case.

If Olson, who lacks experience in technology law, is Apple’s voice in its FBI battle, then Zwillinger may be the surveillance-law brain, people briefed on the company’s legal strategy said.

He has spent the past year laying the groundwork for Apple’s legal argument as the government requested access to a dozen phones in different cases across the country.

And this week has coordinated with privacy groups such as the American Civil Liberties Union who are writing briefs on the case. “One of the problems with the type of authority that the government is seeking is that it’s hard to draw the line where it stops,” Zwillinger told US magistrate judge James Orenstein in an October hearing involving a different locked phone in New York. “Would it stop at unlocking?”

Zwillinger grew up in Scarsdale, a suburb of New York, and told one author that he wanted to be a lawyer at age nine, when he played Snow White’s defense attorney in a school play based on the fairytale called “The Trial of Snow White.” He then went to Harvard Law.

A former prosecutor for the justice department’s computer crime and intellectual property division with a top secret security clearance, Zwillinger is part of a class of technology lawyers who were once prosecutors for the government but now often argue against wiretap orders for Silicon Valley.

Obviously, the pay is better out west. But many of the executives, who declined to speak on record, said that after leaving government it’s easier to see where its agents can overreach, even if they have good intentions. “When they leave, they all recognize the extraordinary power the government has,” said Albert Gidari, a recently retired privacy lawyer who worked with Google and referred Zwillinger to Apple.

— Guardian News & Media Ltd, 2016