flutter_secure_storage
flutter_secure_storage copied to clipboard
v7.0.1 PlatformException(Exception encountered, readAll, java.lang.SecurityException: Could not decrypt key. decryption failed
Hello, I think the option encryptedSharedPreferences: true works for read but not readAll. I can read value by specific key but cannot retrieve all values.
Errors thrown on some devices Android version 11, 12, 13.
Non-fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: PlatformException(Exception encountered, readAll, java.lang.SecurityException: Could not decrypt key. decryption failed
at androidx.security.crypto.EncryptedSharedPreferences.decryptKey(EncryptedSharedPreferences.java:7)
at androidx.security.crypto.EncryptedSharedPreferences.getAll(EncryptedSharedPreferences.java:4)
at p9.a.l(FlutterSecureStorage.java:2)
at p9.e$b.run(FlutterSecureStoragePlugin.java:13)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: java.security.GeneralSecurityException: decryption failed
at o4.c$a.b(DeterministicAeadWrapper.java:15)
at androidx.security.crypto.EncryptedSharedPreferences.decryptKey(EncryptedSharedPreferences.java:4)
... 8 more
, null). Error thrown depricated2.exportAll error
error:PlatformException(Exception encountered, readAll, java.lang.SecurityException: Could not decrypt key. decryption failed
at androidx.security.crypto.EncryptedSharedPreferences.decryptKey(EncryptedSharedPreferences.java:7)
at androidx.security.crypto.EncryptedSharedPreferences.getAll(EncryptedSharedPreferences.java:4)
at p9.a.l(FlutterSecureStorage.java:2)
at p9.e$b.run(FlutterSecureStoragePlugin.java:13)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: java.security.GeneralSecurityException: decryption failed
at o4.c$a.b(DeterministicAeadWrapper.java:15)
at androidx.security.crypto.EncryptedSharedPreferences.decryptKey(EncryptedSharedPreferences.java:4)
... 8 more
, null).
Yes, same error for me with EncryptedSharedPreferences .getAll.
Hi, any update on this?
@meomap did you find a workaround?
@tijee We've already migrated from this lib. It's too painful when you have a large user base. 😓 If I remember correctly, instead of readAll, we use read on all keys that we've already indexed elsewhere.
Just to confirm: so we should not enable encryptedSharedPreferences: true when using readAll()?
(I am using readAll as a workaround for the cannot find key issue that popped up 5 days ago that is still open, and now this new error came up under our Android 14 users)
I am closing all older issues. If this issue still exists in the latest version, please let me know.