Abraham David Sofaer, a former New York federal judge, recently was presenting a paper at the National Academy of Sciences about deterring cyberattacks when he learned the feds had shut down Megaupload, seizing its domain names, in a criminal copyright infringement case.

Troubling him more than his paper on global cybersecurity (.pdf) was learning that the government had seized the files of 66.6 million customers as part of its prosecution of the file-sharing site’s top officers, and was refusing to give any of the data back to its owners.

“It’s really quite outrageous, frankly,” the 74-year-old President Jimmy Carter appointee said in a recent telephone interview. “I was thinking the government hadn’t learned to be discreet in its conduct in the digital world. This is a perfect example on how they are failing to apply traditional standards in the new context.”

A former State Department legal adviser, Sofaer has teamed up — free of charge — with the Electronic Frontier Foundation in urging a federal court to set up a system to allow Megaupload users to get back their legal content.

His entry into the high-profile case comes as users increasingly turn to online storage systems and services, including Dropbox, Gmail, YouTube, ReadItLater, iCloud, and Google Drive, among others, to share and store their data — despite the fact that legal protections for cloud services are weak and servers can be shut down at any time by an aggressive prosecutor. In an unrelated copyright infringement seizure, the feds confiscated the domain of a hip-hop music blog at the behest of the recording industry, only to return it, without apology or recompense, a year later for lack of evidence.

The criminal prosecution of Megaupload targets seven individuals connected to the Hong Kong-based file-sharing site, including founder Kim Dotcom. They were indicted in January on a variety of charges, including criminal copyright infringement and conspiracy to commit money laundering.

The government said the site, which generated hundreds of millions in user fees and advertising, facilitated copyright infringement of music, television programs, electronic books, business and entertainment software, and, perhaps most damningly, movies, often before their theatrical release.

The site was so popular it leased more than 1,100 servers hosted by Carpathia in Virginia. The government copied 25 petabytes of the data, and said the rest can be erased. The Department of Justice told the federal judge overseeing the prosecution that the government has no obligation to assist anybody getting back their data, even if it’s non-infringing material.

“That’s a dangerous road,” Sofaer said.

He suggested that the government hasn’t quite caught up to the digital age. He doubts the government would take the same position with a bank it seized.

“Of course they would help customers get back their deposits,” he said. “But think about this new world. You can see very clearly that the government is acting in a manner that is indiscriminate.”

Justice Department prosecutors handling the case in the Eastern District of Virginia declined comment.

But in a recent court filing, the authorities wrote that assisting an Ohio man in getting back his company’s high school sports footage “would create a new and practically unlimited cause of action on behalf of any third party who can claim that the government’s execution of a search warrant adversely impacted a commercial relationship between the target of the search and the third party.”

Sofaer, also a former clerk to then-Supreme Court Justice William Brennan Jr. and now a Hoover Institution fellow, claims the government’s response is hogwash. All legal files could easily be retrieved, just like they were before the service was shuttered in January.

The Palo Alto, California, scholar has agreed to donate his legal services toward that goal, and wants the judge to appoint an expert to supervise the program, which would provide legal notice to former Megaupload customers that “you are entitled to have your data but not contraband material.”

“I think the government could easily live with that,” he said.

Julie Samuels is the Electronic Frontier Foundation attorney working with Sofaer, and said litigating with him “has been an absolute pleasure.”

“It’s clear that he really gets why this case matters and has the experience and perspective necessary to take the long view: If the court allows the government’s actions to go unchecked here,” she said, “we’ll be facing a world with inhibited property rights that is less friendly for innovation.”

Sofaer, who was also a former New York federal prosecutor, understands the government’s motives.

“They are eager to make cases, and to be as little bothered by the consequences as possible,” he said. “When I was a prosecutor, I probably would have been the same way.”