How to securely generate SSHA256 or SSHA512 hashes in PHP?

前端 未结 2 754
说谎
说谎 2021-02-15 01:58

I am working on a web administration module for mailservers (it\'s open source if you\'d like to take a look).

For that, I need to be able to generate hashed password th

2条回答
  •  無奈伤痛
    2021-02-15 02:38

    Password generation function in PHP:

    $hash = "{SSHA256}".base64_encode(hash('sha256', $password.$salt, true).$salt);
    

    Necessarily "true" - the third parameter...

提交回复
热议问题