Mobile App Secrets: Plain-Text Token vs PIN-Derived Key vs Hardware Keystore, PIN Entropy and KDF Brute-Force Time
A stolen phone gives an attacker a full copy of the app's flash storage. Watch the same API token stored three ways while a GPU rig guesses on a logarithmic clock from one millisecond to hundreds of billions of years: as a plain-text file (read at once), under an AES key derived from your passcode with real PBKDF2-HMAC-SHA256, and sealed in a hardware keystore whose key never leaves the secure element and whose PIN check is throttled and wipes after a few wrong tries. Set the alphabet, passcode length, KDF iterations, attacker speed, lock-out time and wipe limit, and read entropy, expected guesses and crack time. The SHA-256, HMAC and PBKDF2 code is checked against FIPS and RFC test vectors, and a real brute force recovers a toy PIN. A Blender-built scene; educational model, not security advice.
Pick how a mobile app stores a sensitive token locally — as plain text in ordinary app storage, or encrypted through a hardware-backed secure keystore — then simulate an attacker who has gained full filesystem access to the device (a rooted phone, a jailbreak, or a stolen backup) and watch what they can actually recover. Plain-text storage hands over the token immediately; the keystore path leaves them holding only unusable encrypted bytes, because the decryption key itself never leaves the isolated secure hardware.
A stolen phone gives an attacker a full copy of the app's flash storage. Watch the same API token stored three ways while a GPU rig guesses on a logarithmic clock from one millisecond to hundreds of billions of years: as a plain-text file (read at once), under an AES key derived from your passcode with real PBKDF2-HMAC-SHA256, and sealed in a hardware keystore whose key never leaves the secure element and whose PIN check is throttled and wipes after a few wrong tries. Set the alphabet, passcode length, KDF iterations, attacker speed, lock-out time and wipe limit, and read entropy, expected guesses and crack time. The SHA-256, HMAC and PBKDF2 code is checked against FIPS and RFC test vectors, and a real brute force recovers a toy PIN. A Blender-built scene; educational model, not security advice.
3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install