Overall, it's probably better to just give them your encrypted data. If you're not doing anything illegal, you don't have much to worry about. In my case, my data consists of software projects, personal diary/e-mails, etc. Nothing incriminating.
In principle what they're doing is wrong (violating your privacy and searching you without a warrant), but in the long run it'll probably just save you time to comply. Unless you're doing anything illegal, giving them your data shouldn't really be a problem.
If they "accidentally" share / release NDA'd corporate data (never heard of this happening), you can always take them to court. Heck, you can even take them to court for searching you without a warrant.
Not at a border crossing - at least not for a non-US resident.