Britain's National Crime Agency (NCA) has lost its legal fight to force an alleged cyber hacker to hand over the passwords to his encrypted computers, in a landmark case.
Lauri Love, 31, is fighting attempts to extradite him to America to face criminal charges for breaking into Federal Reserve computers.
The NCA have been accused of dealing a blow to privacy by attempting to force Love to hand over the password to his encrypted computer files through legal means.
He is accused of stealing "massive quantities" of sensitive data resulting in millions of dollars of losses. Love's lawyers say he faces up to 99 years in prison in the US if he is found guilty.
NCA officers launched an investigation and raided his family home in Stradishall, Suffolk, in October 2013 when they seized encrypted computers and hard drives.
Although no charges were brought in Britain against Love, the NCA wants him to hand over his passwords so officers can check the data before the electronics are returned.
Love's team says the application, if granted, would have been a significant blow to privacy and amount to a "power grab" by police services.
Delivering her judgment at London's Westminster Magistrates' Court, District Judge Nina Tempia sided against the NCA.
She agreed with Love's lawyers who argued the NCA should apply to a court under the Regulation of Investigatory Powers Act (Ripa) to force people to hand over their passwords to decrypt data.
"After reading the papers and hearing from the parties, I am not granting the application because in order to obtain the information sought the correct procedure to be used, as the NCA did two-and-a-half years ago, is under section 49 Ripa, with the inherent HRA safeguards incorporated therein," she said.
"The case management powers of the court are not to be used to circumvent specific legislation that has been passed in order to deal with the disclosure sought."
Love, the son of a reverend from Suffolk, is suing the NCA for the return of six bits of encrypted hardware being held, which he says contain his entire digital life.
The NCA is fighting the case and applied to the court to force Mr Love to hand over his passwords before it returns the computers.
The NCA argued that screenshots taken of the computers before the encryption kicked in show that Love had information from Nasa, the US military and the Department of Energy.
Speaking outside court following the ruling, Love said he was "happy" with the result, but accused the NCA of trying to "coerce" him into handing over passwords and trying to undermine the protections safeguarding individuals' property.