Added class for hashing, that is now used for password to key transformation

This commit is contained in:
Leonetienne
2022-05-22 00:23:10 +02:00
parent f3b6dc155c
commit 6dce12b6ee
4 changed files with 111 additions and 39 deletions

13
GCryptLib/src/Util.cpp Normal file
View File

@@ -0,0 +1,13 @@
#include "GCrypt/Util.h"
#include "GCrypt/Hasher.h"
namespace Leonetienne::GCrypt {
Block PasswordToKey(const std::string& in) {
// We already have a hashing algorithm, so why not use it
// Yeah, this won't work, because it would create an include loop. This method needs to be outsourced to a cpp file..
const Block hashedPassword = Hasher::CalculateHashsum(StringToBits(in));
return hashedPassword;
}
}