Crypt
(PHP3, PHP4)
Crypt---&http://www.aliyun.com/zixun/aggregation/37954.html ">nbsp; Using DES to 碥 strings
Syntax: String crypt (String str [, string salt])
Description:
Crypt () will encode the string using standard Unix des encryption, parameter STR is the string to encode, and the parameter salt is the encrypted base (base).
If no parameter salt is provided, it will be generated arbitrarily by PHP.
Some operating systems provide more than one form of encryption, in fact, 8630.html "> Sometimes standard des encryption is replaced by MD5 encryption algorithms." The encrypted form is dependent on the parameter salt, and when installed, PHP determines the ability of the Crypt function and accepts the salt as another encryption form, and if no salt,php preset is provided it automatically produces a standard 2-character DES salt, Unless the system-preset encryption type is MD5, any md5-compatible salt is produced in this case. PHP sets a constant name Crypt_salt_length, which tells you whether a regular 2-character salt applies to your system, or you can use 12-char MD5 salt.
Whether the crypt () function provides a variety of cryptographic forms on the system, the following constants are set to 0 or 1 depending on whether the given form is available.
Crypt_std_des-Standard DES encryption and 2-char SALT
Crypt_ext_des-Extended DES encryption and 9-char SALT
CRYPT_MD5-MD5 encryption and 12-char SALT start as $1$
Crypt_blowfish-Extended des encryption and 16-char SALT start as $2$
Reference: MD5