What your iPhone passcode protects
The passcode that unlocks this iPhone is used to protect and access your data on the phone. For some data stored in iCloud, Apple says you use that same device passcode to get it back. A vault passcode is a different code.
Quick answer: Apple's passcode guide says that setting a passcode turns on data protection, which encrypts your iPhone data. Some apps may opt out. Face ID or Touch ID can unlock a supported iPhone, and Apple says you must still enter the passcode after a restart and in several other cases. If you change the passcode on iOS 17 or later, Apple says the previous passcode can be used once during the first 72 hours unless you expire it now. For end-to-end encrypted data stored in iCloud, Apple says that if you lose access to the account, you recover that data with your device passcode or password, a recovery contact, or a recovery key. Changing the iPhone passcode does not change the Apple Account password, and it does not turn Advanced Data Protection on. An Ego vault uses its own six-digit passcode. A signed physical-device restore has not been verified.
Published by Chreia Labs, the maker of Ego. This page uses Apple's passcode guide, Apple's passcode article (published May 13, 2026), Apple's iCloud data security overview (published January 5, 2026), Ego's public product and support pages, and the US App Store listing for Ego, checked November 21, 2026. No independent security audit is claimed.
What the passcode protects on the iPhone
Apple says a passcode needs to be entered to unlock iPhone when you turn it on or wake it, and that setting a passcode also turns on data protection. That is the lock for data on that iPhone. It is not a separate password for one album, one PDF, or one vault. The wider split between the device passcode, standard iCloud protection, and Advanced Data Protection is in how personal data encryption works on iPhone.
- Go to Settings.
- On an iPhone with Face ID, tap Face ID & Passcode. On iPhone Duo or iPhone SE, tap Touch ID & Passcode.
- Tap Turn Passcode On, or Change Passcode if one is already set.
- To see other formats, tap Passcode Options. Apple says the most secure options are Custom Alphanumeric Code and Custom Numeric Code.
Apple Photos does not give each album its own password. Hiding a photo or requiring Face ID before an app opens still uses this device passcode. See how to password-protect photos on iPhone and how to lock or hide an app.
When iPhone still asks for the passcode
On supported models, Face ID or Touch ID can unlock the iPhone after a passcode is set. Apple says you must still enter the passcode to unlock in these cases:
- You turn on or restart the iPhone.
- You have not unlocked the iPhone for more than 48 hours.
- You have not unlocked it with the passcode in the last 6.5 days, and you have not unlocked it with Face ID or Touch ID in the last 4 hours.
- The iPhone receives a remote lock command.
- There are five unsuccessful attempts to unlock with Face ID or Touch ID.
- An attempt to use Emergency SOS is initiated.
- An attempt to view your Medical ID is initiated.
Apple's passcode article also says the device asks for the passcode to update software, erase the device, view or change passcode settings, and install a configuration profile. If you use Touch ID, Face ID, or Apple Pay, Apple says you cannot change the immediate passcode requirement. Features that can still appear while the phone is locked are a separate setting. See how to keep private photos off the Lock Screen and widgets.
Stolen Device Protection is a separate setting. Away from familiar locations, some actions need Face ID or Touch ID with no passcode fallback, and some account changes wait an hour. See how Stolen Device Protection works on iPhone.
The previous passcode can work for 72 hours
Apple's passcode article, for iOS 17 and later, describes Expire Previous Passcode Now. If you forget the new passcode in the first 72 hours after you change passcodes, the previous passcode can be used once to access the device and reset the passcode. Use Expire Previous Passcode Now to turn that off before 72 hours pass.
- Go to Settings, then Face ID & Passcode, or Touch ID & Passcode on models that use Touch ID.
- Tap Change Passcode and enter a new passcode. Passcode Options can switch to a four-digit numeric code, a custom numeric code, or a custom alphanumeric code.
- If you want the previous passcode to stop working before the 72 hours end, tap Expire Previous Passcode Now.
Do not send a passcode to support. If you enter the wrong passcode four times in a row, Apple says you are locked out and the iPhone shows that it is disabled. If you cannot remember the passcode, Apple says you can erase the iPhone with a computer or with recovery mode, then set a new passcode. A backup made before that can restore data and settings. That computer backup is a different password from this passcode. See how to encrypt an iPhone backup.
Use your passcode for data stored in iCloud
Apple's iCloud data security overview says end-to-end encrypted data can be recovered only on your trusted devices. If you lose access to the account, only you can recover that data, using your device passcode or password, a recovery contact, or a recovery key. The device passcode in that sentence is the code that unlocks the iPhone. After you change it, the new passcode is that device passcode. For the first 72 hours, the previous one can still be used once on the phone unless you expire it.
That is not the same as your Apple Account password. Changing the iPhone passcode does not turn Advanced Data Protection on or off, and it does not remove photos from iCloud Photos. Under standard data protection, Apple can still help recover categories such as Photos, iCloud Drive, Notes, and iCloud Backup. The steps and the categories that stay end-to-end encrypted either way are in the personal data encryption guide. To stop an iPhone from syncing its library, see how to keep photos out of iCloud Photos.
Erase Data after 10 failed passcodes
Apple says you can set iPhone to erase all information, media, and personal settings after 10 consecutive failed passcode attempts.
- Go to Settings, then Face ID & Passcode, or Touch ID & Passcode.
- Scroll to the bottom and turn on Erase Data.
After that erase, Apple says you must restore the device from a backup. If you did not back up the iPhone, you need to set it up again as new. If you do not turn Erase Data on, Apple says the device will need to be restored on a computer after ten failed attempts. Erasing the iPhone does not by itself delete an iCloud library or an optional vault backup you already completed.
A vault passcode is separate
The US App Store listing, checked November 21, 2026, names the app Ego: Personal Data Encrypted. It is free, version 1.0, for iPhone with iOS 26 or later. Each vault has its own six-digit passcode, and unlocking opens only that vault. Ego has no account, advertising, or analytics. The first vault is free, with no artificial item limit beyond available device storage.
The iPhone passcode does not open an Ego vault, and a vault passcode does not replace the device passcode. The listing says saving or sharing a copy outside Ego leaves its encryption, and the encrypted original stays in the vault. Importing does not delete the photo in Photos or the file in Files. See what an encrypted photo vault keeps separate and what happens to the original after import.
Optional iCloud backup in Ego is off until you enable it for an unlocked vault. A completed backup is designed to restore on a replacement iPhone signed into the same iCloud account when you still have the complete recovery key. A signed physical-device restore has not been verified. Chreia Labs cannot reset a passcode or decrypt a backup. Read iCloud backup versus manual recovery and Ego's product details before you treat any cloud copy as the only copy. The product page is Ego. Never send a passcode, recovery key, or private file to support. Questions can go through Ego support.