According to government data, these types of searches are rare: about 36,000 people are referred to secondary screening by United States Customs and Border Protection daily, and roughly a dozen of those travelers are subject to a search of their electronic devices.

Courts have long held that Fourth Amendment protections against unreasonable searches do not apply at the border, based on the government’s interest in combating crime and terrorism. But Mr. Pascal’s lawsuit and similar cases question whether confiscating a laptop for days or weeks and analyzing its data at another site goes beyond the typical border searches. They also depart from the justification used in other digital searches, possession of child pornography.

“We’re getting more into whether this is targeting political speech,” Ms. Crump said.

In another case the A.C.L.U. is arguing, House v. Napolitano, border officials at Chicago O’Hare Airport confiscated a laptop, camera and USB drive belonging to David House, a computer programmer, and kept his devices for seven weeks.

The lawsuit charges that Mr. House was singled out because of his association with the Bradley Manning Support Network. Pfc. Bradley Manning is a former military intelligence analyst accused of leaking thousands of military and diplomatic documents to the antisecrecy group WikiLeaks.

In March, Judge Denise J. Casper of Federal District Court in Massachusetts denied the government’s motion to dismiss the suit, saying that although the government did not need reasonable suspicion to search someone’s laptop at the border, that power did not strip Mr. House of his First Amendment rights. Legal scholars say this ruling could set the stage for the courts to place some limits on how the government conducts digital searches.

“The District Court basically said you don’t need individualized suspicion to search an electronic device at the border,” said Patrick E. Corbett, a professor of criminal law and procedure at Thomas M. Cooley Law School in Lansing, Mich. “What they were troubled with was the fact that the government held these devices for 49 days.”

Customs and Border Protection, part of the Department of Homeland Security, declined to discuss the policy in an interview, but a spokeswoman for the agency said in an e-mail: “Keeping Americans safe and enforcing our nation’s laws in an increasingly digital world depends on our ability to lawfully screen all materials — electronic or otherwise — entering the United States. We are committed to ensuring the rights and privacies of all people while making certain that D.H.S. can take the lawful actions necessary to secure our borders.”

Advertisement Continue reading the main story

The statement also referred to the agency’s policy on border searches of electronic devices, which says that officers can keep these devices for a “reasonable period of time,” including at an off-site location, and seek help from other government agencies to decrypt, translate or interpret the information they contain. If travelers choose not to share a password for a device, the government may hold it to find a way to gain access to the data.

Newsletter Sign Up Continue reading the main story Please verify you're not a robot by clicking the box. Invalid email address. Please re-enter. You must select a newsletter to subscribe to. Sign Up You will receive emails containing news content , updates and promotions from The New York Times. You may opt-out at any time. You agree to receive occasional updates and special offers for The New York Times's products and services. Thank you for subscribing. An error has occurred. Please try again later. View all New York Times newsletters.

The agency did provide recent statistics on how many travelers this policy affects. From Oct. 1, 2011, through Aug. 31, 2012, 11.9 million travelers were referred to secondary screening after entering the United States. Of those searches, 4,898 included an electronic device. In the previous year, 12.1 million people underwent additional screening, with 4,782 searches of electronic devices.

While there is little public information about who is pulled aside for extra scrutiny, some people whose laptops have been searched say they feel they were selected based on their academic, journalistic or political pursuits.

Laura Poitras, a documentary filmmaker and the recipient of a 2012 MacArthur Fellowship, estimates that she has been detained more than 40 times upon returning to the United States. She has been questioned for hours about her meetings abroad, her credit cards and notes have been copied, and after one trip her laptop, camera and cellphone were seized for 41 days.

Ms. Poitras said these interrogations largely subsided after a Salon article describing her experiences was published in April, but she is editing her latest film in Europe to avoid crossing the border with her research and interviews. (The film, the third in a series about the war on terror, focuses on domestic surveillance.)

“I’m taking more and more extreme measures, to the point where I’m actually editing outside the country,” she said. “They use the border as a way to get around the law.”

Mr. Abidor said he had also changed his travel patterns: because he is regularly detained at the border, he keeps little data on his laptop and rents a car when driving back to the United States from Canada, so he is not stranded waiting for the next train. Still, he said he experienced “a near panic attack” every time he returned to the United States.

“I have not done anything illegal, nor have I tried to hide anything I’ve done,” he said. “I’ve told them where I’ve traveled. I’m studying something that’s legal. I learned a language millions of people speak. I don’t understand how a variety of legal acts can lead to suspicion.”

Even when suspicion of illegal activity exists, it can be based on old records that do not display the nuances of a case when an individual’s passport is scanned. One traveler suspects his laptop was searched at the border because of a juvenile conviction — dating a 15-year-old when he was 17 landed him on the sex offender registry.

Advertisement Continue reading the main story

“I’m guessing they probably saw my record on their computer system,” he said, speaking on the condition that his name not be used. “It’s very unpleasant to know that people can pull it up, take it out of context and turn it into something horrible.”

In other cases, travelers say they have no idea why they were singled out. A laptop belonging to Lisa M. Wayne, a criminal defense lawyer, was searched after she returned from a trip to Mexico.

Ms. Wayne said her main concern was the information about clients’ cases stored on her laptop: she is a past president of the National Association of Criminal Defense Lawyers, which is a co-plaintiff in the Abidor suit, along with the National Press Photographers Association. But at the time of the search, she was unaware of her rights and felt pressured to hand over her computer.

“It was very clear to me that the longer I objected or interrogated them, the longer I was going to be detained, and I had a connecting flight,” she said. “It’s an intimidating experience. It was not consensual other than, you comply with the rules.”