PHP PHP PROJECT WEB DEVELOPMENT

How to Create Password Hashing in PHP





Functions for hashing password

  • password_hash()
  • password_verify()

password_hash() –

Syntax:

string $password – Password provide by user

integer $algo –   Password algorithm constant(PASSWORD_DEFAULT and PASSWORD_BCRYPT)

PASSWORD_DEFAULT – uses the BCrypt algorithm to create the hash

PASSWORD_BCRYPT –  uses the CRYPT_BLOWFISH algorithm and will return a 60 character string

$options – 

$options have two indexes.One is cost and another one is salt.

Cost-  Cost is the repetition of algorithm which have default value 10.  Which means algorithm will run 10 times to make a strong hash. You can configure your cost value according to your server configuration.

Syntax- 

Related Post

Share this
  • 6
    Shares

Leave a Reply

Your email address will not be published. Required fields are marked *