Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan White <support@dmapps.us>2018-01-01 21:21:02 +0300
committerJonathan White <support@dmapps.us>2018-01-13 22:23:30 +0300
commit542ee42313f16d7f6522c746b0403da0369a4e99 (patch)
tree65a48e988dc872229b07d2090c2e22c75f0a6aa0 /src/format
parent9140893cd3e7658cd5ecda2fed4207fda6893f81 (diff)
Add Argon2Kdf and enable parameters in db settings
Note: This implementation is not yet connected to the database itself and will corrupt existing kdbx3 db's. * Implemented memory and parallelism parameters for Argon2Kdf * Using libargon2; libsodium does not support Argon2d algorithm * Moved basic rounds parameter into Kdf class * Reimplemented benchmark algorithm; previous was utterly broken
Diffstat (limited to 'src/format')
-rw-r--r--src/format/KeePass2.cpp8
-rw-r--r--src/format/KeePass2.h1
2 files changed, 7 insertions, 2 deletions
diff --git a/src/format/KeePass2.cpp b/src/format/KeePass2.cpp
index 61bd383df..fd57148d0 100644
--- a/src/format/KeePass2.cpp
+++ b/src/format/KeePass2.cpp
@@ -16,15 +16,16 @@
*/
#include "KeePass2.h"
-#include "crypto/kdf/AesKdf.h"
#include <QSharedPointer>
-
+#include "crypto/kdf/AesKdf.h"
+#include "crypto/kdf/Argon2Kdf.h"
const Uuid KeePass2::CIPHER_AES = Uuid(QByteArray::fromHex("31c1f2e6bf714350be5805216afc5aff"));
const Uuid KeePass2::CIPHER_TWOFISH = Uuid(QByteArray::fromHex("ad68f29f576f4bb9a36ad47af965346c"));
const Uuid KeePass2::CIPHER_CHACHA20 = Uuid(QByteArray::fromHex("D6038A2B8B6F4CB5A524339A31DBB59A"));
const Uuid KeePass2::KDF_AES = Uuid(QByteArray::fromHex("C9D9F39A628A4460BF740D08C18A4FEA"));
+const Uuid KeePass2::KDF_ARGON2 = Uuid(QByteArray::fromHex("EF636DDF8C29444B91F7A9A403E30A0C"));
const QByteArray KeePass2::INNER_STREAM_SALSA20_IV("\xE8\x30\x09\x4B\x97\x20\x5D\x2A");
@@ -35,12 +36,15 @@ const QList<QPair<Uuid, QString>> KeePass2::CIPHERS {
};
const QList<QPair<Uuid, QString>> KeePass2::KDFS {
qMakePair(KeePass2::KDF_AES, QObject::tr("AES-KDF")),
+ qMakePair(KeePass2::KDF_ARGON2, QObject::tr("Argon2")),
};
QSharedPointer<Kdf> KeePass2::uuidToKdf(const Uuid& uuid)
{
if (uuid == KDF_AES) {
return QSharedPointer<AesKdf>::create();
+ } else if (uuid == KDF_ARGON2) {
+ return QSharedPointer<Argon2Kdf>::create();
}
Q_ASSERT_X(false, "uuidToKdf", "Invalid UUID");
diff --git a/src/format/KeePass2.h b/src/format/KeePass2.h
index c7945e907..99bc5a0b0 100644
--- a/src/format/KeePass2.h
+++ b/src/format/KeePass2.h
@@ -40,6 +40,7 @@ namespace KeePass2
extern const Uuid CIPHER_CHACHA20;
extern const Uuid KDF_AES;
+ extern const Uuid KDF_ARGON2;
extern const QByteArray INNER_STREAM_SALSA20_IV;