Uwe Birkenhain wrote:
> Hi,
> is it possible to tell php which crypting it should use in crypt()?
>
> My problem:
> The program is running on a linux-server (of course) and there is DES
> available and MD5; crypt() uses MD5.
> At home I'm developing on a win98 machine and there seems only DES to
> be available.
>
> Of course it would be usefull to use both times the same encryption -
> but how to tell the server to use DES??

You should use a 2 character string as salt, to tell PHP that it should use
DES instead of MD5.

Quote from http://www.php.net/crypt: "Some operating systems support more
than one type of encryption. In fact, sometimes the standard DES-based
encryption is replaced by an MD5-based encryption algorithm. The encryption
type is triggered by the salt argument. At install time, PHP determines the
capabilities of the crypt function and will accept salts for other
encryption types. If no salt is provided, PHP will auto-generate a standard
two character salt by default, unless the default encryption type on the
system is MD5, in which case a random MD5-compatible salt is generated. PHP
sets a constant named CRYPT_SALT_LENGTH which tells you whether a regular
two character salt applies to your system or the longer twelve character
salt is applicable."

HTH
Erwin


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to