A judge has refused a request by the UK's National Crime Agency (NCA) to require Lauri Love, a British citizen who is accused of hacking into US computers, to hand over his encryption keys as part of a civil claim.

The Courage Foundation, which supports whistelblowers around the world, called Tuesday's ruling a "Victory for all who use encryption in the UK."

The case concerns the computer scientist and activist Lauri Love, whom the US authorities wish to extradite in connection with alleged hacking of US government computers.

The NCA was seeking to create a dangerous precedent that effectively would have allowed the UK police to circumvent the safeguards found in the Regulation of Investigatory Powers Act 2000 (RIPA), the main legislation covering this area.

RIPA contains powers to force individuals to hand over their passwords or face prosecution, but also comes with extensive protections to ensure that the use of this power is reasonable. In October 2013, Love was arrested by the UK police for alleged offences under the UK’s Computer Misuse Act. His house was searched, and his computers and other digital equipment seized.

In February 2014, the UK government tried to use RIPA to force Love to turn over his encryption keys for these devices, but he refused, even though he faced up to two years' imprisonment for doing so. The NCA did not take this RIPA request any further, and Love was not prosecuted for failing to comply.

According to the Courage Foundation-run Free Lauri site, in May 2015 "the NCA returned 25 of the 31 items of Lauri’s property it seized nearly two years earlier; it still holds a desktop computer, two laptops, two external hard drives and a SD card. In November 2015, Lauri launched legal action against the NCA to get the rest of his property back."

However, the NCA allegedly took advantage of Love's civil action to ask the court to issue a direction for Love to hand over his encryption keys, under the threat of contempt of court. In Tuesday's ruling at Westminster Magistrates' Court, a judge rejected that request.

Love had earlier told The Intercept that he wouldn't hand over the keys whatever the judge ruled: “The NCA are trying to establish a precedent so that an executive body—i.e., the police—can take away your computers and if they are unable to comprehend certain portions of data held on them, then you lose the right to retain them. It’s a presumption of guilt for random data.”

Lawyer and commentator David Allen Green said in a blog post before the judge's ruling: "If the National Crime Agency want the encryption key then they should follow the RIPA statutory scheme and not try to get round it. Instead, the National Crime Agency are asking the courts to construct a civil law 'backdoor' for obtaining encryption keys (and encrypted data) outside the statutory scheme of RIPA." district judge N Tempia agreed (PDF).

Ars sought comment from the NCA on this story. A spokesperson told us that it wouldn't be commenting on the case while proceedings were ongoing.