[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: perl and md5 crypt



Brian Clark wrote:

> * Thedore Knab (tjk@annapolislinux.org) [Jan 13. 2002 19:57]:
>
> > How would I fix this to generate MD5 passwords ?
>
> [...]
>
> > It should look like this MD5 style:
> > tester3:$1$sx6dzguz$IyKiUC3Ua2MCOFDZxppzk1:11701:0:99999:7:::
>
> Try this:
>
> -------[ perl ] --------
>
> for(0 .. 7) {
>   $salt .= join '', ('.', '/', 0..9,'A'..'Z', 'a'..'z')[rand 64];
> }
>
> $password = crypt($password,'$1$' . $salt . '$');
>
> ------------------------
>
> I *think* that's how I did it once. It might actually work.
>

Isnt that how the man page says to do it?



Reply to: