CrackLib Dictionary
Moderator: General Moderators
CrackLib Dictionary
I am using PHP 4.3.8. I need to build a wrapper library based on the CrackLib functions for a project. But I don't know the format of the dictionary file. Nor can I find any dictionary file in my system or the net. Can anybody help?
More information would be helpful...
What OS are you using???
If you're on a UNIX box, check for /usr/dict/words or usr/share/dict/words.
Another resource would be the CrackLib readme file (http://www.users.dircon.co.uk/~crypto/d ... ib,2.7.txt)... Especially the section "Instructions for building CrackLib". Refer to step zero.
~Scott
If you're on a UNIX box, check for /usr/dict/words or usr/share/dict/words.
Another resource would be the CrackLib readme file (http://www.users.dircon.co.uk/~crypto/d ... ib,2.7.txt)... Especially the section "Instructions for building CrackLib". Refer to step zero.
~Scott
My config is Win XP/IIS. Since the last post, I have got hold of several dictionary files and wordlists including the one you have mentioned. I have also installed CrackLib on a Linux box and then copied the cracklib_dict.hwm, cracklib_dict.pwd and cracklib_dict.pwi files to my system and tried the Crack functions. The test script I tried was:
<?php
$username = "something";
$password = "whatever";
$dictionary = "cracklib_dict.pwd";
error_reporting(E_ALL);
$resource = crack_opendict($dictionary);
$check = crack_check($resource, $password);
$diag = crack_getlastmessage();
echo $diag;
crack_closedict($resource);
?>
PHP gives the following errors:
Warning: crack_opendict(): Unable to open a crack dictionary in F:\Projects\cracklib\crack_test.php on line 8
Warning: crack_check(): 288690440 is not a valid cracklib dictionary resource in F:\Projects\cracklib\crack_test.php on line 9
Warning: crack_getlastmessage(): No obscure checks in this session in F:\Projects\cracklib\crack_test.php on line 10
phpinfo() shows Crack as enabled.
<?php
$username = "something";
$password = "whatever";
$dictionary = "cracklib_dict.pwd";
error_reporting(E_ALL);
$resource = crack_opendict($dictionary);
$check = crack_check($resource, $password);
$diag = crack_getlastmessage();
echo $diag;
crack_closedict($resource);
?>
PHP gives the following errors:
Warning: crack_opendict(): Unable to open a crack dictionary in F:\Projects\cracklib\crack_test.php on line 8
Warning: crack_check(): 288690440 is not a valid cracklib dictionary resource in F:\Projects\cracklib\crack_test.php on line 9
Warning: crack_getlastmessage(): No obscure checks in this session in F:\Projects\cracklib\crack_test.php on line 10
phpinfo() shows Crack as enabled.
Well I figured out what went wrong. The dictionary file path has to be absolute and without file extension. To compound this PHP has a bug which gives an error even when everything is right. (http://bugs.php.net/bug.php?id=28905)
I finally downgraded to 4.3.4 and now everything is working fine.
I finally downgraded to 4.3.4 and now everything is working fine.