Haisam Elsharkawi was about to travel from Los Angeles to Saudi Arabia last week when, he says, he was stopped at the airport, questioned, handcuffed, questioned some more and then released without charges three hours after his flight had departed.
Mr. Elsharkawi, 34, an American citizen, said in an interview on Monday that officers from United States Customs and Border Protection repeatedly pressured him to unlock his cellphone so that they could scroll through his contacts, photos, apps and social media accounts.
He said they threatened to seize the phone if he did not comply.
More on NY Times:
Intel drops its sponsorship of science fairs, prompting an identity crisis
Toshiba's chairman resigns as its nuclear power losses mount
Apple tiptoes into producing original video but plans to pick up pace
"I travel all the time, and I was never asked to unlock my phone," said Mr. Elsharkawi, an electronics salesman from Anaheim, Calif. "I have personal photos there, which I think is normal for anyone. It's my right. It's my phone."
Eventually, he relented, and a Homeland Security agent looked through his phone for about 15 minutes, he said.
A NASA scientist, Sidd Bikkannavar, said he had a similar experience to Mr. Elsharkawi's in January, when he was detained at the Houston airport until he handed over a NASA-issued phone for inspection, he told The Verge.
So before you travel, here's some information on what border agents can and cannot do, along with recommendations from lawyers.
Border agents have broad authority to search
American border agents have the legal authority to conduct searches at the United States border that a police officer on the street wouldn't. Laws created that allow agents to search bags without a judge's approval, for purposes of immigration or security compliance, have been extended to digital devices.
But activists say inspecting a digital device is far more intrusive than inspecting a suitcase. They noted that the device can contain not just personal photos and messages, but could also compromise anyone else the owner may have communicated with.
"Before government agents should be able to go rifling through that trove of private data, they should have a very good reason based on individualized suspicion of illegal activity," said Nathan Freed Wessler, a staff attorney for the American Civil Liberties Union. "People's most private details of their lives will be made bare without justification."
The policies that give border agents the latitude to search or seize devices were used under the Obama administration, to much criticism. There's no available data to suggest that they are happening more under the administration of President Trump, though activists say they have anecdotally heard of more reports.
A customs agency spokesman said the agency could not comment on individual cases. But he said agents had inspected 4,444 cellphones and 320 other electronic devices in 2015, amounting to 0.0012 percent of the 383 million arrivals. Figures on 2016 and 2017 were not yet available.
Can agents force you to unlock your phone or laptop?
No. But they can ask you to comply voluntarily and make the experience rather uncomfortable if you resist. Travelers must decide how much trouble they're willing to put up with.
You may end up losing your device, since agents could seize the device for weeks before it is returned. They could also copy the data. (That data must be destroyed "as expeditiously as possible" if it is not valuable, according to Homeland Security policy.)
Travelers have reported that they've been detained for hours and questioned aggressively. Mr. Elsharkawi, whose trip included a pilgrimage to Mecca after an 18-hour layover in Istanbul, said his payment for his Turkish Airlines flight was not refunded after he missed it.
Travelers who are not citizens could have further problems, especially if they're flying into the United States. While citizens are guaranteed re-entry, foreign nationals could be denied entry, and the law isn't clear on permanent residents, said Sophia Cope, a staff lawyer for the Electronic Frontier Foundation, a nonprofit organization that defends civil liberties in the digital age.
In October, for example, a Canadian journalist on his way to cover the Dakota Access oil pipeline protests was denied entry into the United States after he declined to unlock his phone, citing the need to protect his sources.
"People have to figure out what is their tolerance for risk, and what do they want to accomplish," Ms. Cope said.
Can agents force you to turn over social media passwords?
No. But those who unlock their phones are most likely giving agents full access to their social media accounts, even if they don't tell them the passwords.
Since most people remain logged into their accounts on their phones, unlocking the phone would allow officers to sift through private Facebook posts, direct messages on Twitter and Instagram photos that are set to be accessible to friends only.
Mr. Elsharkawi did not give agents his social media passwords. But when he allowed an officer to look through his phone, he said, she commented on his emails and apps. He doesn't know if she looked through his social media accounts, he added.
Some activists fear gaining access to social media accounts will become a greater focus for border agents. Last week, John F. Kelly, the Homeland Security secretary, said officials were considering a policy that would allow agents to ask refugees and immigrants for their social media login information. The Obama administration considered a similar move but never put it into effect.
While that policy would not apply to citizens, Ms. Cope said, it would be "a very small step for them to start doing that to Americans, as well."
What can you do to prepare?
Travel with the least amount of data you need.
Hassan Shibly, the chief executive director of Council on American-Islamic Relations-Florida, suggested that people buy "burner phones" that they can discard before entering the airport.
Ms. Cope said people should power down their devices before getting to the airport, and encrypt the data they travel with. (Wired has a guide to the technical aspects of keeping your data safe.)
What should you do if it happens to you?
It's an individual decision. As a matter of principle, said Robert McCaw, the director of government affairs at CAIR, people should not unlock their devices. And they should request a lawyer.
"There's absolutely no reason why the federal government should be asking you for your password to your computer or your social media without a warrant. Period," Mr. McCaw said. "There's no justification."
But some activists said it's understandable why some people comply to such a demand, depending on what they have to lose by resisting.
Mr. Elsharkawi, who lives in Anaheim with his wife and three children, said requesting legal assistance appeared to inflame his situation.
"I opened the doors of hell when I asked for a lawyer," he said. "They just started attacking me verbally. 'Why do you need a lawyer? Are you a criminal? What are you hiding?' "
After allowing the Homeland Security officer to examine his phone, he said, he was immediately released.