Security whitepaper
Version 1.0 · 2026-11 · Independent audit: planned before public release
This paper describes how Lockveil is designed to work before release. We will update it after the independent audit.
Overview
This part is written for everyone. It says what Lockveil is designed to protect, from whom, and where its protection ends.
What Lockveil protects
Your photos, videos, documents and notes, and also their names, thumbnails and folders. Lockveil is designed to encrypt all of it on your iPhone before anything is saved. When you look at a file, it is opened only in memory and is not written to storage in readable form, apart from the few times you ask for it (see the technical section).
Who it protects you from
- Someone who has your unlocked iPhone, such as a partner, a child or a coworker. Each vault has its own code, the app locks itself when you leave it, a privacy cover hides it in the app switcher, and you can disguise the app.
- Someone who pressures you to open the vault. A decoy vault, a panic passcode and Hidden mode are designed to help. We advise keeping Face ID off for vaults that matter most.
- A stolen iPhone, or a copy of its data. Everything is encrypted, including names, thumbnails, folders and notes. The keys come from your code together with a secret that never leaves the device, through a deliberately slow function that is hard to speed up with special hardware.
- Anyone who can get into your iCloud. Only encrypted data goes to iCloud, in blocks of one fixed size. A weak code such as a PIN is never used to protect the keys that are kept there.
- The developer. There are no accounts, no servers that hold keys and no analytics.
- Losing your data. A free backup, a recovery phrase, careful saving of every change, checked imports and upgrades that can be rolled back.
What we can't see
We can't see your files, their names, your codes or your recovery phrases. There is no Lockveil account and no Lockveil server that keeps keys. The app has no analytics. If you turn on backup, your data is encrypted on your iPhone before it is uploaded to your own iCloud account, and the keys stay on your devices.
What it can't protect against
Lockveil cannot protect a vault while it is open on an unlocked iPhone that someone else is holding. It also cannot defend against an iPhone whose iOS has been compromised, for example a jailbroken one, where an attacker can read the phone's live memory. The known limitations below list more.
Known limitations
We publish these so that you can judge for yourself. They come from our own security design, and none of them is left out or softened.
- iOS cannot prevent screenshots or photos of the screen. Lockveil is designed to cover its contents in the app switcher and while the screen is being recorded or mirrored, but it cannot stop someone from taking a screenshot, or from pointing another camera at your screen while a vault is open.
- The name under the app icon always reads “Lockveil”. Alternate icons change the picture, not the name. A full disguise needs a bookmark that you make yourself with the Shortcuts app, with its own name and icon. The app explains how.
- Slot padding is planned but not guaranteed. We decided on it as something we should do, not something we promise. Slot padding keeps a fixed minimum number of vault files on the iPhone, mixed with look-alike dummies, so that nobody can count the files to learn how many vaults you have. Without it, a forensic examiner who copies the app's data can see how many vault files exist. With it, the total size of the stored data and the times when files were changed can still reveal activity.
- In Hidden mode on the Free plan, creating a 4th vault shows the paywall, which reveals that 3 vaults already exist. Pro has no vault limit.
- Face ID can be coerced. Anyone who can make you look at your iPhone can open a vault that uses Face ID. Keep it off for the vaults that matter most. Face ID can never be turned on for a decoy vault.
- A PIN of 4 to 6 digits has low entropy, which means there are few combinations to try. Its protection relies on the secret that stays on your device. If an attacker extracts both the iOS Keychain and the files from your iPhone, a short PIN can be guessed offline. A pattern of 8 or more dots, or a password, is much stronger, and the app's strength meter says so.
- A forensic copy of your iPhone that was taken before you used the panic passcode still contains your other vaults. The panic passcode erases them from the iPhone from that moment on. It cannot reach back into a copy made earlier.
- The programming language Swift cannot guarantee that every temporary copy of a secret in memory is wiped. Lockveil is designed to clear keys and typed codes as soon as it can, but a trace might stay in memory until iOS reuses that space.
- Apple, or anyone with access to your iCloud account, can see how many vault zones your backup has, how many encrypted blocks are stored and how large they are, and when they were uploaded. The content is encrypted before it is uploaded.
- An own recovery phrase is only as strong as it is unpredictable. Anyone who holds your iCloud backup data, or your app files together with a value that moves to a new iPhone with Quick Start or an encrypted iOS backup, can try guesses offline, slowed only by the Argon2id function. 12 words do not have this weakness, which is why they stay the default.
- The sign-in screen opens on one code type (pattern, PIN or password): the type of the main vault in Classic mode, or of the vault whose type changed last in Hidden mode. It says nothing about how many vaults exist or which code types they use.
Technical details for auditors
This part describes the design in more detail, for people who review cryptography. It stays at the level of design: it does not give file layouts. The full specification is what the independent audit will check the finished app against.
Cryptographic primitives
All cryptography goes through one module of the app. No other part of the app calls a crypto library for vault data.
| Purpose | Primitive | Notes |
|---|---|---|
| Content, headers and backup payloads | AES-256-GCM | Fresh random nonce each time; the tag is checked on every read. |
| Keys from other keys | HKDF-SHA256 | A separate purpose label for each key. |
| Locators and tags | HMAC-SHA256 | Names the header file without revealing whose it is. |
| Keys from codes | Argon2id version 1.3 | From libsodium. Memory-hard and slow on purpose. |
| Sealing data to a vault that is not open | HPKE (RFC 9180), base mode | Curve25519, SHA-256 and ChaCha20-Poly1305. Used for the Share Sheet inbox and for intruder photos. |
| Face ID | Secure Enclave P-256 key agreement | With HKDF and AES-GCM. |
| Index database | SQLCipher 4 | AES-256 with HMAC-SHA512 on every page. |
| Hashing | SHA-256 | Salt derivation and the recovery phrase checksum. |
| Randomness | The iOS system CSPRNG | Used for every key, nonce and dummy. |
| 12-word recovery phrase | BIP-39 English word list | 128 bits of randomness plus a checksum. An own phrase goes through Argon2id. |
Key hierarchy
- You enter a code: a pattern, a PIN or a password. The code type is part of what is hashed, so the same characters entered as a PIN and as a password give different keys and open different vaults.
- The code, together with a secret that is made on first launch and never leaves this iPhone, goes through Argon2id with 64 MiB of memory. The number of passes is calibrated once per device so that one derivation takes between 0.5 and 1.0 seconds, and it is never lowered afterwards.
- The result is the access key.
- From the access key come the locator, which names the vault's header file, and the header key.
- The header key opens the header, which holds the master key. The master key is random and belongs to one vault.
- From the master key come the index key, which opens the index database, and the backup key, which protects what goes to iCloud. Each file and each thumbnail has its own random file key, which is kept in the index.
The recovery phrase and Face ID are two other ways to reach the same master key. They are described below.
Vault headers
Each vault has a header of one fixed size. It holds the master key and is encrypted with a key that comes from the code. Lockveil also keeps dummy headers made of random data, which look the same as real ones to anyone who does not have a key.
To sign in, Lockveil derives the locator from the code and looks for the header with that name. A missing file and a failed decryption are handled in the same way, so nothing tells a code that opens nothing apart from a file that does not exist. The slow key derivation always runs first.
Slot padding is the plan to keep a minimum number of header and database files on the iPhone at all times, mixed with dummies, so that counting files tells nothing. It is planned but not guaranteed: we decided it as something we should do, not something we promise (see limitation 3). We will not describe Hidden mode as hiding how many vaults you have until slot padding is in place.
Changing a code is built to survive a crash at any point: the new header is written first, the old one is removed afterwards, and the master key and the files are not touched.
Sign-in and lockout
Lockveil offers three code types: a pattern of at least 6 dots with a change of direction, a PIN of 4 to 12 digits, and a password of at least 8 characters. Every vault has its own code type, and the sign-in screen lets you switch between them without any cost or failed attempt.
In Classic mode, wrong codes are slowed down. Failures 1 to 4 have no delay. The 5th failure locks sign-in for 30 seconds, failures 6 to 9 lock it for 30 seconds each, and the 10th and every later failure locks it for 5 minutes. The counter resets after a correct code. It is stored on the device and survives restarts.
Hidden mode never shows an error, never delays and never takes an intruder photo, because any of these would show that the mode is on.
Sign-in modes
- Classic is the default and the recommended mode. An unknown code shows an error, and Pro adds an optional photo of the person who typed it. The first vault you create is the main vault. It sets up the decoy vault, the panic passcode, the attempt log and the Share Sheet inbox. It cannot open, list or count any other vault.
- Hidden treats every vault the same. An unknown code opens a new empty vault that exists only in memory until you add something to it. There is no decoy role, no attempt log and no intruder photo.
One code opens exactly one vault. No vault holds another vault's keys, locators or identifiers. In Classic mode, decoy and standard vaults are sandboxed: settings changed inside them stay inside them and have no effect on the rest of the device.
Decoy vault and panic passcode
A decoy vault is a separate vault with its own code, its own master key and its own recovery phrase. It is made from the main vault, which keeps only a flag that a decoy exists, and never its keys or contents. Face ID can never be turned on for a decoy.
The panic passcode opens a target vault, in the same way and at the same speed as a normal sign-in. In the background it then erases the other vaults from this iPhone: their headers, databases and files, and the Face ID record if it belongs to another vault. The panic passcode never deletes anything in iCloud, so erased vaults stay recoverable with their recovery phrases. A copy of the iPhone taken earlier is not affected (see limitation 7).
Face ID
Face ID works for one vault per device. Lockveil makes a key inside the Secure Enclave and uses it to seal that vault's keys. When you use Face ID, iOS releases the Secure Enclave key and the vault opens. If someone adds a new face to the iPhone, the key becomes unusable. Lockveil then turns Face ID off, tells you once, and asks for your code. Face ID is not offered for decoy vaults or for panic targets. See also limitation 5.
Recovery phrase
Every vault has one recovery phrase at a time, and you choose its kind:
- 12 words, the default. They are random and come from a standard word list, so they are strong enough to need no slow function.
- Your own phrase, typed twice. It is never stored anywhere, so it can be replaced but never shown again. Because people choose guessable phrases, it always goes through Argon2id. See limitation 10.
Nobody else holds a copy of either kind. If you change the phrase, the old one stops working. A recovery header is kept on the iPhone, so a forgotten code can be reset without a network, and a matching record goes into your backup, so a new iPhone can restore the vault.
Backup
Only encrypted data leaves the iPhone. File contents are uploaded as the same ciphertext split into blocks of one fixed size, 4 MiB, and the last block is padded with random bytes, so iCloud never sees real file sizes. Everything goes into the private database of your own iCloud account. The keys never leave your devices, and uploads work while the vault is locked, because everything is encrypted at the moment it changes. Backup is never deleted when Pro ends and is never touched by the panic passcode. See limitation 9 for what Apple can still see.
iOS device backups
This is separate from Lockveil's own backup. Vault headers, indexes and recovery records are always included in iOS device backups. The encrypted files are left out while Lockveil's own iCloud backup is on and up to date, and included otherwise. So with Lockveil backup off, your encrypted files are part of your iPhone's regular device backup. We chose this so that moving to a new iPhone keeps working for people who turned our backup off, and so that people who use it do not pay for their iCloud storage twice.
Readable data on storage
Decrypted content is not written to storage, with two kinds of exception. The first is a system hand-off when you import: the temporary file that the photo picker, the document picker or the camera gives the app. The second is a copy you ask for: exporting, sharing, or opening a file in another app. These temporary copies get the strongest iOS file protection, are left out of backups and are deleted as soon as the operation ends, with a sweep at the next launch as a safety net. Viewing photos, playing video, reading documents and notes, and drawing thumbnails all happen in memory.
Locking and screen privacy
The app locks as soon as you leave it, with a choice of delays, and on an incoming call. Locking closes the session, wipes the keys, closes the database and drops decoded images. A privacy cover hides the app in the app switcher and while the screen is being recorded or mirrored. Screenshots cannot be blocked on iOS (see limitation 1).
Memory and logging
Keys live only in dedicated key types, buffers from the crypto library are wiped after use, and what you type as a code is cleared right after the key is derived. Lockveil never logs keys, codes, phrases, locators, file names, folder names, note text or the number of items in a vault. Recovery words are shown as text that cannot be selected or copied. Swift cannot promise that no temporary copy remains in memory (see limitation 8).
Tests and independent audit
The crypto code is designed to be tested before anything else. The required tests are known-answer tests against published test vectors, sample files that were frozen once and must open forever, negative tests that damage a header or a chunk and expect a clean failure, round-trip tests with random file sizes, tests for both recovery phrase kinds, and a scan showing that one vault's keys and identifiers never appear in another vault's data.
An independent audit of the cryptography is planned before public release. The auditor has not been chosen yet. This page will say so when that changes, and will link to the audit report once it exists.