Privacy Cardholder security

Privacy Cardholder keeps identity cards, passports, driving licences, vehicle registrations, payment cards and other cards on iPhone. It’s designed so that the cards can be read only on that iPhone, and only after its owner authenticates.

Updated November 29, 2026

Overview

Everything a person adds to Privacy Cardholder is stored in a single encrypted database on their iPhone. The key that decrypts the database isn’t stored anywhere. The app derives it when it’s needed from two secrets: one that the Secure Enclave releases only after Face ID, Touch ID or the device passcode, and one that the Keychain keeps on that iPhone alone.

Privacy Cardholder has no accounts and no servers, and makes no network connections of its own. Cards aren’t included in iCloud or in device backups. They leave the iPhone only when the user exports a card or transfers their cards to another iPhone.

Data protection

Cards, their fields and photos, a passport’s additional pages and the app’s settings are stored in one database, together with the journal files SQLite keeps beside it. The database is encrypted with SQLCipher, an encrypted variant of SQLite, using a 256-bit key. Without that key, the file is unreadable.

A second, unencrypted database acts as the host that the encrypted database is attached to while the app is unlocked.

The app asks iOS to exclude its database folder from backups. A new iPhone set up from a backup starts with no cards.

The database key

The database key is derived with HKDF, a standard key derivation function, from three values generated at random when the database is created. Each is 32 bytes long.

ValueWhere it’s keptHow the app reads it
Authentication secret (Factor A)Keychain, encrypted with a Secure Enclave keyThe Secure Enclave decrypts it after Face ID, Touch ID or the passcode
Device secret (Factor B)Keychain, this device only, when unlockedWithout a prompt
Database identifierKeychain; not secretWithout a prompt, as a salt

Both secrets are required to derive the key. Either one alone is of no use.

Face ID, Touch ID or the passcode lets the Secure Enclave release the authentication secret. The Keychain provides the device secret. HKDF combines both into the database key, which opens the encrypted database. Face ID, Touch ID or passcode Keychain Secure Enclave releases Factor A Factor B this iPhone only HKDF Database key Face ID, Touch ID or the passcode lets the Secure Enclave release the authentication secret. The Keychain provides the device secret. HKDF combines both into the database key, which opens the encrypted database. Face ID, Touch ID or passcode Keychain Secure Enclave releases Factor A Factor B this iPhone only HKDF Database key
The key is derived each time it’s needed, used, and released.

Secure Enclave protection

The Secure Enclave is a dedicated subsystem of iPhone that holds private keys which can’t leave it. When it creates a database, Privacy Cardholder encrypts the authentication secret with the public key of a Secure Enclave key and stores only the encrypted copy. To recover the secret, the app asks the Secure Enclave to decrypt it, and the Secure Enclave first requires Face ID, Touch ID or the device passcode.

The device secret

The device secret is stored in the Keychain with an accessibility class that limits it to this device, and only while the device is unlocked. It isn’t included in backups, so it doesn’t move to another device, and it can’t be read while iPhone is locked. The app reads it each time the database opens a new connection, which can happen many times in a session.

Why the key isn’t kept

Instead of holding the finished key for the whole session, the app holds only the authentication secret and derives the key each time a database connection opens. This keeps the app’s own copy of the key short-lived. Copies of the secrets that the app makes in its own memory are overwritten with zeros when they’re no longer needed.

Note: SQLCipher keeps key material inside each open connection so it can decrypt data. While the app is unlocked, key material therefore exists inside the database library. iOS also hands the secrets to the app in memory the app can’t erase.

Locking and unlocking

Privacy Cardholder is locked when it launches. While it’s locked, the authentication secret isn’t in memory, the encrypted database isn’t attached, and the key can’t be derived. The lock screen shows the same grey placeholder cards for everyone, and reveals nothing about the user’s cards, including how many there are.

Unlocking asks for Face ID, Touch ID or the passcode once per session. If any later step of the unlock fails, the app locks again straight away, so a failed unlock doesn’t leave the authentication secret in memory.

When the app locks:

  1. The authentication secret is overwritten with zeros, so no new key can be derived.
  2. Every database connection used for reading is discarded.
  3. The encrypted database is detached from the connection used for writing.
  4. Everything that was on screen while the app was unlocked is released.

Discarding the reading connections, rather than detaching each one, is designed to ensure that no connection that could still read the cards survives a lock. Some work can keep a card’s photo in memory for a few seconds after a lock, such as text recognition that’s under way, or a photo picker that iOS hasn’t finished closing.

Automatic locking

The user can choose, under Auto-lock in Settings, how long the app stays unlocked after they leave it: immediately, after 10 seconds, 20 seconds or 1 minute, or never. With any setting other than Never, the app also locks immediately when the device locks.

Whatever the setting, the database on disk stays encrypted.

While the app is unlocked

  • App switcher. When the app stops being active, a plain cover hides the cards, so the app switcher and the snapshot iOS takes when the user leaves don’t show them.
  • Keyboards. The app offers only Apple’s keyboard. Keyboards from other apps don’t receive the details the user types.
  • Clipboard. A card number or another detail the user copies is removed from the clipboard after the time chosen in Settings, one minute unless changed, even if the app is closed. During that time it can reach the user’s other devices through Universal Clipboard.

Adding and exporting cards

Privacy Cardholder processes card images in memory and recognizes their text on the device with Apple’s Vision framework. Saving a card stores its images and details in the encrypted database.

Export shares a card’s photos, as images or a PDF, through the share sheet. Only the photos leave, never the details the user typed. The files are written to the app’s temporary folder with protection that allows them to be read only while the device is unlocked, and deleted when the share sheet or export screen closes, when the app locks, or, if the app ended without locking, the next time it starts. Where the user sends a copy from the share sheet is their choice, and that copy is outside the app’s protection.

Moving to another iPhone

Because cards aren’t in iCloud or in backups, they move to a new iPhone only by transfer.

The receiving iPhone shows a code. The sending iPhone scans it, requires Face ID, Touch ID or the passcode, and seals a copy of the wallet to the code’s key. The file goes over by AirDrop. The receiving iPhone checks that the file was made for its code and imports the cards under new keys made there. Sending iPhone Receiving iPhone Shows a code a one-time key, in memory only Scans the code and asks the user to confirm Face ID, Touch ID or the passcode Seals a copy of the wallet to the code’s key Checks the file was made for this code Imports the cards under new keys made here camera AirDrop the code stays on screen The receiving iPhone shows a code. The sending iPhone scans it, requires Face ID, Touch ID or the passcode, and seals a copy of the wallet to the code’s key. The file goes over by AirDrop. The receiving iPhone checks that the file was made for its code and imports the cards under new keys made here. Sending iPhone Receiving iPhone Shows a code a one-time key, in memory only Scans the code and asks the user to confirm Face ID, Touch ID or the passcode Seals a copy of the wallet to the code’s key Checks the file was made for this code Imports the cards under new keys made here camera AirDrop
The wallet’s own keys never leave the sending iPhone.
  1. The receiving iPhone shows a code. Behind it is a one-time key that exists only in that iPhone’s memory, and only while the code is on screen.
  2. The sending iPhone scans the code, asks the user to confirm, and requires Face ID, Touch ID or the passcode.
  3. The sending iPhone copies the wallet into a file encrypted with a new random key, and protects that key with the one from the code. The wallet’s own keys never leave the iPhone.
  4. The user sends the file, usually by AirDrop. Without the receiving iPhone’s memory, the file can’t be opened, so a copy left in Messages or Files opens nowhere once the code is gone.
  5. The receiving iPhone checks that the file is complete and was made for the code it showed, then asks before importing. Importing replaces any cards already on that iPhone, and stores the received ones under new keys made there.
The transfer file has three parts: a header in the clear that names the code it answers; the copy’s key, sealed to the code’s key; and the copy of the wallet, encrypted with that key. The transfer file Header in the clear: the code it answers The copy’s key sealed to the code’s key, random for this transfer Copy of the wallet encrypted with the copy’s key The transfer file has three parts: a header in the clear that names the code it answers; the copy’s key, sealed to the code’s key; and the copy of the wallet, encrypted with that key. The transfer file Header in the clear: the code it answers The copy’s key sealed to the code’s key, random for this transfer Copy of the wallet encrypted with the copy’s key
Only the key behind the code, held in the receiving iPhone’s memory, unseals the copy’s key.

The code doesn’t identify a device, so a user should scan only a code shown by their own iPhone.

Keys and recovery

Cards are tied to the iPhone they’re on, and there’s no recovery. If the device is lost, or its Secure Enclave key no longer exists, as after the same iPhone is erased and restored, the cards can’t be decrypted anywhere. Only a transfer made beforehand keeps them.

When the app finds no database, as after it’s deleted and installed again, it generates every key anew before it creates a database, so a new database never uses the key of one that was deleted. An update keeps the database and the keys that open it.

Scope of protection

Privacy Cardholder is designed to protect cards from someone who obtains a copy of the iPhone’s data without the user opening the app for them: from a locked iPhone, even if the copy is kept for a future way in, or from an unlocked iPhone handed over without the app being opened.

What it protects against

  • A copied database file, from a backup or from the device’s storage.
  • Restoring the data to another device.
  • A transfer file intercepted on its way.
  • A copied encrypted authentication secret, which only the Secure Enclave of the original device can decrypt, and only after authentication.

What it doesn’t protect against

  • Someone who has the device and knows its passcode.
  • Malicious code running inside the app while it’s unlocked, such as debuggers, jailbreak tweaks or instrumentation tools.
  • Anything shown on screen while the app is unlocked, including screenshots.
  • A detail on the clipboard, on this device and on the user’s other devices.
  • Copies the user exports, shares, saves or prints.
  • Vulnerabilities in iOS or the Secure Enclave itself.

Source code and builds

Privacy Cardholder’s complete source code is public, under the GNU General Public License v3.0 only, together with a technical description of its security that includes its known gaps. Every TestFlight and App Store build is made from the public repository, and each build has a tag, build-<number>, that marks the exact source it was built from. The repository’s history is never rewritten.

Security issues can be reported privately, as described in the repository’s security policy.

Get it on your iPhoneMade for iPhone

Scan the code with your iPhone camera to download Privacy Cardholder, or send yourself the link.

QR code linking to Privacy Cardholder on the App Store
View on the App Store Requires iOS 18 or later