iamMehedi / Secured-Preference-Store

A cryptography library and a SharedPreferences wrapper for Android that encrypts the content with 256 bit AES encryption. The Encryption key is securely stored in device's KeyStore.
563 stars 97 forks source link

KeyStoreException Signature/MAC verification failed #35

Open nicolasSchirmer opened 6 years ago

nicolasSchirmer commented 6 years ago

Error occurred on the version 0.6.1 due to EcryptionManager getMacKey throws exception.

W/System.err: javax.crypto.AEADBadTagException
W/System.err:  at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:517)
        at javax.crypto.Cipher.doFinal(Cipher.java:2056)
        at devliving.online.securedpreferencestore.EncryptionManager.decryptAES(EncryptionManager.java:428)
        at devliving.online.securedpreferencestore.EncryptionManager.decrypt(EncryptionManager.java:272)
        at devliving.online.securedpreferencestore.EncryptionManager.tryDecrypt(EncryptionManager.java:217)
        at devliving.online.securedpreferencestore.EncryptionManager.decrypt(EncryptionManager.java:316)
        at devliving.online.securedpreferencestore.SecuredPreferenceStore.getString(SecuredPreferenceStore.java:143)

 W/System.err: Caused by: android.security.KeyStoreException: Signature/MAC verification failed
        at android.security.KeyStore.getKeyStoreException(KeyStore.java:1112)
        at android.security.keystore.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:224)
        at android.security.keystore.AndroidKeyStoreAuthenticatedAESCipherSpi$BufferAllOutputUntilDoFinalStreamer.doFinal(AndroidKeyStoreAuthenticatedAESCipherSpi.java:373)
        at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:506)
        ... 22 more