Okay, let's break down how passkeys are stored securely on devices, even those without a dedicated TPM (Trusted Platform Module) chip, which is common on many PCs and some other hardware.
The core principle of passkey security is protecting the private key. The passkey consists of a public/private key pair. The public key is shared with the website/service, while the private key must remain securely on the user's device.
Here’s how this protection is achieved without relying solely on a traditional TPM:
-
Operating System Security Features: Modern operating systems (iOS, macOS, Android, Windows) have built-in mechanisms designed to protect sensitive data like cryptographic keys.
- Apple (iOS/macOS): Uses the Keychain. While iPhones and iPads have the Secure Enclave (a hardware security feature that acts similarly to a TPM), the Keychain service manages access to sensitive data. Keys stored in the Keychain can be protected by:
- Hardware Security: If a Secure Enclave is present, keys can be generated and stored within it, isolated from the main OS. Operations involving the key happen inside the Secure Enclave.
- User Authentication: Keys can be protected by the device's passcode and/or biometric data (Face ID, Touch ID). Accessing the key requires the user to authenticate via these methods. The key itself is often encrypted using a key derived from these credentials.
- Android: Uses the Android Keystore system. This system leverages hardware-backed security modules when available (like ARM TrustZone or dedicated Trusted Execution Environments - TEEs). Similar to Apple's Secure Enclave, these create an isolated environment for cryptographic operations. If such hardware isn't available or supported, the Keystore still provides significant protection by:
- Encryption: Encrypting the private key using keys derived from the user's screen lock (PIN, pattern, password) and device hardware identifiers.
- Access Control: Requiring user authentication (biometrics, screen lock) before the key can be used.
- Windows: Windows utilizes features like the Credential Locker and integrates with hardware security if available (TPM 2.0, Pluton processors, or even Windows Hello hardware). Without a TPM, Windows relies on:
- Encryption: Protecting the stored private key material using encryption tied to user credentials and the specific device state.
- Protected Processes: Running critical security operations within protected memory regions to shield them from malware.
- User Authentication: Relying on Windows Hello (PIN, fingerprint, facial recognition) or account passwords, often secured via OS mechanisms, to authorize key access.
-
Encryption: Regardless of the specific OS mechanism, the private key stored on the device is almost always encrypted at rest. The key used to encrypt the private key is itself protected, typically derived from or protected by the user's primary authentication method (passcode, PIN, biometrics).
-
User Authentication Binding: The security model relies heavily on binding the private key's usability to successful user authentication at the time of use. When you use a passkey, the OS prompts you for your fingerprint, face scan, or PIN/password. This authentication unlocks the necessary key material, allowing the passkey signing process to occur securely.
-
FIDO Standards: The underlying FIDO (Fast Identity Online) standards (like WebAuthn) are designed to be flexible. They specify what needs to be secured (the private key) and the cryptographic protocols, but they allow the platform (OS and hardware) to implement the secure storage and key management in the best way possible for that specific device. The standard mandates strong security but doesn't dictate only TPMs.
In essence:
While a TPM provides a dedicated, tamper-resistant hardware security module, devices without one rely on a combination of:
- Operating System's Secure Storage: Mechanisms like Keychain and Keystore.
- Hardware-Backed Security (often present even without a TPM): Features like ARM TrustZone or Apple's Secure Enclave provide isolated execution environments.
- Strong Encryption: Protecting the stored private key material.
- User Authentication: Using biometrics or device passcodes/PINs as the gatekeeper to access the encrypted key material when the passkey is needed.
This multi-layered approach aims to prevent unauthorized access to the private key, even if the main operating system or storage is compromised by software attacks. However, the robustness against sophisticated physical attacks might be lower compared to devices with dedicated, certified tamper-resistant hardware like a TPM 2.0 module.