CrackLib Dictionary

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
suman
Forum Newbie
Posts: 3
Joined: Tue Jan 18, 2005 5:06 am

CrackLib Dictionary

Post by suman »

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?
User avatar
skehoe
Forum Commoner
Posts: 59
Joined: Sun Dec 22, 2002 5:57 am
Location: Denver

More information would be helpful...

Post by skehoe »

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
User avatar
suman
Forum Newbie
Posts: 3
Joined: Tue Jan 18, 2005 5:06 am

Post by suman »

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.
User avatar
suman
Forum Newbie
Posts: 3
Joined: Tue Jan 18, 2005 5:06 am

Post by suman »

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.
Post Reply