Working with Biometric Authentication

1. Understanding Biometric Factors

FactorFAR (typical)FRR
Fingerprint1 in 50,000~2%
Face (3D)1 in 1,000,000~1%
Iris1 in 1,500,000~0.1%
Voice1 in 10,000~5%
BehavioralContinuous, probabilistic

2. Implementing Touch ID

Example: iOS LAContext

let ctx = LAContext()
var err: NSError?
if ctx.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &err) {
  ctx.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics,
    localizedReason: "Sign in to Acme") { success, error in
      if success { /* unlock keychain item with biometric ACL */ }
  }
}

3. Implementing Face ID

RequirementDetail
Info.plistNSFaceIDUsageDescription required
FallbackDevice passcode prompt
PolicydeviceOwnerAuthenticationWithBiometrics
StorageItem with .biometryCurrentSet ACL — invalidates on enrollment change

4. Using Windows Hello

APIUse
Web AuthenticationPlatform authenticator via WebAuthn
UserConsentVerifierWinRT API for native apps
WindowsHelloForBusinessEnterprise, AAD-backed

5. Implementing Android Biometric API

Example: BiometricPrompt

val prompt = BiometricPrompt(activity, executor,
  object : BiometricPrompt.AuthenticationCallback() {
    override fun onAuthenticationSucceeded(r: AuthenticationResult) {
      val cipher = r.cryptoObject?.cipher
      // Use cipher to decrypt key-bound secret
    }
})
val info = BiometricPrompt.PromptInfo.Builder()
  .setTitle("Sign in to Acme")
  .setAllowedAuthenticators(BIOMETRIC_STRONG)
  .build()
prompt.authenticate(info, BiometricPrompt.CryptoObject(cipher))

6. Using WebAuthn for Biometrics

AspectDetail
Authenticator typeplatform (built-in)
User verificationrequired (forces biometric/PIN)
Key storageSecure Enclave / StrongBox / TPM
Server checkflags.uv === true in authenticator data

7. Handling Biometric Enrollment

StepDetail
TriggerAfter initial password/MFA login
Check capabilityOS API reports biometric available + enrolled
Generate keyHardware-backed, biometric ACL
Send public keyBind to server account
ConfirmTest signature → store enrollment

8. Implementing Fallback Authentication

TriggerFallback
Biometric failure (3x)Device PIN
Biometric unavailablePassword + OTP
Enrollment changedRe-enroll with password
LockoutAccount recovery flow

9. Understanding Biometric Security Risks

RiskMitigation
Spoofing (silicone fingerprint, photo)Liveness detection
Template theftNever store raw biometric — derived templates only
CoercionDuress mode, panic codes
IrrevocableBind to cancelable device key, not raw biometric
Cross-context trackingPer-RP unique credentials (WebAuthn)

10. Implementing Liveness Detection

MethodDetail
ActiveUser performs action (blink, smile, turn)
PassiveTexture/3D depth analysis (Face ID dot projector)
Challenge–responseRandom head movement
StandardISO/IEC 30107 (PAD — Presentation Attack Detection)

11. Storing Biometric Templates Securely

PrincipleImplementation
On-device onlyNever transmit template to server
Secure hardwareSecure Enclave / TEE / StrongBox
Template protectionISO/IEC 24745: cancelable, irreversible
Per-purposeSeparate templates per app (no cross-linking)

12. Implementing Behavioral Biometrics

SignalUse
Keystroke dynamicsTyping rhythm, dwell, flight times
Mouse movementVelocity, acceleration, curvature
Touch pressurePressure, area, swipe angle
GaitAccelerometer / gyro pattern
Continuous authScore drift → re-challenge