Hey i would like do have your input on this
I use this to generate unique salts to each of my users when they register (random letters and numbers). how big is the chance that salts will colide?
uniqid(mt_rand());
I then use md5 to hash salt, password and email(in that order) together as password and rehash when they log-in.
md5($salt . $password . $email);
How much safer than just md5 is this? Something i can improve?
CREATE TABLE IF NOT EXISTS `users` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(24) CHARACTER SET utf8 NOT NULL,
`password` varchar(32) CHARACTER SET utf8 NOT NULL,
`email` varchar(255) CHARACTER SET utf8 NOT NULL,
`salt` varchar(255) CHARACTER SET utf8 NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`),
UNIQUE KEY `email` (`email`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;