There are many encryption functions in php functions, one of which can implement data encryption functions is called the crypt () function. The crypt () function uses a one-way algorithm without corresponding decryption functions. It returns a string encrypted using the DES, Blowfish, or MD5 algorithm. There are a lot of encryption functions in php functions, one of which can implement the data encryption function is called
Crypt ()Function. The crypt () function uses a one-way algorithm without corresponding decryption functions. It returns a string encrypted using the DES, Blowfish, or MD5 algorithm. On the surface, the crypt () function seems useless, but it is indeed widely used to ensure the integrity of the system password. Because, even if the one-way encryption password falls into the hands of a third party, it is useless because it cannot be restored to plain text. Next we will summarize the use of the crypt () function, hoping to help you learn php.
Crypt () functions
1. example of encryption usage of the PHP encryption function-crypt () function
Print "My system salt size is:". CRYPT_SALT_LENGTH;
4. use crypt () in PHP for user authentication
The crypt () function returns a string encrypted with DES, Blowfish, or MD5. In different operating systems, the behavior of this function is different. some operating systems support more than one algorithm type. During installation, PHP checks what algorithms are available and used. Anyone who has experience using a non-Windows platform may be familiar with crypt (). This function is called one-way encryption and can encrypt some plain codes, however, the password cannot be converted to the original plaintext.
5. function introduction of PHP function crypt ()
In the PHP function crypt (), the encrypted passwords correspond to kent, banner, and parker. Note the first two letters of each password. this is because the following code is used, create interference strings based on the first two letters of the password. I will use Apache password-answer authentication configuration to prompt the user to enter the user name and password. a little-known information about PHP is, it recognizes the username and password entered by the Apache password-response system as $ PHP_AUTH_USER and $ PHP_AUTH_PW. These two variables are used in the authentication script.
Related Q &
1. what is the problem with laravel5.2 openssl_encrypt?
2. md5-PHP: crypt () function. Can the encrypted password value be equal to the salt value?
3. how to implement the PHP crypt () function in Nodejs