Skip to content
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

Bad Decrypt on Read after upgrading #24

Closed
pasotee opened this issue Sep 23, 2018 · 7 comments
Closed

Bad Decrypt on Read after upgrading #24

pasotee opened this issue Sep 23, 2018 · 7 comments

Comments

@pasotee
Copy link

pasotee commented Sep 23, 2018

HI there,
After upgrading from 3.1.1 to 3.1.2 I've encountered a strange error when I am trying to read data.
No implementation changed. I tried to uninstall the app, clear cache, cleared the data, but nothing worked.
Here are the logs:
Built build\app\outputs\apk\debug\app-debug.apk. E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(31075): Failed to handle method call E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(31075): java.lang.IllegalArgumentException: Unsupported value: javax.crypto.BadPaddingException: error:1e000065:Cipher functions:OPENSSL_internal:BAD_DECRYPT E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(31075): at io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:293) E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(31075): at io.flutter.plugin.common.StandardMethodCodec.encodeErrorEnvelope(StandardMethodCodec.java:70) E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(31075): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.error(MethodChannel.java:199) E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(31075): at com.it_nomads.fluttersecurestorage.FlutterSecureStoragePlugin.onMethodCall(FlutterSecureStoragePlugin.java:92) E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(31075): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:191) E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(31075): at io.flutter.view.FlutterNativeView.handlePlatformMessage(FlutterNativeView.java:163) E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(31075): at android.os.MessageQueue.nativePollOnce(Native Method) E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(31075): at android.os.MessageQueue.next(MessageQueue.java:379) E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(31075): at android.os.Looper.loop(Looper.java:144) E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(31075): at android.app.ActivityThread.main(ActivityThread.java:7425) E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(31075): at java.lang.reflect.Method.invoke(Native Method) E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(31075): at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245) E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(31075): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)

@mogol
Copy link
Owner

mogol commented Oct 5, 2018

Hi, sorry for later answer.

Have you tried to disable backup ?
#13 (comment)

@pasotee
Copy link
Author

pasotee commented Oct 24, 2018

Worked, thank you very much.

@mogol mogol closed this as completed Nov 21, 2018
@tom95
Copy link

tom95 commented Dec 1, 2018

Hey @mogol just coming from investigating the same issue. Maybe it could make sense to add the backup fix to the changelog or a prominent place in the README?
Thank you for the support and help!

@mogol
Copy link
Owner

mogol commented Dec 5, 2018

@tom95 , it fully makes sense, I updated README.
Thanks!

@ghost
Copy link

ghost commented Feb 7, 2019

@mogol Updated to 3.1.3 and set backup=false but facing the following exception for both 3.1.3 and 3.1.2 on two different devices

Launching lib\main.dart on SM G532G in debug mode...
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Note: D:\sdk\flutter\.pub-cache\hosted\pub.dartlang.org\connectivity-0.4.0+1\android\src\main\java\io\flutter\plugins\connectivity\ConnectivityPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\sdk\flutter\.pub-cache\hosted\pub.dartlang.org\esys_flutter_share-0.0.7\android\src\main\java\de\esys\esysfluttershare\EsysFlutterSharePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: D:\sdk\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_auth-0.6.6\android\src\main\java\io\flutter\plugins\firebaseauth\FirebaseAuthPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\sdk\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_auth-0.6.6\android\src\main\java\io\flutter\plugins\firebaseauth\FirebaseAuthPlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: D:\sdk\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.2.5+1\android\src\main\java\io\flutter\plugins\firebase\core\FirebaseCorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: D:\sdk\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_messaging-2.1.0\android\src\main\java\io\flutter\plugins\firebasemessaging\FlutterFirebaseInstanceIDService.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\sdk\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_webview_plugin-0.3.0+2\android\src\main\java\com\flutter_webview_plugin\WebviewManager.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: D:\sdk\flutter\.pub-cache\hosted\pub.dartlang.org\image_jpeg-1.1.1\android\src\main\java\com\yangyxd\imagejpeg\ImageJpegPlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Built build\app\outputs\apk\debug\app-debug.apk.
E/StorageCipher18Impl(25847): unwrap key failed
E/StorageCipher18Impl(25847): java.security.InvalidKeyException: Failed to unwrap key
E/StorageCipher18Impl(25847): 	at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineUnwrap(AndroidKeyStoreCipherSpiBase.java:618)
E/StorageCipher18Impl(25847): 	at javax.crypto.Cipher.unwrap(Cipher.java:1707)
E/StorageCipher18Impl(25847): 	at com.it_nomads.fluttersecurestorage.ciphers.RSACipher18Implementation.unwrap(RSACipher18Implementation.java:47)
E/StorageCipher18Impl(25847): 	at com.it_nomads.fluttersecurestorage.ciphers.StorageCipher18Implementation.<init>(StorageCipher18Implementation.java:44)
E/StorageCipher18Impl(25847): 	at com.it_nomads.fluttersecurestorage.FlutterSecureStoragePlugin.<init>(FlutterSecureStoragePlugin.java:46)
E/StorageCipher18Impl(25847): 	at com.it_nomads.fluttersecurestorage.FlutterSecureStoragePlugin.registerWith(FlutterSecureStoragePlugin.java:33)
E/StorageCipher18Impl(25847): 	at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(GeneratedPluginRegistrant.java:49)
E/StorageCipher18Impl(25847): 	at com.example.sketcherssuperadmin.MainActivity.onCreate(MainActivity.java:11)
E/StorageCipher18Impl(25847): 	at android.app.Activity.performCreate(Activity.java:6904)
E/StorageCipher18Impl(25847): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1136)
E/StorageCipher18Impl(25847): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3266)
E/StorageCipher18Impl(25847): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415)
E/StorageCipher18Impl(25847): 	at android.app.ActivityThread.access$1100(ActivityThread.java:229)
E/StorageCipher18Impl(25847): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)
E/StorageCipher18Impl(25847): 	at android.os.Handler.dispatchMessage(Handler.java:102)
E/StorageCipher18Impl(25847): 	at android.os.Looper.loop(Looper.java:148)
E/StorageCipher18Impl(25847): 	at android.app.ActivityThread.main(ActivityThread.java:7406)
E/StorageCipher18Impl(25847): 	at java.lang.reflect.Method.invoke(Native Method)
E/StorageCipher18Impl(25847): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
E/StorageCipher18Impl(25847): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
E/StorageCipher18Impl(25847): Caused by: javax.crypto.BadPaddingException
E/StorageCipher18Impl(25847): 	at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:482)
E/StorageCipher18Impl(25847): 	at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineUnwrap(AndroidKeyStoreCipherSpiBase.java:616)
E/StorageCipher18Impl(25847): 	... 19 more
E/StorageCipher18Impl(25847): Caused by: android.security.KeyStoreException: Invalid argument
E/StorageCipher18Impl(25847): 	at android.security.KeyStore.getKeyStoreException(KeyStore.java:945)
E/StorageCipher18Impl(25847): 	at android.security.keystore.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:224)
E/StorageCipher18Impl(25847): 	at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:473)
E/StorageCipher18Impl(25847): 	... 20 more
D/ViewRootImpl(25847): #1 mView = com.android.internal.policy.PhoneWindow$DecorView{941e3ea I.E...... R.....I. 0,0-0,0}
D/OpenGLRenderer(25847): Use EGL_SWAP_BEHAVIOR_PRESERVED: false
D/FirebaseApp(25847): Notifying auth state listeners.
D/FirebaseApp(25847): Notified 0 auth state listeners.
I/OpenGLRenderer(25847): Initialized EGL, version 1.4
D/Surface (25847): Surface::connect(this=0x9a8e2600,api=1)
D/mali_winsys(25847): new_window_surface returns 0x3000
D/Surface (25847): Surface::connect(this=0x9a8e2d00,api=1)
D/mali_winsys(25847): new_window_surface returns 0x3000
D/libGLESv1(25847): DTS_GLAPI : DTS is not allowed for Package : app.yazhiragu
I/[MALI][Gralloc](25847): [+]r_hnd(0xb437b420), client(61), share_fd(60)
D/GraphicBuffer(25847): register, handle(0xb437b420) (w:540 h:960 s:544 f:0x1 u:0x000b00)
D/ViewRootImpl(25847): MSG_RESIZED_REPORT: ci=Rect(0, 36 - 0, 0) vi=Rect(0, 36 - 0, 0) or=1
I/[MALI][Gralloc](25847): [+]r_hnd(0xb437b560), client(61), share_fd(63)
D/GraphicBuffer(25847): register, handle(0xb437b560) (w:540 h:960 s:544 f:0x1 u:0x000b00)
I/Timeline(25847): Timeline: Activity_idle id: android.os.BinderProxy@d6afc8c time:14548009
I/FA      (25847): Tag Manager is not found and thus will not be used
E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(25847): Failed to handle method call
E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(25847): java.lang.IllegalArgumentException: Unsupported value: javax.crypto.BadPaddingException: error:1e06b065:Cipher functions:EVP_DecryptFinal_ex:BAD_DECRYPT
E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(25847): 	at io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:293)
E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(25847): 	at io.flutter.plugin.common.StandardMethodCodec.encodeErrorEnvelope(StandardMethodCodec.java:70)
E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(25847): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.error(MethodChannel.java:208)
E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(25847): 	at com.it_nomads.fluttersecurestorage.FlutterSecureStoragePlugin.onMethodCall(FlutterSecureStoragePlugin.java:92)
E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(25847): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:200)
E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(25847): 	at io.flutter.view.FlutterNativeView.handlePlatformMessage(FlutterNativeView.java:163)
E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(25847): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(25847): 	at android.os.MessageQueue.next(MessageQueue.java:323)
E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(25847): 	at android.os.Looper.loop(Looper.java:135)
E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(25847): 	at android.app.ActivityThread.main(ActivityThread.java:7406)
E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(25847): 	at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(25847): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
E/MethodChannel#plugins.it_nomads.com/flutter_secure_storage(25847): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

@mogol
Copy link
Owner

mogol commented Feb 8, 2019

Hi @rajeshjeshar,
can you delete the app and install again? is the error still there?

@ghost
Copy link

ghost commented Feb 13, 2019

@mogol sorry for the late reply,i have tried but nothing solved the issue,and i'm reverting back to sharedpreferences without happy,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants