|
|
 |
Re: FN-FORUM PHP/Perl Crypt()
date posted 10th January 2003 17:54
Hi Richard,
Have you read the user notes at:
http://www.php.net/manual/en/function.crypt.php
"
crypt() on operating systems where multiple encryption mechanisms are
supported gets triggered by the actual salt you feed it. If you feed
crypt a 2-char salt, then it will use DES encryption. If you feed it a
12-char salt starting with $1$ it will use MD5. If you feed it a
17-char salt starting with $2$ it will do Blowfish.
It has been theorized that feeding salt for an encryption method that is
not supported by the OS will result in some other encryption being
employed. If true, it might be possible to detect unsupported
encryption methods by providing a salt and comparing the first n
characters of the result with the provided salt.
"
If you know what encryption method perl is using you may be able to set
php to do the same.
HTH
George
Richard Watt wrote:
> Hello all, does anyone have a clue how to force PHP and Perl to
> provide the same results
> PHP : crypt($password, "AB");
> produces something completely different from the exact same function
> in Perl, anything i'm missing, or is it completely hopeless?
>
> Any other lightweight password scrambling I can safely use in both
> languages (other than MD5 - the Perl module isnt installed on this
> server...)
>
> ---------------------------
> Richard Watt Website Design
> site : http://www.rwatt.co.uk
> email : [EMAIL REMOVED]
> phone : (0131) 466 0700
> fax : (0131) 466 1813
--
Layer1
http://www.layer1.co.uk
t: +44 (20) 8567 5923 m: +44 (7801) 945164
|
 |
|