Splatify
6th February 2011, 14:55
Hi this is the code i have:
QByteArray hash = QCryptographicHash::hash((ui->PasswordTextbox->text()).toUtf8(), QCryptographicHash::Md5);
qDebug() << hash.toHex();
string password = // The code I need here
What I am trying to do is when the user enters the password, it gets encrypted with Md5. Then I want this md5 encrypted version to get stored as a string.
For example if the user enters '1234' as their password it gets converted to '81dc9bdb52d04dc20036dbd8313ed055'. This is outputted to the debugger using hash.toHex(); at the moment. I want this value to then be stored to a string so i can compare it against a password stored in a database.
how do i store the value '81dc9bdb52d04dc20036dbd8313ed055' to a string?
Thanks for your time and trouble
QByteArray hash = QCryptographicHash::hash((ui->PasswordTextbox->text()).toUtf8(), QCryptographicHash::Md5);
qDebug() << hash.toHex();
string password = // The code I need here
What I am trying to do is when the user enters the password, it gets encrypted with Md5. Then I want this md5 encrypted version to get stored as a string.
For example if the user enters '1234' as their password it gets converted to '81dc9bdb52d04dc20036dbd8313ed055'. This is outputted to the debugger using hash.toHex(); at the moment. I want this value to then be stored to a string so i can compare it against a password stored in a database.
how do i store the value '81dc9bdb52d04dc20036dbd8313ed055' to a string?
Thanks for your time and trouble