Yii Framework Forum: Database Authentication - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Database Authentication Database authentication with salt field Rate Topic: -----

#1 User is offline   Deepak Vashistha 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 23-June 14
  • Location:India

Posted 23 June 2014 - 11:53 PM

Hi,
I want to use Database authentication in yii framework. Various posts are very helpful for this and I have implemented it successfully. Now there are two upgrades I want to introduce in it.
  • A salt field in DB for each user.

It is an advanced version of existing DB Auth.
A. When a user is created a unique salt field will be generated randomly and inserted to the db along with the password. $random_salt = hash('sha512', uniqid(mt_rand(1, mt_getrandmax()), true));
B. Password will be hashed using SHA512 Algorithm. $password = hash('sha512', $password.$random_salt);
C. At the time of authentication it will be checked according to the above rules.

Is any body have idea how can I Insert salt field in the database at the time of new user creation. Salt field is not created initially when DB Auth is implemented. I have just created this field.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users