For many of us, our smart phones document most of our daily lives, including intimate details, such as who we talk to, where we go and how we spend our money. That massive amount of information is also a likely target for the police if they believe you have committed a crime.

But can law enforcement access your phone data to use it as evidence against you? The answer isn’t cut-and-dry, but there are steps you can take to keep that information private. You should also be aware of your Constitutional rights if the police demand to examine your data.

How can law enforcement access your phone data?

The first step to keeping your data private is working with an experienced criminal defense attorney who understands the complex laws and methods police use. The government typically gets your information in two ways:

Directly from your phone: While it’s no guarantee of privacy, cops may not be able to access your phone data if it has a passcode or uses biometric unlocking features, such as facial recognition or fingerprint protection. With the proper court order, law enforcement can try to “crack” your code using sophisticated tools.

How are you protected?: The Fifth Amendment says you can’t be forced to give law enforcement self-incriminating evidence. Civil rights advocates say that means police can’t force you to hand over your password. Many courts agree with that, but the government looks for other ways to get your info.

Third parties: Law enforcement may not need to have physical possession of your device. If they have the right court order, they may be able to access data stored on Apple’s iCloud, or other servers where you back up your information. The ACLU says the government can likely get any data that a provider can decode, as long as it follows the proper legal channels.

How are you protected?: You do have rights here. The Fourth Amendment offers safeguards against illegal search and seizure. Also, a provision in the Electronic Communications Privacy Act of 1986 stipulates that law enforcement must get a subpoena, warrant or court order to get the data.

Judges rely on antiquated laws to render decisions

While many cases have been heard in courts across the country regarding access to phone data, most of the legal arguments cite cases that are decades or even centuries old. Most of the laws were written over access to paper documents and are now applied to cases where gigabytes of data are at stake.

While your ability to control what the government can or can’t access on your smartphone may be limited, your defense attorney will diligently fight to protect your rights and keep your personal information private.