Secure Key Storage on Mobile Devices

Hardware-Protected Secrets

Modern smartphones contain dedicated security hardware specifically designed to protect cryptographic keys. Apple's Secure Enclave and Android's StrongBox (backed by Titan or equivalent chips) provide isolated execution environments where private keys are generated, stored, and used without ever being exposed to the main operating system. Even if malware gains full root access to your phone, it physically cannot extract keys from the security hardware.

iOS Keychain encrypts stored credentials using a class key hierarchy rooted in the device's unique hardware UID, which is fused into silicon during manufacturing and cannot be read by any software. Keychain items can be bound to biometric authentication (Face ID / Touch ID), meaning the decryption key for a specific credential is only released when the Secure Enclave confirms a valid biometric match. The biometric template itself never leaves the Secure Enclave and is never sent to Apple.

Android Keystore provides similar guarantees through the Hardware Abstraction Layer (HAL). Keys generated with the 'setIsStrongBoxBacked' flag are created inside a certified tamper-resistant hardware module. The Keystore supports key attestation, where the hardware produces a cryptographic certificate chain proving that a key was genuinely generated inside the secure hardware of a specific device model, preventing key forgery even by sophisticated state-level attackers.

Everyday Example

Your phone is like a house with multiple rooms. Normal apps live in the main rooms and can be broken into by a skilled burglar. But your most important secrets are locked inside a separate, windowless bunker buried under the foundation with its own independent power supply. Even if the burglar burns the entire house down, the bunker remains perfectly sealed. Your fingerprint is the only way to open the bunker door, and the fingerprint scanner is built into the bunker itself, not the house.

The Deep Mathematics

The iOS key hierarchy derives class keys from the device UID and user passcode: ClassKey = KDF(UID || Passcode). File keys are wrapped via AES key-wrapping: WrappedFileKey = AES-Wrap(ClassKey, FileKey). Hardware-bound keys satisfy the property that Extract(SecureEnclave, sk) is computationally infeasible due to physical tamper-detection meshes that trigger key zeroization upon voltage or frequency anomalies. Key attestation chains follow X.509 certificate verification: Verify(Google_Root_PK, Sign(IntermediatePK, Sign(DevicePK, KeyDescription))).

Discover how giovium protects your data

giovium leverages these very cryptographic principles to keep your passwords, files, and secrets completely safe. Try it for free on any platform.

Download giovium