Reduced iterationCount as 65536 iterations took way to long (4 - 5 seconds) on normal Androids

This commit is contained in:
dankito 2020-10-17 23:47:33 +02:00
parent 693977798a
commit 732ddd5b2b
1 changed files with 1 additions and 1 deletions

View File

@ -108,7 +108,7 @@ open class CryptographyManager {
protected open fun generatePbeSecretKey(userPassword: String, salt: ByteArray): SecretKey {
// Initialize PBE with password
val factory = SecretKeyFactory.getInstance(findBestPbeAlgorithm()!!)
val spec = PBEKeySpec(userPassword.toCharArray(), salt, 65536, 256)
val spec = PBEKeySpec(userPassword.toCharArray(), salt, 4096, 256)
val key = factory.generateSecret(spec)
return SecretKeySpec(key.encoded, "AES")