重複の可能性:
PHPパスワードの安全なハッシュとソルト
私は持っています:
$insert_query = 'insert into '.$this->tablename.'(
name,
email,
username,
password,
confirmcode
)
values
(
"' . $this->SanitizeForSQL($formvars['name']) . '",
"' . $this->SanitizeForSQL($formvars['email']) . '",
"' . $this->SanitizeForSQL($formvars['username']) . '",
"' . md5($formvars['password']) . '",
"' . $confirmcode . '"
)';
md5を使用する代わりに、パスワードをソルトして適切にsha256ハッシュしたいのですが、どのように適切にソルトしますか?ソルトパスをphpファイルに保存するのに十分安全ですか?