Package DE_EPAGES::Core::API::Password
Provides functionality for creating, hashing and validating user passwords.
@EXPORT_OK |
Functions
CheckPassword
Checks if a password matches with a stored hashed password. The hashing algorithm is automatically detected from the hash, supported are:
- DES (56bit)
- MD5 with salt
- SHA-256 without salt
- bcrypt with salt
Syntax |
$Checked = CheckPassword($Password, $StoredPasswordHash); |
Example |
if (CheckPassword($Password, $StoredPasswordHash)) { print 'check'; }; |
Input |
|
Return |
|
GenerateNewPassword
Generates a plain random word containing only alphanumeric characters.
Syntax |
$Password = GenerateNewPassword($Length); |
Input |
|
Return |
|