Skip to content

Instantly share code, notes, and snippets.

@husaynhakeem
Last active September 13, 2020 03:23
Show Gist options
  • Save husaynhakeem/1ee42ca84aa41b40d4e0f45017d8d6e7 to your computer and use it in GitHub Desktop.
Save husaynhakeem/1ee42ca84aa41b40d4e0f45017d8d6e7 to your computer and use it in GitHub Desktop.
override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult) {
val cipher = result.cryptoObject?.cipher ?: return
val plainData = "Hello world!" // Whatever data you want to encrypt
val cipherData = cipher.doFinal(plainData.toByteArray(Charsets.UTF_8)) // Encrypted data
// Do something with the encrypted data
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment