Re: perl and md5 crypt
* 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.
--
Brian Clark | Debian GNU/Linux: 3950 packages to keep you busy.
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
You are taking yourself far too seriously.
Reply to: