Comments (6)
I can also confirm this issue on a Huawei P10 Lite running Android 7.0. Solution provided by @StuStirling on #15 (or just commenting EncryptionManager line 494 .setKeyValidityStart(start.getTime())) solved this problem.
Log extract (running version 0.5.1) :
java.security.InvalidKeyException: Keystore operation failed
at android.security.KeyStore.getInvalidKeyException(KeyStore.java:733)
at android.security.KeyStore.getInvalidKeyException(KeyStore.java:754)
at android.security.keystore.KeyStoreCryptoOperationUtils.getInvalidKeyExceptionForInit(KeyStoreCryptoOperationUtils.java:54)
at android.security.keystore.KeyStoreCryptoOperationUtils.getExceptionForCipherInit(KeyStoreCryptoOperationUtils.java:89)
at android.security.keystore.AndroidKeyStoreCipherSpiBase.ensureKeystoreOperationInitialized(AndroidKeyStoreCipherSpiBase.java:265)
at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineInit(AndroidKeyStoreCipherSpiBase.java:148)
at javax.crypto.Cipher.tryTransformWithProvider(Cipher.java:2973)
at javax.crypto.Cipher.tryCombinations(Cipher.java:2884)
at javax.crypto.Cipher$SpiAndProviderUpdater.updateAndGetSpiAndProvider(Cipher.java:2789)
at javax.crypto.Cipher.chooseProvider(Cipher.java:956)
at javax.crypto.Cipher.init(Cipher.java:1329)
at javax.crypto.Cipher.init(Cipher.java:1267)
at devliving.online.securedpreferencestore.EncryptionManager.encryptAES(EncryptionManager.java:398)
at devliving.online.securedpreferencestore.EncryptionManager.encrypt(EncryptionManager.java:242)
at devliving.online.securedpreferencestore.EncryptionManager.tryEncrypt(EncryptionManager.java:175)
at devliving.online.securedpreferencestore.EncryptionManager.encrypt(EncryptionManager.java:287)
at devliving.online.securedpreferencestore.SecuredPreferenceStore$Editor.putString(SecuredPreferenceStore.java:232)
at devliving.online.securedpreferencestoresample.MainActivity.saveData(MainActivity.java:110)
at devliving.online.securedpreferencestoresample.MainActivity$2.onClick(MainActivity.java:65)
at android.view.View.performClick(View.java:5647)
at android.view.View$PerformClick.run(View.java:22479)
at android.os.Handler.handleCallback(Handler.java:761)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6595)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)
Caused by: android.security.KeyStoreException: -65535
at android.security.KeyStore.getKeyStoreException(KeyStore.java:672)
... 27 more
from secured-preference-store.
Thanks for reporting. Did this happen randomly or after you changed PIN/Password/Fingerprint? or does this happen every time you try to use the lib? @estebanlamas
from secured-preference-store.
It happens every time I try to use the lib.
Thanks for the quick answer.
from secured-preference-store.
we also encounter the same. Do we have updates on this? Please advise.
Many Thanks
from secured-preference-store.
We are also facing same problem. Can somebody help here?
from secured-preference-store.
@iamMehedi Can you help here?
from secured-preference-store.
Related Issues (20)
- Some help would be appreciated HOT 1
- Add ability to seed SecureRandom
- App Crashed in lollipop OS version with error "java.lang.IllegalStateException: Must call init() before using the store" HOT 2
- RSA Key Generation failed with "IllegalArgumentException: startDate == null" HOT 1
- Failed to init Secured Preference Store. Exception: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String HOT 4
- Cannot connect to keystore HOT 1
- KeyStoreException Signature/MAC verification failed
- java.lang.NoClassDefFoundError: devliving.online.securedpreferencestore.Logger on Android APi 19 HOT 1
- Cipher not initialized issue sometimes(Once if i run the test case 10 times). HOT 1
- KeyStore exception in log on Android 9 device HOT 6
- llegalStateException: Must call init() before using the store HOT 4
- Should seedKey be stored securely? HOT 1
- AndroidManifest contains application label HOT 2
- [Question] - Sharing among multiple apps HOT 3
- Getting encrypted value when using OnSharedPreferenceChangeListener HOT 2
- AES only supported by Android API 23+
- anr when generateAESKey and call mStore.containsAlias(AES_KEY_ALIAS)
- Very long strings are not stored
- "Key not yet valid" on device HOT 1
- Alternative to this library? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from secured-preference-store.