MobDojoStart learning free

iOS Internals · Locks & Encryption · Lesson 3 of 5

Face ID & Touch ID

How your face or fingerprint unlocks the phone, and when only the passcode will do.

12 min70 XPLab in Pro

How your face becomes a key

Face ID and Touch ID are biometric unlocks, which means they check something about your body instead of something you type.

Face ID uses the TrueDepth camera at the top of the screen. It projects thousands of invisible dots onto your face to build a depth map, and it captures an infrared image. That's why it works in the dark and why a flat photo of you doesn't fool it. Touch ID uses a sensor under a sapphire crystal button. It captures detailed images of small sections of your fingerprint.

Neither one keeps a picture of you. The data is turned into a mathematical representation, a set of numbers that describes your features, and that's compared with the one saved when you set it up. Face ID also adapts slowly over time, so makeup or a new beard doesn't lock you out.

The important part is where this happens. You met the Secure Enclave in module 1. Face and fingerprint data is protected with a key only the Secure Enclave can use, and the matching happens there. Apple says this data:

So when a banking app offers "Sign in with Face ID", the app never sees your face. It asks the system to check, and it gets back only a yes or no.

How safe is it? Apple puts the chance that a random person could unlock your iPhone with their face at less than 1 in 1,000,000. For a random fingerprint matching Touch ID, it's about 1 in 50,000. Apple notes the odds are higher for twins and siblings who look like you, and for children under 13, whose features are still developing. If you have a lookalike sibling, a passcode is the safer choice.

When only the passcode will do

Face ID and Touch ID are a shortcut to your passcode, not a replacement for it. The passcode is what actually rebuilds the keys that protect your data, so the iPhone falls back to it whenever it wants to be extra sure it's really you.

Apple lists these cases where Face ID needs your passcode first:

Touch ID has a similar list, including after a restart, after 48 hours, and after five failed matches in a row. You also need the passcode to add or remove a face or fingerprint, so nobody can quietly enroll their own.

That last button trick is worth remembering. If you ever feel someone might force your phone up to your face, holding the side button and a volume button for 2 seconds brings up the power off screen. You can then cancel, and Face ID won't work until the passcode is entered.

There's one more protection called Require Attention for Face ID. With it on, Face ID unlocks only when your eyes are open and looking at the phone. That makes it much harder for someone to unlock your phone while you're asleep. It's on by default. People who find it hard to look directly at the screen can turn it off in Settings, Accessibility, Face ID & Attention, though that makes Face ID a little less secure.

Test yourself

Can you answer these?

  1. Your bank's app lets you log in with Face ID. What does the bank's app actually receive when you look at the phone?
  2. You last unlocked your iPhone on Monday morning, then left it in a drawer. On Wednesday evening Face ID won't open it. In one word, what does the phone want instead?

Answer them in the app to earn 70 XP (Pro).

Answer in the app