Almost completed registration

* added missing bits of serverside code;
 * added fronted in client;
 * removed demo python scripts;
This commit is contained in:
Fabio Bas 2015-05-23 20:13:03 +02:00
parent 735fcbf311
commit 5ace0dd892
20 changed files with 585 additions and 112 deletions

View file

@ -8,6 +8,8 @@
#include <QCryptographicHash>
#endif
#include "rng_sfmt.h"
void PasswordHasher::initialize()
{
#if QT_VERSION < 0x050000
@ -51,3 +53,20 @@ QString PasswordHasher::computeHash(const QString &password, const QString &salt
return hashedPass;
}
#endif
QString PasswordHasher::generateRandomSalt(const int len)
{
static const char alphanum[] =
"0123456789"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz";
QString ret;
int size = sizeof(alphanum) - 1;
for (int i = 0; i < len; ++i) {
ret.append(alphanum[rng->rand(0, size)]);
}
return ret;
}