I'm designing an authentication system that works like the following:
- User enters password
- Salt is generated.
- Password is hashed with whirlpool
- Whirlpool hashed password concatenated with the plain salt
- The concatenated version is hashed with sha1 and stored in the database.
- I check the password is correct by hashing the password on the application layer, and then doing this (in MySQL):
MySQL
WHERE `Password` = SHA1(CONCAT('$hashedPassword',`Salt`)) AND [..]
At the moment my salt is 64 bytes. Will that be enough to make it infeasible to dictionary attack?
I'm sure sha1 has known vulnerabilities, but it's the only function available on my version of MySQL (5.1) that I can use on the database layer, rather than selecting the plain salt over a connection between the app and the database layer.
SHA1(CONCAT(PHP_WHIRLPOOL('correct horse battery staple'), Salt))
, where PHP_WHIRLPOOL takes place on the application. Hopefully that makes sense? :) – HoveySalt
references the field itself, not the literal string. – Hovey