Traveling with data can be risky these days. There are the bad guys like snoopers on public networks at the airport and pickpockets who want to swipe your phone. And then there are the good guys, like border agents who, in the course of doing their job, may inadvertently force you into a compromising position as happened to one NASA employee.

Best to plan ahead. Here are five tips for keeping your data safe while traveling.

1. Use a trusted VPN

You’re going to need to connect to public Wi-Fi hotspots in airports, hotels, coffee shops, and the like. You don’t know who else is connected to these networks, and you shouldn’t need to. Your company’s or a trusted third-party VPN will keep your data away from prying eyes.

SEE: Encryption policy (Tech Pro Research)

2. Don’t use public USB charging stations at train stations and airports

They probably haven’t been tampered with but they’re incredibly easy for people to tamper with. Use a good old-fashioned electrical outlet. Or you can get yourself a USB cable that doesn’t carry data so your device can’t be hacked.

3. Move sensitive data to the cloud

Whether you’re concerned with confidential business data being seen by border agents, or just worried about thieves, keep that data off the device until you really need it.

SEE: Cybersecurity in an IoT and mobile world (free PDF) (TechRepublic/ZDNet special feature)

4. Remove your password managers

This one is mostly about border agents who might have the legal right to compel you to unlock your phone and enter passwords for things. If there’s no password manager on the phone, they can’t make you unlock it. You can reinstall your password manager later when you need it.

SEE: A winning strategy for cybersecurity (ZDNet special report) | Download the report as a PDF (TechRepublic)

5. Don’t hide data or be uncooperative

Border agents have a wide latitude of what they can request. Even when they request something you have the right to refuse, they may detain you longer. So plan ahead so you can cooperate without worry. And don’t rely on tricks like hidden volumes. You may get away with it, but if they’re discovered you’ll be in worse trouble.

These aren’t the only measures you may need to take but they will help you have a little more peace of mind.

For more on keeping your data safe, check out these articles from TechRepublic and sister site ZDNet: