I already know I"m going to hash the user's password n times in either sha512 or n*x in sha1 before it is sent to the server. Once at the server, I'm going to use bcrypt set to use ~1/100th of a second. Before I move on, onto my reasoning behind using sha512 instead of sha1, I'd like to state a few things. First, I know that client-side security is a joke. Second, I know that a Man-in-the-middle attack could strip the page's javascript of the hash function. Finally, I realize that this will mean that people will not be able to login without javascript being enabled.
I am currently using sha512 set to use ~1s in ie8 [2], it is setup as such.
- Take the user's password and username.
- Add a static-nonce(to lengthen it really and nothing else).
- Hash it via the hashing function, in this case sha512.
- Take that hash, hash it via sha512 with the current loop number packed into a single byte.
- repeat step 4 n times.
- Once it is done, take that value, and put it into the password field.
- finally allow the system to POST to the server.
Now then, what is the advantage of doing n*x hashes of sha1 vs the n times of sha512. The entire point behind using this system is that, in the event of a database leak the attacker will have to increase the amount of time spent trying to find the password by z time. Also, by hashing it before it even gets to the server(along with using TLS), it makes it, so that, in the event of some weird bug, the password is never seen as plain text.
I believe that sha512 is a better choice since there is already broken sha1 and thus it's security is not worthwhile, but on the other side. The fastest javascript library I've found for sha512[1][] is ~50 times slower than native code, but the fastest sha1 library that I've found is only ~17 times slower than native code.
Thus it is a question of is the broken sha1 going to cause a greater loss in overall security and thus slowdown of an attacker than doing less iterations of sha512 which as of right now none of the sha2 family is remotely broken. Has anyone else dealt with this issue before?
[1]: that via fuzzing results in the same hash as the c implementation/php one results in the same hash for ~300 inputs.
[2]: One year after ie10 is out, I'd like to drop support for ie8 so that I can move up the number of hashes to something more reasonable.