On Thu, Jul 19, 2007 at 10:17:30AM +0100, Pádraig Brady wrote:
<snip>
> Now glibc can directly generate the MD5 format password hashes
> you described, if you prepend $1$ to the salt parameter
> of the crypt function. So the following should work
> on glibc systems:
>> echo 'import crypt; print crypt.crypt("password","$1$salt")' | python
>> I presume you can do the equivalent from the command line with the PHP interpreter.
>>
Sent this to Thomas yesterday; really should share it:
--- crypt[.php] ---
#!/usr/bin/php
<?php
function display_help()
{
global $argv;
echo $argv[0], " <password>\n";
echo "Encrypts password using crypt.\n\n";
}
if (count($argv) != 2) { display_help(); exit; }
echo crypt($argv[1], "salt"), "\n";
?>
-------------------
k.
--
Ken Guest
Irish Linux Users' Group webmaster, www.linux.ie
Irish PHP Users Group http://www.php.ie
Mobile: +353 86 8252 141 http://blogs.linux.ie/kenguest/
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!