[COMP] Re: perl crypt() and MD5?

> It works fine on a debian box with DES passwds
> but there is a Mandrake machine I wanted to run
> it on which uses MD5 instead.

> $salt = substr($user, 0, 2);
> chop($word = <STDIN>;
>
>       if (unix_md5_crypt($word, $salt) eq $user) {
>           print "$line[0]: yes\n";

MD5-based crypt() uses an 8-character salt.

> One other thing - how insane would it be to
> later on extend this to a cgi that would allow
> people (who don't even know what 'shell' means)
> to change their passwds via a webpage?

Locking the file properly may cause you issues -- I'd suggest not doing
it, unless there's some cool way of doing it through PAM...

John




Other related posts: