-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decryption Error - Invalid or corrupted pad block #24
Comments
Unfortunately, it's not isolated to emulators or Google Play APIs. |
hey sorry to hear that! I've seen that when the encryption key from secure storage doesn't match the encryption key that was used to save the data. That was just an issue I saw so far on MacOS because secure storage requires a permission outlined here: https://github.com/danReynolds/loon/blob/main/docs/debug.md. That wouldn't be relevant for you on Android obviously though so I'll try and do some encrypted Android testing later today and see if I can repro. if you uninstall the app and reinstall fresh is it fixed? I'm wondering if maybe a similar issue is happening on Android where secure storage isn't finding a key on next startup. You can debug that here: https://github.com/danReynolds/loon/blob/main/lib/persistor/data_store_encrypter.dart#L28 to check if after encrypting data, on next start it got the same key. |
Thanks for the insights Dan and taking a look!
What's weird is this didn't happen until all of a sudden, it started
happening every time.
No, clean install, wiping the emulator, it's still reproducible.
Knowing you're using secure storage, that reminds me of an issue I've run
into before.
Secure storage and shared preferences will backup the key to Google's cloud
for the user. The key is then restored on app installation. So if the key
is saved and restored, it will often be invalid.
I've turned off backup though so I'm not sure if that applies here.
…On Fri, 15 Nov 2024, 3:02 pm Dan Reynolds, ***@***.***> wrote:
hey sorry to hear that! I've seen that when the encryption key from secure
storage doesn't match the encryption key that was used to save the data.
That was just an issue I saw so far on MacOS because secure storage
requires a permission outlined here:
https://github.com/danReynolds/loon/blob/main/docs/debug.md. That
wouldn't be relevant for you on Android obviously though so I'll try and do
some encrypted Android testing later today and see if I can repro.
if you uninstall the app and reinstall fresh is it fixed? I'm wondering if
maybe a similar issue is happening on Android where secure storage isn't
finding a key on next startup. You can debug that here:
https://github.com/danReynolds/loon/blob/main/lib/persistor/data_store_encrypter.dart#L28
to check if after encrypting data, on next start it got the same key.
—
Reply to this email directly, view it on GitHub
<#24 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEXZO3SXSKGF3V57J4LFPJD2AZOO3AVCNFSM6AAAAABR3VNIY2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZZHEYTONZQG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Tried to repro this over the weekend on Android, no luck so far. I see that Flutter secure storage has two options for storing the encryption key on Android. Have you tried the When you get time to debug, if you could see if the encryption key is not being found on startup here: https://github.com/danReynolds/loon/blob/main/lib/persistor/data_store_encrypter.dart#L28 then that would be a great help. We could narrow down whether it's a flutter_secure_storage issue or some bug in Loon. |
This is super valuable thanks! I'll take a look soon and make a fix/recommendation. Happy holidays! |
Have you seen this error before?
It started appearing all of a sudden and now doesn't go away. Locks the app.
Clearing app storage works the first time but on app restart, it appears again.
The text was updated successfully, but these errors were encountered: