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
This commit is contained in:
Jonathan White 2018-01-01 13:21:02 -05:00
parent 9140893cd3
commit 542ee42313
No known key found for this signature in database
GPG key ID: 440FC65F2E0C6E01
18 changed files with 468 additions and 170 deletions

View file

@ -45,7 +45,7 @@ Database::Database()
m_data.cipher = KeePass2::CIPHER_AES;
m_data.compressionAlgo = CompressionGZip;
m_data.kdf = QSharedPointer<AesKdf>::create();
m_data.kdf->randomizeTransformSalt();
m_data.kdf->randomizeSeed();
m_data.hasKey = false;
setRootGroup(new Group());
@ -258,7 +258,7 @@ void Database::setCompressionAlgo(Database::CompressionAlgorithm algo)
bool Database::setKey(const CompositeKey& key, bool updateChangedTime, bool updateTransformSalt)
{
if (updateTransformSalt) {
m_data.kdf->randomizeTransformSalt();
m_data.kdf->randomizeSeed();
}
QByteArray transformedMasterKey;
@ -490,7 +490,7 @@ void Database::setKdf(QSharedPointer<Kdf> kdf)
bool Database::changeKdf(QSharedPointer<Kdf> kdf)
{
kdf->randomizeTransformSalt();
kdf->randomizeSeed();
QByteArray transformedMasterKey;
if (!m_data.key.transform(*kdf, transformedMasterKey)) {
return false;