When an Indian-American NASA engineer was detained at a Texas airport after forcing him to unlock his phone, a lot of media reports cried foul at the practice. But in reality, all of this is legal and in order to protect yourself from further harassment and inconvenience, it would be useful to learn the procedures and background of this custom
CNN reports that Sidd Bikkannavar is a US-born citizen who just returned from a vacation in Chile when he was pulled aside by a US customs officer who led him ton an interview room and asked for his phone. The engineer was torn because his work-issue phone contained other people's data where he wouldn't allow anyone to inspect it in any other circumstance. But when faced with the risk of detention, he had to give his phone along with the PIN to unlock it.
Bikkannavar's phone was eventually returned but the engineer was left with questions of what was the right thing to do in that situation. The incident received a backlash from the public saying it was another anti-Muslim incident driven by the President's recent Executive Order of Muslim travel ban.
Arstechnica asked legal experts on how to proceed in this type of incident when a customs officer asks for your phone. Apparently, refusal to hand over your phone to customs will lead to worse consequences as they are legally allowed to do random inspections to anyone's devices. The Customs and Border Protection (CBP) can basically seize your anyone's phone while the owner will be detained for a certain amount of time.
According to the article, a document states that detained devices should not exceed five days unless extenuating circumstances exist. The policy adds that the CBP can demand for technical assistance including translation and decryption which is also in accordance of 19 US Code Section 507. The federal law says that "officers may seek such assistance with or without individualized suspicion" and refusal to comply is guilt of misdemeanor and subject to a fine of not more than $1000.
Physical detention should not be longer than 36 hours according to former judge. But for a US citizen, the CBP has can't detain him indefinitely for refusal to provide a password. They may however be detained for hours and seize the phone for months as they try to break into it.
For situations like this, legal experts suggest that people should give in to the CBP's demands in most situations. But if your phone contains private data, you can contact a lawyer and deal with the consequences. Just be sure you're ready for the legal proceedings that will follow