patrickfav / armadillo

A shared preference implementation for confidential data in Android. Per default uses AES-GCM, BCrypt and HKDF as cryptographic primitives. Uses the concept of device fingerprinting combined with optional user provided passwords and strong password hashes.
https://favr.dev/opensource/armadillo
Apache License 2.0
280 stars 52 forks source link

EncryptionProtocolException: at.favre.lib.armadillo.AuthenticatedEncryptionException: could not encrypt #48

Closed bhautik-mworldwebtech closed 4 years ago

bhautik-mworldwebtech commented 4 years ago

SharedPreferences preferences = Armadillo.create(context, prefName) .password(Keys.UserProvidedPassword.toCharArray()) //use user provided password .securityProvider(Security.getProvider("BC")) //use bouncy-castle security provider .keyStretchingFunction(new PBKDF2KeyStretcher()) //use PBKDF2 as user password kdf .contentKeyDigest(Bytes.from(getUniqueDeviceId(context)).array()) //use custom content key digest salt .secureRandom(new SecureRandom()) //provide your own secure random for salt/iv generation .encryptionFingerprint(context, (Keys.EncryptionFingerprint).getBytes(StandardCharsets.UTF_8)) //add the user id to fingerprint .supportVerifyPassword(true) //enables optional password validation support .isValidPassword() .enableDerivedPasswordCache(true) //enable caching for derived password making consecutive getters faster .build();

patrickfav commented 4 years ago

Please provide more info. Full stack trace, exact usage.

patrickfav commented 4 years ago

Since there was no response.