Biometric authentication such as fingerprint recognition can be used alongside cryptographic keys stored in the Android KeyStore to protect sensitive parts of the application. However, when a key generated for this purpose has certain parameters set insecurely, it can allow an attacker with physical access to bypass the authentication check, using application hooking tools such as Frida.

When generating a key for use with biometric authentication, ensure that the following parameters of KeyGenParameterSpec.Builder are set:

The following example demonstrates a key that is configured with secure paramaters:

  • WithSecure: How Secure is your Android Keystore Authentication?
  • Android Developers: KeyGenParameterSpec.Builder