Photo Encryption on iPhone: What It Actually Means

iOS encrypts your photos by default, but that protection disappears when you unlock. What encryption covers and why CryptoKit matters.

Inner Gallery6 min readUpdated November 15, 2026
EncryptioniPhone
In short
  • Your iPhone encrypts every file on disk, with keys tied to the device passcode and the Secure Enclave.
  • The Photos app uses the default protection class: files are accessible from the first unlock until a restart.
  • That encryption protects against hardware extraction, not against someone with your passcode.
  • App-level encryption with a separate key keeps photos protected on an unlocked device.

Vault apps, cloud services, and Apple all use the word "encrypted," each with a different meaning.

iOS encryption, strong but conditional

Every modern iPhone encrypts files on the flash storage chip, with keys derived from the device passcode and hardware keys burned into the Secure Enclave. Apple's platform security guide defines four data protection classes, which set when a file can be decrypted.

ClassFiles accessibleUse
NSFileProtectionCompleteOnly while unlockedVery few apps
NSFileProtectionCompleteUnlessOpenUnlocked, or file already openFinishing a write after lock
NSFileProtectionCompleteUntilFirstUserAuthenticationFirst unlock until restartDefault, including Photos
NSFileProtectionNoneAny time, even before unlockLeast protective

The Complete class purges the key from memory on lock, which blocks all background work.

Photos in the Photos app are encrypted on disk, but accessible in memory from your morning unlock until you restart. On a stolen phone that hasn't been restarted, they are accessible.

What "encryption at rest" actually protects

iOS file encryption targets one specific scenario: someone extracts the flash storage chip to read the raw data. This is why law enforcement sometimes can't get into a locked iPhone, as Elcomsoft's forensic analysis details.

Encryption at rest
Storage chip extractiondata is unreadable without the Secure Enclave's hardware keys
Someone with your passcodeeverything decrypts
Apps with photo accessany app with Full Access to your photo library can read all your photos while the device is unlocked
A running, unlocked phonethe default class leaves files accessible in memory
iCloud backupsphotos are encrypted with keys Apple holds, unless ADP is enabled

The "military-grade encryption" problem

The phrase usually refers to AES-256, the US government's encryption standard. The algorithm is strong, but AES-256 data on a server where the company holds the keys can be decrypted by that company at any time. Four questions matter more:

  1. Who holds the key? If it is the app developer or the cloud provider, your data is accessible to them.
  2. When are files decrypted? If they are decrypted in memory whenever the device is unlocked, the encryption only protects against hardware extraction.
  3. Is each file encrypted individually? Per-file encryption limits the damage if a key is compromised.
  4. How is the key derived? A 4-digit PIN has 10,000 possibilities. A 6-character alphanumeric PIN with PBKDF2 and 100,000 iterations is exponentially harder to brute-force.

App-level encryption, a different approach

App-level encryption works independently of iOS file protection: the app encrypts each file with its own key.

PhotosKey from your PINEncrypted filesChaCha20-Poly1305 · each file encrypted separately
App-level encryption: each photo becomes a file that cannot be read without the key derived from the vault PIN.
1
The user sets a PIN
It is specific to the vault and different from the device passcode.
2
A key is derived from that PIN
Through a key derivation function like PBKDF2 with a high iteration count (100,000+), which makes brute-force impractical.
3
Each photo is encrypted individually
With an authenticated encryption algorithm like ChaCha20-Poly1305.
4
The key exists only in memory
When the vault locks, the key is purged. The files on disk are unreadable.
StatePhotos
Device unlocked, vault lockedEncrypted, inaccessible
Device unlocked, vault openDecrypted in memory, visible in the app
Device lockedEncrypted by the vault and by iOS

Someone who knows your iPhone passcode cannot open the vault without also knowing the vault PIN.

The physical safe analogy

In an apartmentOn your iPhone
Front door keyDevice passcode
Steel wallsiOS encryption at rest
Safe with its own combinationEncrypted vault with its own PIN

Whoever has the front door key can reach every room and drawer. They can see the safe exists, but can't open it without the combination.

Inner Gallery
LibraryApple's CryptoKit, the same one Apple builds into iOS
Encryptioneach photo individually, with ChaCha20-Poly1305 (RFC 8439)
Keysone PIN and one encryption key per space. The key never leaves the device
Forgotten PINdata is unrecoverable, because nobody else has the key
iCloud syncoptional, fully end-to-end encrypted, so even Apple cannot read your data. Panic spaces are never synced
Inner Gallery lock screen with its PIN keypadPhoto grid of a space in Inner Gallery
Locked, the vault holds only encrypted files. The PIN makes them readable.

The app has no analytics and no third-party dependencies. As explained in Why Inner Gallery Works Without a Server, this local-first architecture eliminates the need for accounts, third-party servers, and the recurring costs that come with them.

For the practical settings, see The iPhone Photo Privacy Checklist.

Related reading:


Download Inner Gallery on the App Store