Reduce default Argon2 memory and thread settings (#3672)

* Fix #3550
* Default memory reduced to 64 MiB (from 128 MiB) and parallelism reduced to 2 threads. This allows for desktop and mobile device compatibility.
This commit is contained in:
Jonathan White 2019-10-26 14:55:26 -04:00 committed by Janek Bevendorff
parent 57a7720274
commit 744354c550

View File

@ -400,8 +400,10 @@ void DatabaseSettingsWidgetEncryption::updateFormatCompatibility(int index, bool
if (kdf->uuid() == KeePass2::KDF_ARGON2) {
auto argon2Kdf = kdf.staticCast<Argon2Kdf>();
argon2Kdf->setMemory(128 * 1024);
argon2Kdf->setParallelism(static_cast<quint32>(QThread::idealThreadCount()));
// Default to 64 MiB of memory and 2 threads
// these settings are safe for desktop and mobile devices
argon2Kdf->setMemory(1 << 16);
argon2Kdf->setParallelism(2);
}
activateChangeDecryptionTime();