Zenpanik
The key that stays and the key that travels: where a passkey lives on an iPhone and a MacBy Pavel Nikolov, November 12, 2026

Part 3: The key that travels

Part 3 of 5 in a deep dive on where a passkey lives on an iPhone and a Mac, and what the Secure Enclave, Touch ID and Face ID do for it. Start with Part 1 if you are new to the series.

The keychain is a file

The keychain is where iOS and macOS keep small secrets: passwords, login tokens and keys. Apple describes it plainly. It is “implemented as a SQLite database, stored on the file system”. SQLite is an ordinary database format, and the file sits on the same flash storage as everything else. A system process called securityd decides which app may read which row. Passkeys live here too. Apple’s deployment guide says the passkeys users create “are stored on their device in the Passwords app”, and that iCloud Keychain protects and syncs the credentials stored in that app.

Every row is encrypted in two parts, with two different keys. Both use AES-256-GCM, a cipher with 256-bit keys that also detects any change to the encrypted data. The metadata key covers the searchable attributes. The secret key covers the secret value, and each row has its own. Apple writes that the metadata key is cached in the Application Processor for speed, while the secret key “always requires a round trip through the Secure Enclave”.

Metadata

The website, the account name and the other searchable attributes. Encrypted with the metadata key, which the enclave protects and the main processor caches so searches stay fast.

Secret value

For a passkey, the private key. Encrypted with a key of its own, one per row. Apple says this key “always requires a round trip through the Secure Enclave”.

Readable after unlock without a new enclave requestReadable only through the enclave
Figure 7. One keychain row, two keys. Listing your passkeys needs only the cached metadata key. Using one needs the enclave. Source: Keychain data protection.

A 256-bit key has 2256 possible values, about 1.16 × 1077. Nobody finds one by trying them. So the strength of a keychain row is the strength of whatever releases its key, and that is the chain from Part 2: the UID, the passcode and the attempt counter. An attacker who copies the database file off the device has rows they cannot open, because the keys that open them are wrapped under a UID that stayed behind.

Rows can carry extra conditions. A keychain item can require that the user be present, proved by Face ID, Touch ID or the passcode, and can require that the enrolled fingerprints or face have not changed since the item was added, which stops an attacker from enrolling their own finger. Apple says these access rules “are evaluated inside the Secure Enclave”, and the key is released to the operating system only if they are met.

It helps to keep storage and triggers apart. The keychain is storage. Touch ID, Face ID, the passcode and a Mac’s login password are triggers, and each is a way of telling the enclave to open a row. Apple says a keychain item protected this way is released by the Secure Enclave only after a successful match or with the device passcode or account password. The passcode is the trigger that feeds the math from Part 2. A biometric match releases keys the enclave already holds in memory, which is why a restarted device asks for the passcode first.

What happens after the release is the part Apple does not document for passkeys. For keys the enclave creates itself, Apple states that operations “are always performed inside the Secure Enclave”. By the rules Apple publishes for developers, a synced passkey cannot be that kind of key, because that kind cannot be exported. Apple could use a private mechanism it has not documented, and I have no evidence either way. My reading is that a passkey’s private key is handled like a saved password. It is unlocked through the enclave, then used by system software outside it for the moment of signing. That is Way A from Part 2. Technology journalist Glenn Fleishman drew a similar conclusion in 2022.

“Passkeys are not stored in Secure Enclave. They are stored like passwords.” Glenn Fleishman, comment on Michael Tsai’s blog, June 29, 2022

The practical meaning is narrow. On a device that is locked, or unlocked but not compromised, nothing changes, and the passkey is out of reach. The difference shows on a device whose operating system an attacker already controls while you are using it. An enclave-only key could be misused there but never copied. A keychain passkey, once unlocked, could in principle be copied. That is an inference from the design. I have not seen a confirmed public report of it happening, and I did not search exhaustively.

One keychain, three kinds of item

Apple uses two names that sound like two stores, the keychain and iCloud Keychain. On the device, iCloud Keychain is the part of the keychain that is marked to sync. Apple writes that every item that will sync has to be explicitly marked with an attribute called kSecAttrSynchronizable, and that items added by third-party apps do not sync by default. A passkey saved through the Passwords app carries the mark.

Items without the mark stay on the device, and some are deliberately tied to it. Apple’s protection classes each have a “This device only” counterpart, and items in those classes stay wrapped under the UID even when they are copied into a backup. Keys created inside the enclave, from Part 2, belong here too, since no other chip can use them. The keychain files them as sealed entries. A Mac adds a third kind. It also has file-based keychains, such as the login keychain shown in the Keychain Access app, and that file is the one the September 2026 report in Part 2 was about.

Keychain on your MacMarked to sync (iCloud Keychain)Device only, including enclave-made keysKeychain files, such as the login keychainiCloud holds it encryptedfor your devices onlyYour iPhoneMarked to syncThis device only
Marked to syncThis device onlyClosed wall
Figure 8. One keychain, three kinds of item. Only items marked to sync leave through iCloud. Device-only items and a Mac’s keychain files are not synced. Schematic. Sources: Secure keychain syncing, Keychain data protection.

The sync mark is what makes a passkey the key that travels. Marked and unmarked items rest under the same chain from the UID while they are on the device. The mark decides only whether a copy may also leave.

How a passkey reaches your Mac

Sync is the reason the passkey is a keychain item. When you first turn on iCloud Keychain, the device creates a syncing identity. A syncing identity is an elliptic-curve key pair, on the P-384 curve, that represents this device to your other devices. Apple notes that it is stored in the device’s keychain, so each device’s syncing identity is itself protected by that device’s staying key.

Each device keeps a list of the syncing identities it trusts and signs the list with its own identity key. The signed lists are stored in iCloud. Together they form what Apple calls the circle of trust, the set of devices that have vouched for each other. A new device gets in one of two ways. Either an existing device sponsors it, giving it a voucher signed by its identity keys, or it goes through recovery, covered below.

Inside the circle, items move one at a time. Apple writes that each synced item “is encrypted so that it can be decrypted only by a device within the user’s circle of trust; it can’t be decrypted by any other devices or by Apple.” Only rows explicitly marked as synchronizable travel. Device-specific rows, such as iMessage keys, stay put.

iPhone: wrapped under keys its enclave guardsiCloud: encrypted for the circle of trust, unreadable to AppleMac: wrapped under keys its enclave guards
Passkey, always encryptedEnclave-guarded while at rest
Figure 9. One passkey, three boxes. At rest on each device it is encrypted under keys that device’s enclave controls. In transit it is encrypted for the devices in the circle of trust. The animation is schematic. Source: Secure keychain syncing.

So the traveling key is never bare on the way. It leaves the iPhone encrypted for the circle, crosses Apple’s servers in that form, and on arrival the Mac stores it under its own keys. The same passkey ends up on several devices, each copy guarded by a different enclave. The count of places it can be attacked grows with every device in the circle, and each of those devices is unlocked by its own passcode or password.

Losing every device

Sponsorship needs a device that is already in the circle. If your phone and laptop are both gone, there is none. For that case Apple keeps an escrow copy. Escrow means leaving a locked copy with a third party who cannot open it. Apple says the escrowed keychain is encrypted using a strong passcode, and that the service releases it only under a strict set of conditions.

The escrow records sit behind clusters of hardware security modules. A hardware security module, or HSM, is a tamper-resistant computer built to guard keys, the data-center relative of the enclave. To recover, you sign in with your Apple Account and password, answer an SMS to your registered number, and enter a device passcode. The HSMs check the passcode with a protocol called SRP, which proves you know a secret without sending it, so the code itself isn’t sent to Apple.

1

Account password

You sign in to your Apple Account.

2

SMS code

You answer a text sent to your registered phone number.

3

Device passcode

You type the passcode of one of your devices. The servers verify that you know it without receiving it.

4

Ten tries

Hardware security modules count the attempts. After the tenth failure they destroy the record.

5

Keychain restored

The new device decrypts the keychain and wraps it under its own enclave’s keys.

Figure 10. Recovering a keychain after losing every device. Steps 3 and 4 repeat the design of the enclave in a data center, with a short secret protected by a hardware counter. Sources: About the security of passkeys, Escrow security for iCloud Keychain.

The HSMs allow only 10 attempts. After several failures the record locks and you have to call Apple Support for more tries. After the tenth, the cluster destroys the record. Apple adds that the administrative access cards that would let anyone change this firmware have been destroyed, and that an attempt to alter it makes the cluster delete its own key. The arithmetic is the one from Part 2: 10 guesses against a random six-digit passcode succeed 1 time in 100,000.

Apple lists what this design is meant to survive. Passkeys and passwords should stay protected if the user’s Apple Account is compromised, if iCloud is compromised by an outside attacker or an employee, and if a third party gets into user accounts. By Apple’s description, an account takeover alone does not open the keychain. The attacker also needs a device passcode, within ten tries.

That gives the device passcode a second job. It unlocks the device in your hand, and it is the last factor between a stranger with your account and your recovered keychain. Michael Tsai raised the reverse risk when passkeys launched. Someone who gets into the account and can read or redirect the SMS could burn the ten attempts and destroy the escrow record. As I read Apple’s description, that would cost you recovery and leave the copies on devices you still hold untouched.

Continue Part 3: backups, a dead chip and export