Module: siteKiosk.crypto

This module provides cryptographic functions for hashing and verifying passwords. It also allows verifying of SiteKiosk's master password.

Example

//hash a password
var password = "12345";
var hash = siteKiosk.crypto.hashPassword(password);

//verify
var verified = siteKiosk.crypto.verifyPasswordHash(hash, "1234");

//verified is now false since we verified the wrong password

Methods

<static> hashPassword(password) → {string}

Hashes a password using a mechanism provided by system.
Parameters:
Name Type Description
password string Plain text password to be hashed
Returns:
Password hash
Type
string

<static> verifyMasterPassword(password) → {boolean}

Checks if the provided password is a valid SiteKiosk master password.
Parameters:
Name Type Description
password string Master password
Returns:
Whether the master password is valid
Type
boolean

<static> verifyPasswordHash(hash, password) → {boolean}

Verifies a hash created by hashPassword.
Parameters:
Name Type Description
hash string Password hash
password string Plain text password to be hashed
Returns:
Whether the password matches the password hash
Type
boolean