Crack functions
Crack functions allow to use the CrackLib library to test the ’strength’ of a password.
The ’strength’ of a password is tested by that checks length, use of upper and lower case and checked against the specified CrackLib dictionary.
CrackLib will also give helpful diagnostic messages that will help ’strengthen’ the password.
crack_opendict:
————————
Opens a new CrackLib dictionary
Syntax:
————
resource crack_opendict ( string dictionary)
crack_closedict:
———————–
Closes an open CrackLib dictionary.
Syntax:
———–
bool crack_closedict ( [resource dictionary])
crack_check :
———————
Performs an obscure check with the given password
Syntax:
————
bool crack_check ( [resource dictionary, string password])
crack_getlastmessage:
—————————————
Returns the message from the last obscure check
Syntax:
———-
string crack_getlastmessage ( void)
<?php
$dict = crack_opendict(’/usr/local/lib/pw_dict’)
or die(’Unable to open dictionary’);
$check = crack_check($dict, ‘PassWord123′);
$diag = crack_getlastmessage();
echo $diag;
crack_closedict($dict);
?>
