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 2: The key that stays

Part 2 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.

A second computer inside the chip

The processor that runs iOS or macOS and all your apps is called the Application Processor. The Secure Enclave is a second, smaller processor on the same chip. Apple describes it as isolated from the main processor and designed to keep sensitive data secure “even when the Application Processor kernel becomes compromised”. The kernel is the core of the operating system, so the enclave is built on the assumption that the system around it may already be hacked.

To stay independent it brings its own parts. It starts from its own read-only boot code, runs its own operating system (sepOS, built on a small kernel called L4), and has its own random number generator and its own encryption hardware. Apple says the enclave processor runs at a lower clock speed to resist attacks that work by disturbing the clock or the power supply, and that monitoring circuits stop it if voltage or frequency leaves the safe range.

It does not have private memory chips. The enclave uses a region of the device’s ordinary memory, and a component called the Memory Protection Engine encrypts and authenticates every block with a key generated fresh at each startup. Apple writes that an observer outside the enclave “sees only the encrypted and authenticated version of the memory”. The same arrangement repeats through the whole design. The enclave keeps a key, and the data lives somewhere less protected in encrypted form.

The enclave is in every iPhone since the iPhone 5s, every Mac with Apple silicon, Intel Macs with the T2 chip, and the 2016 and 2017 MacBook Pro with Touch Bar. iPhones and Macs share the design in this part, with differences in detail such as the attempt limits.

The UID, a key with no way out

Each enclave has a root key called the UID. UID stands for unique ID. It is a random number fused into the chip when it is manufactured, different for every device. Since the A9 chip, the enclave’s own random number generator creates it during manufacturing, and Apple says the process keeps it from being visible outside the device, so it “isn’t available for access or storage by Apple or any of its suppliers”.

The UID is also hidden from the enclave’s own software. Keys derived from it stay inside the encryption hardware. Apple writes that software “can request encryption and decryption operations with hardware keys” and cannot extract them. By that description, a bug in sepOS could misuse the UID while the device is running and still could not copy it out.

The UID’s job is wrapping. Wrapping a key means encrypting it with another key. If k is a key you want to protect and K is a key derived from the UID, the device stores w = Encrypt(K, k) and throws k away. Getting k back needs Decrypt(K, w), and K exists in one chip. Apple’s example is the internal SSD. Move it to another device and the files are inaccessible, because the new device’s UID gives a different answer.

The same rule covers keys that developers ask the enclave to create. Apple’s documentation limits these to 256-bit elliptic-curve keys on the NIST P-256 curve, and states that pre-existing keys cannot be imported. An elliptic curve is the mathematical structure behind the signature scheme that passkeys commonly use, and P-256 is one standard curve. Even these keys are not kept inside the enclave in the everyday sense. The documentation says the private key is “logically part of the keychain”, and Apple’s CryptoKit notes, quoted in a developer forum thread, say the enclave hands back “an encrypted block that only the same Secure Enclave can later use to restore the key.”

So “stored in the Secure Enclave” is a loose description even for the keys that qualify. A precise one is that the key is stored outside the enclave, wrapped, and can be used only inside it. For a key that never needs to leave the device, the difference does not matter. For a passkey that has to reach your Mac, it decides everything, and Part 3 picks it up there.

UID and passcode

The UID is fused into the chip. The passcode is in your head. Neither is stored on disk.

Class key

Unwrapped inside the enclave using both inputs. For the strictest class it is available only while the device is unlocked.

Per-row secret key

One AES-256 key for each keychain item, stored wrapped. Unwrapping it takes a trip through the enclave.

Passkey private key

The secret value of the row. Readable only after the three steps to its left succeed.

Inside the enclaveStored wrapped on the device
Figure 3. From the staying key to the passkey, in four links. Each link is stored only in wrapped form or not stored at all. Schematic, simplified by me from Apple’s descriptions in The Secure Enclave and Keychain data protection.

Two ways to sign with the same touch

A signature is one calculation, s = Sign(sk, m), where sk is the private key, m is the message and s is the signature. On an Apple device that calculation can happen in two places, and both begin with the same touch on the sensor.

In Way A the private key is an ordinary keychain secret. After the touch, the enclave checks the item’s rules and releases the key to the operating system, and software outside the enclave computes the signature. Part 3 explains why I think a synced passkey follows this path.

In Way B the enclave created the key. The message goes into the chip, the chip computes the signature, and only s comes out. Apple says operations with such keys “are always performed inside the Secure Enclave after it authorizes their use”. Chrome’s own passkey store on a Mac is an example. In the revisions I read, Chromium’s source code says it generates a key pair in the secure enclave after a Touch ID prompt and keeps Secure Enclave backed credentials along with metadata in the macOS keychain.

Way A: a keychain secret (synced passkey)KeychainEnclaveSystem softwaremsThe private key leaves the chip to be used.Way B: a key made by the enclaveKeychainEnclaveSystem softwaremsOnly the signature leaves the chip.
Private keySealed so that only this enclave can use itMessage mSignature s
Figure 4. Two ways to sign after the same touch. In Way A the enclave releases the private key and software outside it signs. In Way B the message enters the chip and only the signature comes out. Schematic. Way A for synced passkeys is my reading of Keychain data protection. Way B is described in Uses for Optic ID, Face ID, and Touch ID and in Chromium’s source.

In both ways the keychain is the filing cabinet. For an enclave-made key it holds the entry that records which site and account the key belongs to, and it holds the key itself as a sealed blob. By Apple’s description the enclave keeps no store of the keys it has made. It receives the blob, uses it internally and returns only the result. Such a credential is therefore tied to one chip. Corbado notes that Chrome’s are lost if the Chrome profile is deleted or the Mac is lost.

These entries are easy to overlook. Chrome files them under its own access group in the keychain, and Apple’s rules allow keychain items to be shared only between apps from the same developer, so other apps cannot read them. Way B is also how a hardware wallet signs, with two differences from my hardware wallet deep dive. The enclave supports only the P-256 curve, and the operating system mediates every request to it, so the chip signs the message the system hands over.

The passcode does the unlocking

The UID alone would protect data against moving the storage to another device. It would not protect against someone holding your device. For that, the keys that guard user data depend on two inputs. Apple writes that the enclave derives the needed value “from the user’s passcode and the Secure Enclave’s UID”, and that the passcode “can’t be learned using unlock attempts sent from a source other than the paired Secure Enclave”. In simplified form, class key = f(passcode, UID).

Tying the passcode to the UID changes the arithmetic of guessing. A six-digit passcode has 106, or one million, possible values. If an attacker could test guesses on their own hardware at an illustrative billion per second, all of them would take 106 / 109 seconds, one millisecond. Because every guess needs the UID, every guess has to be made on the victim’s chip, at the speed and under the rules the enclave sets.

The rule is a counter. Devices released since fall 2020 keep it in the Secure Storage Component, a separate chip with tamper detection that only the enclave can talk to. Each counter lockbox holds a 128-bit salt, a 128-bit passcode verifier, an 8-bit counter and an 8-bit maximum. The component raises the counter before it checks a passcode. When the counter passes the maximum, which Apple gives as 10 attempts on iPhone, it erases the lockbox, and with it the random value that every data key is derived from.

Wrong passcodes entered12345678910Counter lockboxEntropy for all data keysErased128-bit salt, 128-bit verifier, 8-bit counterSchematic. The counter goes up before each check and returns to 0 after a correct passcode.
Figure 5. The attempt counter turns a small passcode into a strong lock. Ten wrong guesses on an iPhone and the material behind every data key is erased. Source: The Secure Enclave, “Secure nonvolatile storage”.

With 10 guesses allowed, an attacker holding a locked iPhone with a random six-digit passcode succeeds with probability 10 / 106, or 1 in 100,000. With a four-digit passcode it is 10 / 104, or 1 in 1,000. Those numbers assume the passcode is random. A birthday or 123456 is far easier to guess, and the counter cannot help with a passcode the attacker has watched you type.

Touch ID and Face ID are a shortcut to the passcode

A passcode typed at every unlock invites a short one. Touch ID and Face ID reduce how often you type it. The sensor data is readable only by the enclave. For Touch ID, the fingerprint scan is encrypted with a session key negotiated between the sensor and the enclave, so the main processor carries data it cannot read. For Face ID, a part of the chip called the Secure Neural Engine turns the images and depth maps into a mathematical representation of the face, and the enclave compares it with the enrolled one.

A match does not produce your passcode, and it does not replace it. Apple describes what happens to the keys. With biometrics off, locking the device discards the keys for the highest protection class, and only the passcode can rebuild them. With biometrics on, those keys are kept but wrapped with a key that is handed to the biometric part of the enclave. A successful match releases that key and the device unlocks.

The wrapped keys live only in memory, so a restart loses them and the device asks for the passcode. Apple lists the other cases where a passcode is always required: the device has not been unlocked for more than 48 hours, the passcode has not been used for 156 hours (six and a half days) and biometrics have not unlocked the device in the last four hours, the device received a remote lock command, or there were five failed biometric matches. In Apple’s words, the biometric systems “don’t replace the user’s passcode or password”.

The enclave gives the app or website a yes or a no and nothing else. Apple writes that an app is notified only whether the authentication succeeded and cannot reach the biometric data. Your face is never part of a passkey and never leaves the device. It is the trigger that lets the enclave unwrap keys it could already unwrap with your passcode.

Apple’s 2017 guide puts the chance that a random person’s face unlocks your iPhone at about 1 in 1,000,000, against 1 in 50,000 for Touch ID, with five attempts allowed. The chance of at least one false match in n tries is 1 − (1 − p)n, which for small p is close to n × p. Five tries give about 5 / 50,000, or 1 in 10,000, for Touch ID and 5 / 1,000,000, or 1 in 200,000, for Face ID.

4-digit passcode, 10 guesses
1 in 1,000
Touch ID, 5 tries
1 in 10,000
6-digit passcode, 10 guesses
1 in 100,000
Face ID, 5 tries
1 in 200,000
Biometric matchPasscode guess
Figure 6. What a stranger holding your locked device is up against. Bar length follows the logarithm of the odds. The passcode rows assume a random passcode. These are my calculations from Apple’s single-attempt figures in the Face ID Security Guide and the 10-attempt limit in The Secure Enclave, and they are illustrative.

The chart shows why a passkey behind Face ID is hard for a stranger to use. It also shows the limit of that protection. By default every biometric row can be bypassed by the passcode row, because the passcode works in its place. Anyone who knows the passcode does not need the face. Part 4 covers the setting that changes this.

What has gone wrong, and what held

Thirteen years of public attacks on the enclave give some evidence about the key that stays. Of the reports below, the confirmed attacks need the device in hand, one is an unconfirmed claim of a remote attack, and none describes reading the UID.

2020

Pangu and the enclave’s boot code

At the end of July 2020, members of the Pangu team claimed a permanent vulnerability in the Secure Enclave of older chips. Macworld reported that they showed a bug in the memory controller that let them change the register setting which memory the enclave may use. The team said Apple cannot patch it on affected devices. Macworld wrote that it could lead to the key encryption being cracked, and labeled the exploit as alleged.

2025

A claimed remote chain

In June 2025 a researcher posted to the Full Disclosure mailing list what he described as a zero-click iMessage exploit chain on iOS 18 that ended in the theft of keys protected by the Secure Enclave. The post is the author’s own account, and I did not find independent confirmation of the enclave part. I include it because, if accurate, it would be a break that needs no physical access. It describes keys being misused through the operating system, which the secrecy of the UID does not prevent.

2026

usbliter8

In June 2026, researchers at Paradigm Shift published an exploit for the boot ROM, the read-only code a chip runs first, of the A12 and A13 chips, used in the iPhone XS, XR and 11. It runs code before iOS loads and cannot be fixed by a software update. The attacker needs the device, has to put it in firmware-update mode and connect special hardware. The researchers said the enclave is a separate boundary and is not directly compromised, and added that the exploit “opens up wider attack vectors to compromise the Secure Enclave”. SecurityWeek noted that such an exploit could be highly useful to forensics vendors.

2026

A Mac keychain that refuses to move

On September 8, 2026, the Mac administration blog Der Flounder reported that copying a login keychain file to another Mac no longer works on Macs with a Secure Enclave running macOS Tahoe. The file used to open anywhere with the right password. The author’s reading of Apple’s documentation is that the keys it unlocks are now tied to the enclave of the Mac that created it. If that reading is right, this is the staying key at work on a Mac.

In these reports the enclave kept its one key in, and the confirmed breaks needed physical possession. That record covers the UID. Your passkey is a different key with a different job, and it has to be able to leave.

Continue to Part 3: The key that travels