LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] crypt disapeared ?

[ILUG] crypt disapeared ?

Ken Guest ilug at ken.guest.cx
Thu Jul 19 10:26:25 IST 2007


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/



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


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!
RSS Version
Powered by Dell