Most border crossings are uneventful, but if you have sensitive data on your electronic devices, you may be in for some surprises if you assume the data is private:
For now, a border agent has the legal authority to search your electronic devices at the border even if she has no reason to think that you’ve done anything wrong.
Different people will choose different kinds of precautions to protect their data at the border based on their experience, perception of risk, and other factors. There is no particular approach we can recommend for all travelers.
They go on to explain the options and make recommendations for many common scenarios.