Issue while using Android fingerprint: IV required when decrypting. Use IvParameterSpec or AlgorithmParameters to provide it

后端 未结 3 854
春和景丽
春和景丽 2021-02-04 04:38

I\'m following the ConfirmCredential Android example provided by Google, but it only shows how to encrypt the data. When I try to decrypt it I get exception:

ja         


        
3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-04 05:38

    How about this,

    mCipher.init(Cipher.DECRYPT_MODE, key, mCipher.getParameters());

    If you use the sample code from Google repo, above line will work, also note, for every mChiper.init we need to authenticate with fingerprint once, that means two fingerprint auth is required, one for encryption and one for decryption.

    https://github.com/googlesamples/android-FingerprintDialog

提交回复
热议问题