On the Encryption Method of discuz Password

  • 2021-06-28 11:54:15
  • OfStack

When discuz registers, it encrypts the password by a rule.

For example, my password is 123 456


echo md5("123456");  

Will output:


e10adc3949ba59abbe56e057f20f883e

The value of the database is:


7839dc9437013b5c11a5d86e9b8350e9  

Be aware:

There is a field called salt whose value is: d82a35

This is actually a random string.

The value after the first md5 plus the salt value (salt) followed by md5 is the value to be obtained.

Try 1


echo md5(md5('123456').'d82a35');  

This time the result is: 7839dc9437013b5c11a5d86e9b8350e9, yes.

Prior to php5.5, there was no good encryption mechanism.This is a good way.Password security has been greatly enhanced.

There are more reliable and convenient encryption methods in php5.5.Friends who like to study can find out about 1:

password_hash()

http://www.php.net/manual/zh/function.password-hash.php


Related articles: