At least public defenders know that GrayKey exists. For years, that wasn’t the case with so-called I.M.S.I. catchers (for international mobile subscriber identity), better known as StingRays. These devices, made by the Harris Corporation, impersonate cell towers to intercept texts, calls, emails and other data; they can also locate cellphones and thus the people using them. Harris has require d law enforcement agencies to sign nondisclosure agreements when they buy the devices, and for years, police and prosecutors hid their existence from defense attorneys. The secret wasn’t exposed until one tech-savvy California tax defrauder became obsessed with finding out how the police had found him.

Forensics experts have helped law enforcement acquire even the most daunting digital evidence. After a December 2015 mass shooting in San Bernardino, Calif., the F.B.I. asked Apple to help it get into a locked iPhone. Apple refused, on the grounds that it would undermine the security of their products. The F.B.I. ended up paying an unnamed third party to break into the device.

“It’s definitely an uneven playing field,” said Jennifer Mnookin, the dean of the law school at the University of California, Los Angeles. “Law enforcement has an understandable desire to extricate data from the digital world to solve cases, but there hasn’t been adequate scrutiny of these new techniques.”

Ms. Mnookin described a recurring pattern: Law enforcement agencies get a new investigative technique — fingerprinting, DNA analysis, breathalyzer tests — and those representing the accused struggle to play catch-up. Developing the new technical expertise necessary to adequately defend their clients is a challenge. Not only do public defenders tend to be underfunded, law enforcement can monopolize the experts in the field and forbid them from working for the defense.

Jim Kouril , a forensic analyst who worked as a police officer in Idaho for 24 years before joining the public defender’s office, said his former colleagues viewed his career move as going to work “for the dark side.” But his new position was hardly glamorous. “ The big discrepancy between law enforcement and public defense is resources,” Mr. Kouril said. “I had everything I wanted in law enforcement: high-powered computers and equipment. Now, it’s like pulling teeth.”

Few resources for the accused

In a review of public defender offices across the country, The New York Times found no other organization with a forensics operation comparable to the one in Manhattan. A handful of offices — in Pima County, Ariz.; Cook County, Ill.; and Canyon County, Idaho — recently bought one extraction device or have an internal expert. The public defender’s office in Philadelphia has started building a dedicated lab. But most public defenders have to hire private consultants to conduct forensic examinations of the evidence in their cases. This is a costly exercise that requires people to give up their phones for at least a week — an impossible request in some cases, particularly when it’s a third party involved in a case and not the defendant.