Thanks to tougher encryption built into Apple’s various operating systems, the company has been unable to comply with court orders from the US Department of Justice requiring the company to hand over iMessages in real time in a drug case, reports The New York Times.

Of course, if you aren’t a drug dealer, you probably don’t need to worry too much about the DoJ trying to eavesdrop on your iMessages. But with hacks and government spying becoming more well known, especially in the aftermath of the Edward Snowden disclosures, knowing that your device is secure (even from a court order) can be reassuring.

Apple uses end-to-end encryption with iMessage. This means that even if a message is intercepted between my device and yours, no one can read it. Not Apple, not the government, and not a hacker.

Apple’s iOS devices are encrypted too, starting with iOS 8 released last year. Without a fingerprint or PIN number, Apple says it can’t break into an iOS device for any reason. The FBI says this could thwart law enforcement efforts to stop criminals and terrorists, but it would also keep foreign and domestic spy agencies from getting into your data–something particularly important for companies looking to keep their competitive secrets secret.

To make its devices even more secure, Apple is expanding the default PIN number on iOS devices to 6 digits in iOS 9. That’s up from 4 in previous versions of the iOS, increasing the total possibilities from 10,000 to 1,000,000.

Last year, Apple CEO Tim Cook said in an interview that the US government–in particular, the National Security Agency–would need to “cart us out in a box” to get direct access to Apple’s servers. Since the NSA disclosures from Snowden several years ago, Apple has significantly increased the default security on many of its devices and frequently reiterated the security of its devices out of the box in its marketing materials. There is a large section on Apple’s website detailing its privacy efforts, including an open letter from Cook laying out Apple’s views on privacy.

“I want to be absolutely clear that we have never worked with any government agency from any country to create a backdoor in any of our products or services. We have also never allowed access to our servers. And we never will.

“Our commitment to protecting your privacy comes from a deep respect for our customers. We know that your trust doesn’t come easy. That’s why we have and always will work as hard as we can to earn and keep it.”

Apple is also revamping its two-factor authentication system in iOS 9, expected to be released publicly in a few weeks.

Encryption has been a hot topic between companies and governments going back decades. Companies have argued that giving user data access to the government could be exploited by hackers or misused by other parties. Given the recent massive breach at the Office of Personnel Management, since not even the US government can keep its data secure, I’d trust Apple more to decide what’s best for my data.

What do you do to keep your sensitive information and communications secure? Let us know in the comments below.