Prognosticating in China is always a risky endeavor, but there are signs that the Communist Party is seeking to sharpen the tools it uses to quash dissent. A proposed revision to the criminal code would allow the police to secretly detain for six months those accused of “endangering national security,” a catchall designation often wielded against political offenders.

Jerome A. Cohen, a professor at New York University School of Law and an expert on Chinese law, called the revision “sinister” and said it would unduly strengthen the hand of the police. “It legalizes repressive and abusive state tactics,” Professor Cohen said.

The case of Ms. Ni and Mr. Dong highlights the ways officials can leverage the legal system against those they deem to be nuisances. Ms. Ni, 51, who received a law degree from China University of Political Science and Law, drew the attention of the authorities in 2002, when she used her expertise to help neighbors in Xicheng fighting eviction, part of the government’s sweeping effort to remake the capital ahead of the Olympics.

Detained after she tried to photograph demolition crews, she said she was kicked and pummeled over the course of 15 hours, leaving her incontinent and unable to walk. She was released after 75 days but continued her legal work while also seeking redress for the beating. Over the next few years, she was arrested twice more and convicted of “obstructing public business.”

During her three years in prison, she said, she endured frequent indignities: An officer once urinated on her face, she said, and prison officials often took away her crutches, forcing her to crawl from her cell to the prison workshop. One of her tasks included cleaning toilets.

Her daughter, too, said she was subjected to government surveillance. “The police followed me to school and watched me all day so I would experience the fear,” said the daughter, Dong Xuan, now 27.

Ms. Ni gained her freedom in April 2010, but found herself homeless after the police made it difficult for her to rent an apartment or a hotel room, she said. Supporters donated a tent, which she and her husband pitched in a park in central Beijing. But when petitioners and reporters began showing up in large numbers, the authorities moved the couple into a dingy hotel room.