title: AEADBadTagException on cipher.doFinal
body: <p>I integrated Biometrics authentication follow this guideline (<a href="https://developer.android.com/codelabs/biometric-login#2" rel="nofollow noreferrer">https://developer.android.com/codelabs/biometric-login#2</a>). The issue is I got this error</p>
  <pre><code>java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:502)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
       Caused by: java.lang.reflect.InvocationTargetException
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) 
       Caused by: javax.crypto.AEADBadTagException
          at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:517)
          at javax.crypto.Cipher.doFinal(Cipher.java:2055)
          at com.myApp.myAppName.service.CryptographyManagerImpl.decryptData(CryptographyManager.kt:89)
  </code></pre>
  <p>The CryptographyManager line 89 is</p>
  <pre><code>override fun decryptData(ciphertext: ByteArray, cipher: Cipher): String {
          val plaintext = cipher.doFinal(ciphertext)
          return String(plaintext, Charset.forName(&quot;UTF-8&quot;))
      }
  </code></pre>
  <p>The way I encrypt the data is</p>
  <pre><code> override fun encryptData(plaintext: String, cipher: Cipher): CiphertextWrapper {
          val ciphertext = cipher.doFinal(plaintext.toByteArray(Charset.forName(&quot;UTF-8&quot;)))
          return CiphertextWrapper(ciphertext, cipher.iv)
      }
  </code></pre>
  <p>The <code>Cipher</code> is initialized like this</p>
  <pre><code>private val ENCRYPTION_BLOCK_MODE = KeyProperties.BLOCK_MODE_GCM
  private val ENCRYPTION_PADDING = KeyProperties.ENCRYPTION_PADDING_NONE
  private val ENCRYPTION_ALGORITHM = KeyProperties.KEY_ALGORITHM_AES
  
  private fun getCipher(): Cipher {
         val transformation = &quot;$ENCRYPTION_ALGORITHM/$ENCRYPTION_BLOCK_MODE/$ENCRYPTION_PADDING&quot;
         return Cipher.getInstance(transformation)
     }
  </code></pre>
  <p>How do I fix this issue?</p>