During the past two years, U.S. Customs and Border Patrol has targeted ever larger numbers of travelers’ smartphones and laptops for searches as they cross the border into the country.

U.S. courts have generally upheld a so-called  to the Constitution’s Fourth Amendment, allowing CBP to search electronic devices without a court-ordered warrant. In April, a group of lawmakers to require warrants to search devices owned by U.S. citizens and other legal residents, but for now, the law allows for warrantless device searches.

It’s worth noting, however, that the odds of CBP searching any single traveler’s device are tiny, although they may increase if the traveler fits certain profiles. Even with increased device searches during the past two years, CBP still only checks the devices of a of all people crossing the U.S. border.

Still, travelers concerned about their privacy can take steps to protect their data as they cross the U.S. border. They should remember the old Boy Scout motto: Be prepared.

 for travelers.

CBP can detain you for refusing to allow a search but “we’re talking a matter of hours, certainly not an overnight detention,” Bhandari said. “There doesn’t seem to be a bright-line rule, but we’re talking hours, not days.”

Ultimately, if you’re a legal U.S. resident, CBP shouldn’t prevent you from entering the country, even if you refuse to allow the device search, Bhandari said.

Still, expect to have your device seized if you refuse to unlock it. Travelers will often have to choose, she said. “Would they rather turn over their password and have a quick search vs. refusing and having their device seized?” she added.

Finally, there’s been some discussion among technologies about using a separate encryption scheme for sensitive files on laptops or smartphones. While there’s no real consensus, some privacy experts suggest that having a separate encrypted section of your hard drive may raise a red flag for CBP agents. It may be safer to store those files on another device or in the cloud.