What is the best method to encrypt password in cod

2019-09-22 18:48发布

问题:

Can anyone help me out to find the best encryption method for codeigniter?

回答1:

hi you can use md5 php function to encryt password string while login you have to check hash of string with hash saved in database there is one good post for password encryption you can read that

stackoverflow post

here are two good libraries for creating encrypted password

PHP Password library

PHPass

codeigniter auth library like tank auth using PHPass for encrypting password



回答2:

I generally use SHA1 with some static salt concatenated to it.



回答3:

In few months a new php password API will be available.

https://gist.github.com/3707231

Its greatest advantage is that it hugely simplifies existing hashing APIs while still maintaining a high level of security.



回答4:

Use password_compat from github.

Implements the new PHP 5.5 password hasing logic but you can use it now for older PHP versions

Link: GITHUB PASSWORD_COMPAT