Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Right, don't do this, for the reasons given.

You can, however, do the high-cost hash on the client, then do a low-cost hash comparison of the result on the server.

So you do a cheap SHA256 hash comparison on the server, but because the input to that comes out of, say scrypt, it has 256 bits of entropy (or near), making cracking infeasible. (scrypt has variable length output, so you could use other hash sizes).

This is only done when checking; when setting the password, both the slow and fast hashes are done on the server (to stop someone just hashing 'password123' with SHA256 and sending that).

This is called server relief. There's a discussion of it elsewhere in this comment thread, it is well known, e.g. [1], though doesn't google particularly well.

The downside, of course, is that someone with a disabled or borked javascript can't login to your site.

[1] https://books.google.co.uk/books?id=uZ-1BwAAQBAJ&pg=PA370&lp...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: