iPhone Data Protection Classes: When Your Files Unlock
Every file on your iPhone belongs to a data protection class that decides when its keys are available. Here is how the four classes behave when you lock, unlock or restart.
Short answer
Every file on your iPhone is encrypted, but each file belongs to a data protection class that decides when its key can be used. Some files become unreadable seconds after you lock the phone. Others stay readable until the next restart. The app that creates a file picks the class.
What a data protection class is
Apple describes Data Protection as a hierarchy of keys, controlled per file by assigning each file to a class. When a file is created, the phone generates a new 256-bit key just for it, and the hardware AES engine encrypts the file with that key as it is written to flash. Whether the file can be opened later depends on whether its class key has been unlocked.
Apple's own Calendar, Contacts, Mail, Messages, Photos and Health data use Data Protection by default, and third-party apps receive it automatically.
The four classes
Per Apple's Data Protection classes page, a new file is assigned a class by the app that creates it.
Complete Protection
This is the strictest class. Its class key is protected by a key derived from your passcode and the device's unique ID. Shortly after you lock the phone (10 seconds if Require Password is set to Immediately), the decrypted class key is discarded. The data stays unreadable until you enter your passcode or unlock with Face ID or Touch ID.
Protected Unless Open
Some work has to happen while the phone is locked, such as a mail attachment downloading in the background. This class lets an app write a new file while locked, using elliptic-curve key agreement. Once the file is closed, its per-file key is wiped from memory, so reopening it needs the class's private key again.
Protected Until First User Authentication
This class behaves like Complete Protection, except the decrypted class key is not removed from memory when the phone locks. Apple says it has properties similar to desktop full-volume encryption and protects against attacks that involve a reboot. Until you unlock after a restart, though, that data is out of reach.
No Protection
The class key is protected only by the device's unique ID and kept in Effaceable Storage. Apple notes this only affords fast remote wipe, since every key needed to decrypt the files is on the device. Even so, a file with no class is still stored encrypted on iPhone.
Why most app data sits in the default class
Apple states that Protected Until First User Authentication is the default for all third-party app data not otherwise assigned a class. The reason is practical. Apps sync, refresh and process things while your phone sits locked in a pocket, and background work would fail if every file vanished the moment the screen went dark.
That means a locked phone is not the same as locked files. Whether a given app's data falls under the strictest class depends on a developer choice. Features that ask for your passcode again, like locked Notes and the passcode catch, work at the app level on top of this system.
What changes at lock, first unlock and reboot
Three moments matter.
- After you lock the phone: Complete Protection data becomes unreadable within seconds. Default-class data stays available to the system.
- After the first unlock following a restart: default-class keys become available and stay so until the next restart. Apple's developer documentation says a file in this class cannot be accessed until after the device has booted and been unlocked once.
- Right after a restart: nothing in these classes can be read yet. This is why your passcode is needed again after a restart, and why Face ID alone won't do the first time.
How Privara handles this
We don't change how iOS assigns file classes, and we won't say which class any given file uses. What we can tell you is what Privara adds on top. It keeps your photos, videos, documents and contacts together in one AES-256-encrypted vault, so the content is encrypted at rest and not just hidden from view.
The vault opens only when you type your PIN into what looks and works like an ordinary calculator. It needs no account and uploads nothing by default. You can add Face ID or Touch ID, set a decoy PIN that opens a separate vault, and turn on break-in detection that captures a photo of anyone entering the wrong PIN. One place then holds everything you want to keep private, with its own lock separate from your phone's.
Frequently Asked Questions
Are iPhone files encrypted when the phone is unlocked?
Files are stored encrypted on flash either way. The class decides whether the keys needed to read them are available at that moment.
Which data protection class do most apps use?
Protected Until First User Authentication. Apple says it is the default for third-party app data that isn't assigned another class.
Does Face ID unlock the same data as the passcode?
For Complete Protection, Apple lists the passcode, Face ID and Touch ID as ways to make the data accessible again. After a restart, you need the passcode first.
Can an app choose a stricter class?
Yes. The app that creates a file assigns its class, so a developer can choose Complete Protection for sensitive files.