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

"Exception at.favre.lib.armadillo.AuthenticatedEncryptionException: could not decrypt" on some Android 14 devices #57

Open
emgallo-arch-sudo opened this issue Aug 2, 2024 · 1 comment

Comments

@emgallo-arch-sudo
Copy link

emgallo-arch-sudo commented Aug 2, 2024

Hello,
we are facing a weird issue with a mobile app for our client distributed on Google Play Store. At startup, the app initializes armadillo library v1.0.0 and use it to get some data from shared preferences.

On some devices, mainly on Samsung and Android 14, the app crashes instantly once started and it happens when it tries to read from shared preferences. Specifically in the stack trace we see:
Caused by at.favre.lib.armadillo.SecureSharedPreferenceCryptoException: at at.favre.lib.armadillo.SimpleRecoveryPolicy.handleBrokenContent (SimpleRecoveryPolicy.java:36) at at.favre.lib.armadillo.SecureSharedPreferences.decrypt (SecureSharedPreferences.java:550) at at.favre.lib.armadillo.SecureSharedPreferences.getString (SecureSharedPreferences.java:152)

From Google Play Console, we see the following stack trace that cause the exception above:
Caused by at.favre.lib.armadillo.EncryptionProtocolException: at.favre.lib.armadillo.AuthenticatedEncryptionException: could not decrypt at at.favre.lib.armadillo.DefaultEncryptionProtocol.decrypt (DefaultEncryptionProtocol.java:154) at at.favre.lib.armadillo.SecureSharedPreferences.decrypt (SecureSharedPreferences.java:548) Caused by at.favre.lib.armadillo.AuthenticatedEncryptionException: could not decrypt at at.favre.lib.armadillo.AesGcmEncryption.decrypt (AesGcmEncryption.java:111) at at.favre.lib.armadillo.DefaultEncryptionProtocol.decrypt (DefaultEncryptionProtocol.java:152) Caused by javax.crypto.AEADBadTagException: error:1e000065:Cipher functions:OPENSSL_internal:BAD_DECRYPT at java.lang.reflect.Constructor.newInstance0 at java.lang.reflect.Constructor.newInstance (Constructor.java:343) at com.android.org.conscrypt.OpenSSLAeadCipher.throwAEADBadTagExceptionIfAvailable (OpenSSLAeadCipher.java:320) at com.android.org.conscrypt.OpenSSLAeadCipher.doFinalInternal (OpenSSLAeadCipher.java:371) at com.android.org.conscrypt.OpenSSLCipher.engineDoFinal (OpenSSLCipher.java:374) at javax.crypto.Cipher.doFinal (Cipher.java:2114) at at.favre.lib.armadillo.AesGcmEncryption.decrypt (AesGcmEncryption.java:109)

Even uninstalling and re-installing the app does not solve the problem.

Any clue on this?

@emgallo-arch-sudo
Copy link
Author

@patrickfav any idea?

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

1 participant