#include <passwordhasher.h>
|
| static QString | computeHash (const QString &password, const QString &salt) |
| static QString | generateRandomSalt (const int len=16) |
| static QString | generateActivationToken () |
| static QByteArray | deriveKey (const QString &password, const QByteArray &salt, int n, int r, int p) |
| | Derive the scrypt verifier for the given password, salt and cost parameters. Empty on failure.
|
| static bool | costParamsAreSane (int n, int r, int p) |
| | True if the scrypt cost parameters are acceptable for server and client use.
|
| static QString | generatePasswordVerifier (const QString &password) |
| | Build a "$scrypt$<n>$<r>$<p>$<salt>$<verifier>" string with a fresh random salt.
|
| static PasswordVerifier | parsePasswordVerifier (const QString &stored) |
| | Parse a stored "$scrypt$..." string into its components.
|
| static bool | isLegacyFormat (const QString &stored) |
| | True if the stored value is not in the scrypt format (legacy salt+hash).
|
| static bool | verifyPassword (const QString &password, const QString &storedPasswordData) |
| | True if the password matches the stored credential, whether legacy salt+hash or scrypt.
|
| static QByteArray | computeResponse (const QByteArray &key, const QByteArray &nonce) |
| | HMAC-SHA256 of nonce keyed with the password verifier, used for challenge-response logins.
|
| static bool | constantTimeEquals (const QByteArray &a, const QByteArray &b) |
| | Constant-time byte comparison.
|
◆ computeHash()
| QString PasswordHasher::computeHash |
( |
const QString & | password, |
|
|
const QString & | salt ) |
|
static |
◆ computeResponse()
| QByteArray PasswordHasher::computeResponse |
( |
const QByteArray & | key, |
|
|
const QByteArray & | nonce ) |
|
static |
HMAC-SHA256 of nonce keyed with the password verifier, used for challenge-response logins.
◆ constantTimeEquals()
| bool PasswordHasher::constantTimeEquals |
( |
const QByteArray & | a, |
|
|
const QByteArray & | b ) |
|
static |
Constant-time byte comparison.
◆ costParamsAreSane()
| bool PasswordHasher::costParamsAreSane |
( |
int | n, |
|
|
int | r, |
|
|
int | p ) |
|
static |
True if the scrypt cost parameters are acceptable for server and client use.
◆ deriveKey()
| QByteArray PasswordHasher::deriveKey |
( |
const QString & | password, |
|
|
const QByteArray & | salt, |
|
|
int | n, |
|
|
int | r, |
|
|
int | p ) |
|
static |
Derive the scrypt verifier for the given password, salt and cost parameters. Empty on failure.
◆ generateActivationToken()
| QString PasswordHasher::generateActivationToken |
( |
| ) |
|
|
static |
◆ generatePasswordVerifier()
| QString PasswordHasher::generatePasswordVerifier |
( |
const QString & | password | ) |
|
|
static |
Build a "$scrypt$<n>$<r>$<p>$<salt>$<verifier>" string with a fresh random salt.
◆ generateRandomSalt()
| QString PasswordHasher::generateRandomSalt |
( |
const int | len = 16 | ) |
|
|
static |
◆ isLegacyFormat()
| bool PasswordHasher::isLegacyFormat |
( |
const QString & | stored | ) |
|
|
static |
True if the stored value is not in the scrypt format (legacy salt+hash).
◆ parsePasswordVerifier()
| PasswordVerifier PasswordHasher::parsePasswordVerifier |
( |
const QString & | stored | ) |
|
|
static |
Parse a stored "$scrypt$..." string into its components.
◆ verifyPassword()
| bool PasswordHasher::verifyPassword |
( |
const QString & | password, |
|
|
const QString & | storedPasswordData ) |
|
static |
True if the password matches the stored credential, whether legacy salt+hash or scrypt.
The documentation for this class was generated from the following files: