Encryption using the crypt () function (one-way String hash), low security factor

Source: Internet
Author: User
Tags crypt md5 hash sha1 hash
You should use the complete result obtained by crypt () as the salt value for password verification to avoid problems caused by different hash algorithms. (As described above, the password hash based on the standard DES algorithm uses a 2-character salt value, but the MD5 algorithm uses a 12-character salt value.
 
 
 
 
 
 
Use the md5 () function to encrypt (use? RSA Data Security's MD5 packet algorithm calculates the MD5 hash value of str .), The security factor is higher than that of the crypt () function.
 
 
 
 
 
 "; $ Md5tostr = md5 ($ str); echo" encrypted: ". $ md5tostr;?>

Use the sha1 () function to encrypt (use? The US security hash algorithm 1 calculates the sha1 hash value of a string .)

 

 

 
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.