php - Salt is not stored in the database in yii2 -


in yii2,the table structure user table not include salt column.

 $this->createtable('tbl_user', [         'id' => schema::type_pk,         'username' => schema::type_string . ' not null',         'auth_key' => schema::type_string . '(32) not null',         'password_hash' => schema::type_string . ' not null',         'password_reset_token' => schema::type_string . '(32)',         'email' => schema::type_string . ' not null',         'role' => schema::type_smallint . ' not null default 10',          'status' => schema::type_smallint . ' not null default 10',         'create_time' => schema::type_integer.' not null',         'update_time' => schema::type_integer.' not null',     ], $tableoptions); 

this make me confused. although yii uses salted hash, not stored in database default. should rewrite code make store in database?what if not sore salt in database?

this salt, used in yii2 security helper doesn't require storing in db, used creating password hash, not need compare password hash. it's pretty secure.


Comments

Popular posts from this blog

c++ - How to add Crypto++ library to Qt project -

jQuery Mobile app not scrolling in Firefox -

How to use vim as editor in Matlab GUI -