Security model
How SnapLockr Encryption Works
Most photo vault apps say they are secure without saying how. This page sets out exactly how SnapLockr protects your photos: the ciphers, how the keys are derived and stored, and — just as important — what it cannot protect against.
At a glance
| Media cipher | AES-256-GCM (Apple CryptoKit) |
|---|---|
| Master key | Random 256-bit key, generated on the device |
| Passcode key derivation | PBKDF2-HMAC-SHA256, 600,000 iterations, 32-byte random salt |
| Passcode | 6–12 digit PIN or 8–128 character passphrase for new vaults; never stored in any form |
| Recovery code | 24 characters, 120 bits; the only key to an iCloud backup |
| Face ID / Touch ID | Keychain item bound to the current biometric enrolment |
| Keys leave the device | Only inside an iCloud backup you make, wrapped by your recovery code. Keychain items are this-device-only |
| Album names and filenames | iOS Data Protection on the device; encrypted with the vault key in iCloud backup |
| Break-in photos and share inbox | Curve25519 key agreement, HKDF-SHA256, AES-GCM |
| Wireless transfer | HTTPS with an on-device P-256 certificate and per-session password |
| Servers | No SnapLockr servers, account, analytics or ads. Optional backup uses your own iCloud |
The master key and your passcode
When you create a vault, SnapLockr generates a random 256-bit master key on your device. Every photo and video is encrypted with it using AES-256-GCM, with a fresh random nonce for each item. The master key never changes for the life of the vault.
The master key is never stored as it is. It is stored only wrapped — sealed with AES-GCM under a key-encryption key derived from your passcode with PBKDF2-HMAC-SHA256 at 600,000 iterations and a 32-byte random salt. That iteration count follows current OWASP guidance and makes each guess deliberately slow.
Your passcode itself is never stored, not even as a hash. When you unlock, SnapLockr derives the key-encryption key from what you typed and tries to unwrap the master key. A wrong passcode fails AES-GCM's authentication tag, so the tag is the only verifier. Before deriving, the passcode is normalised to Unicode NFKC, so a passphrase typed on a different keyboard still produces the same key.
The wrapped key is what a guess is checked against, so it is worth being precise about where it lives: in your iPhone's Keychain, readable only while the phone is unlocked and never synced or restored to another device. Someone who managed to copy it out — which takes your unlocked phone or a forensic exploit — could try passcodes offline, without SnapLockr's delays. A 6-digit PIN would not last long against that; a long passphrase would. That is why new vaults need at least 6 digits, why passphrases are offered, and why the passcode-wrapped key is never put in a backup.
The design has a useful side effect: changing your passcode is instant. SnapLockr unwraps the master key with the old passcode and re-wraps it with the new one. No media is rewritten, so there is no half-finished state if something interrupts it.
Face ID and Touch ID
In many vault apps, Face ID is a screen you can skip past: the app checks a yes-or-no answer and then shows you the photos. In SnapLockr a biometric match is a cryptographic gate. Turning on Face ID stores a copy of the master key in the Keychain under an access control of .biometryCurrentSet with WhenPasscodeSetThisDeviceOnly.
The Secure Enclave only releases that item after a successful match. If the enrolled faces or fingerprints change — someone adds their own — the item is invalidated and the vault falls back to the passcode. Because it is this-device-only, it never syncs and cannot be restored onto another device. Face ID and Touch ID open your real vault only, never the decoy.
The recovery code
At setup SnapLockr shows a recovery code once: 24 characters in six groups of four, 120 bits of randomness. It wraps its own copy of the master key with its own salt, independent of your passcode, so it keeps working after you change the passcode. It is also the only key to your iCloud backup.
If you lose it, create a new one in Settings › Security after entering your passcode; the old code stops working. Vaults created by SnapLockr 1.0 have no recovery code until you create one, and cannot be backed up without it.
Nobody else holds a copy of your key, so nobody else can reset it. Lose both the passcode and the recovery code and the vault cannot be opened — by you, by us, or by anyone. Store the code in a password manager or somewhere physically safe.
Guessing the passcode
Repeated wrong passcodes trigger escalating delays. Each attempt is counted before the passcode is checked, and the counter is kept in the Keychain rather than in the app's memory or preferences, so force-quitting or backgrounding the app does not reset it. Delays are timed on a clock that changing the date does not affect, and a reboot restarts the current delay rather than ending it.
| Failed attempts | Delay before the next try |
|---|---|
| 1–4 | No delay |
| 5 | 30 seconds |
| 6 | 1 minute |
| 7 | 2 minutes |
| 8 | 5 minutes |
| 9 | 10 minutes |
| 10 and over | 30 minutes |
You can also turn on Emergency Erase, which destroys the vault's keys after 10, 15 or 20 consecutive failures. Once the keys are gone, the media on that device is unrecoverable — so it is off by default. Emergency Erase does not touch iCloud: a backup you made earlier can still be restored with your recovery code.
What is encrypted, and with what
Text recognition runs on the device at import, so you can search for words inside a photographed document. That text is often the most sensitive thing about an image, so it is encrypted with the vault key like the image itself.
| Data | On the device | In iCloud backup |
|---|---|---|
| Photos and videos | Vault key | Vault key |
| Thumbnails | Vault key | Vault key |
| Text recognised in images | Vault key | Not backed up; rebuilt on the device after a restore |
| Album names, filenames, source web addresses and dates | iOS Data Protection only | Vault key |
| The vault key itself | Wrapped by your passcode and by your recovery code | Wrapped by your recovery code only |
| Break-in photos | Break-in public key; viewable only after unlock | Not backed up |
| Decoy vault | Its own key (album names and dates: iOS Data Protection only) | Not backed up |
On the device, album names, original filenames, the web address an item was saved from, and import and capture dates are stored in the app's database under iOS Data Protection rather than the vault key. iOS protects them until you first unlock the phone after a restart; after that they are readable to the system even while the phone is locked, and they are included in iPhone backups to a computer or to iCloud. They are not behind your SnapLockr passcode, so neutral album names give away less. The photos, thumbnails and recognised text in those same backups stay encrypted with the vault key.
Writing to a locked vault
Two features have to add to the vault while it is locked, when the master key is not available: break-in photos, taken after a wrong passcode, and the share extension, which lets you send media to SnapLockr from any app.
Both use public-key encryption. A Curve25519 public key is stored in the clear; each item is sealed with an ephemeral Curve25519 key agreement, a key derived with HKDF-SHA256 that is bound to both public keys, and AES-GCM. The matching private key is itself sealed with the master key, so it is only usable after a successful unlock. The share extension can add to your vault and cannot read it — its only entitlement is the shared App Group.
The decoy vault
A decoy PIN opens a second vault with its own independent master key and key envelope. A decoy envelope always exists: one is created at setup with a passcode that is generated and immediately discarded. Its presence on the device therefore says nothing about whether you set a decoy PIN. Unlocking takes the same time whichever vault opens, and the decoy's settings are stored encrypted and padded so they look the same whether or not a decoy exists.
The decoy is designed for someone standing over you, not for a forensic lab. Album names and item counts for both vaults are part of the app's database (see above), so someone who can read an iPhone backup can see that the decoy has content. And Face ID opens only your real vault: if you might be made to unlock in front of someone, turn biometric unlock off.
When media leaves the vault
- Viewing and sharing. Video playback and the share sheet need a real file, so SnapLockr writes a temporary decrypted copy with iOS complete file protection into one scratch directory, and deletes it as soon as you leave the app.
- Wireless transfer. The phone runs an HTTPS server with a P-256 certificate it generates itself, valid for one day. Your browser will warn that the certificate is not from a public authority; compare its SHA-256 fingerprint with the one SnapLockr shows. Each session has a new random password, and the server stops when you leave the screen or background the app.
- USB transfer. Exports are decrypted files in the app's Documents folder so your computer can read them. SnapLockr deletes them as soon as you leave the app, so copy them while it is open. Files you copy in are deleted once they have been imported.
- Exports. Anything you export or share is an ordinary file from then on, protected only by wherever it ends up.
Encrypted iCloud backup
Backup runs when you tap Back Up Now, and uploads the ciphertext the vault already holds to your own private iCloud database. Album names, filenames, web addresses, dates and media types are sealed into one encrypted blob per record, so no CloudKit field gives away what the vault is for. What iCloud can see is how many albums and items there are, how large they are, and when backups ran. The decoy vault, break-in photos, recognised text and Recently Deleted are not backed up.
The master key lives in the Keychain under a this-device-only setting, so it never syncs on its own. A backup therefore carries its own copy of the key — wrapped only with your recovery code, never with your passcode. On your iPhone a 6-digit PIN is protected by delays and attempt limits, but anyone holding a PIN-wrapped copy could try every PIN offline in minutes. A 120-bit recovery code is beyond any offline search. That is why a vault without a recovery code cannot be backed up.
To restore on a new device, sign in with the same Apple Account, enter your recovery code, and choose a passcode for that device; everything then decrypts locally. Your passcode alone cannot open a backup.
Backups made by SnapLockr 1.1 also carried a passcode-wrapped copy of the key. The first backup made by a later version replaces it, and removes older snapshots that carried it. If you backed up with 1.1, back up again after updating.
What SnapLockr does not protect against
No app can protect against everything, and it is worth knowing where the edges are.
- A compromised device. Malware or a jailbreak running while the vault is unlocked can see what you see.
- Someone watching you type. A passcode seen over your shoulder opens the vault. Use Face ID in public, a passphrase rather than a short PIN, and change the passcode if you think it has been seen — it takes a second.
- Copies outside the vault. Originals left in Photos or Recently Deleted, photos inside chat apps, and anything you have exported are outside SnapLockr's protection.
- A lost passcode and recovery code. This is the cost of nobody else holding your key. There is no back door, so there is no way back in.
- Someone who can read your iPhone backups. They cannot see your photos, but they can see album names, filenames, dates and counts, as described above.
- A forensic lab with your phone. If the wrapped key can be extracted, a short PIN can be guessed offline. Use a passphrase if this is your threat.
- Screenshots and screen recording. SnapLockr hides its contents in the app switcher, but does not block screenshots.
Frequently asked questions
Does SnapLockr store my passcode?
No. The passcode is never stored, not even as a hash. It is used to derive a key that unwraps the master key, and a wrong passcode simply fails AES-GCM authentication. There is no copy of the passcode to steal; on your device every guess is slowed down and counted.
Can SnapLockr's developer see my photos?
No. Photos are encrypted on your device and SnapLockr has no server. iCloud backup, if you use it, uploads ciphertext to your own iCloud account, and the key needed to read it is wrapped with your recovery code — which only you have.
Why is changing my passcode instant?
Your media is encrypted with a master key that never changes. Changing the passcode only re-wraps that key with a new passcode-derived key, so nothing in your library is rewritten.
What happens if I forget my passcode?
Use the 24-character recovery code SnapLockr showed you at setup. It unlocks its own wrapped copy of the master key, and you then choose a new passcode. Without the passcode or the recovery code, the vault cannot be opened by anyone.
What do I need to restore an iCloud backup?
Your recovery code and the Apple Account you backed up with. The backup holds the vault key wrapped only by the recovery code, never by your passcode, so the passcode cannot open it. On the new device you enter the recovery code and then choose a passcode for that device.
Want the practical side? How to encrypt photos on iPhone walks through setting a vault up step by step.