User password encryption using Password_hash
First hash timestamp, and then with the value of the hash after the static salt with the user password hash to get the password,
On-line running discovery is slow, the slowest time is about 2000ms,
Do you have any good solutions?
Reply content:
User password encryption using Password_hash
First hash timestamp, and then with the value of the hash after the static salt with the user password hash to get the password,
On-line running discovery is slow, the slowest time is about 2000ms,
Do you have any good solutions?
Add salt MD5 can, PHP's own encryption function is not conducive to cross-platform
1. Encrypt with MD5
Several commonly used cryptographic functions for 2.PHP: https://jellybool.com/post/php-encrypt-functions
3. Custom encryption//Baidu a lot of
4.PHP standard AES Encryption algorithm class http://www.oschina.net/code/snippet_99277_45148
GitHub is a PHP custom encrypted:
`
require_once("xxtea.php");$str = "Hello World! 你好,中国!";$key = "1234567890";$encrypt_data = xxtea_encrypt($str, $key);$decrypt_data = xxtea_decrypt($encrypt_data, $key);if ($str == $decrypt_data) { echo "success!";} else { echo "fail!";}
?> '
https://github.com/xxtea/xxtea-php
Can let the logic of hash in MySQL do, MySQL has MD5 function, password function, you can try
The problem is found, Password_hash will pass three parameters, the last parameter is an array, there is a ' cost ' specifies the number of encryption iterations, the default 13 is 2^13 times. Increase the speed significantly after changing the number to small.
If you write a php extension
If you use Docker to deploy the environment.