From 744354c5508181f267fbb0ff4cc847a9fc42b677 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Sat, 26 Oct 2019 14:55:26 -0400 Subject: [PATCH] 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. --- src/gui/dbsettings/DatabaseSettingsWidgetEncryption.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/dbsettings/DatabaseSettingsWidgetEncryption.cpp b/src/gui/dbsettings/DatabaseSettingsWidgetEncryption.cpp index e5bd08a1..e2a8cdaf 100644 --- a/src/gui/dbsettings/DatabaseSettingsWidgetEncryption.cpp +++ b/src/gui/dbsettings/DatabaseSettingsWidgetEncryption.cpp @@ -400,8 +400,10 @@ void DatabaseSettingsWidgetEncryption::updateFormatCompatibility(int index, bool if (kdf->uuid() == KeePass2::KDF_ARGON2) { auto argon2Kdf = kdf.staticCast(); - argon2Kdf->setMemory(128 * 1024); - argon2Kdf->setParallelism(static_cast(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();