How can I enable password encryption in the database for use with UserIdentity?
Page 1 of 1
UserIdentity and Password encryption
#2
Posted 17 February 2010 - 11:02 AM
GSTAR, on 17 February 2010 - 09:16 AM, said:
How can I enable password encryption in the database for use with UserIdentity?
when the user enters a new password, before storing it encrypt it (like $password=md5($password)
when logging in, again first encrypt the entered password and then compare it with the value in the database.
#3
Posted 17 February 2010 - 11:11 AM
hmmm is there no built-in functioniality in Yii/UserIdentity component that will automate this process?
I need to also add a salt to the password.
EDIT: RESOLVED
I need to also add a salt to the password.
EDIT: RESOLVED
#4
Posted 17 February 2010 - 03:13 PM
stronger hash function:
and add a 'hashSalt' param to your main.php config file
static function passwordHash($pass)
{
return hash('sha256', Yii::app()->params['hashSalt'].$pass);
}
and add a 'hashSalt' param to your main.php config file
Share this topic:
Page 1 of 1

Help














