My users all have strong (80-bit true entropy) passwords. How do I know that? Because my imaginary website randomly generates the passwords for them (client-side). In that context, could you explain why it would be a problem to store them as plain unsalted hashes (either MD5, SHA1, or SHA256).

  • 3
    It is really dangerous to generate passwords client-side. The hacker could detect a logic in this 'random' generation and break into most of the account. This should be - at least - server side.
    – Xavier59
    Jul 1, 2016 at 10:44
  • Possible duplicate of Why are salted hashes more secure for password storage?
    – eol
    Jul 1, 2016 at 10:47
  • "Client-side" = no, you really don't know anything. Jul 1, 2016 at 14:09
  • 1
    Note a dupe of "Why are salted hashes more secure for password storage?" as using cryptographically secure random passwords changes the need for salt. Jul 1, 2016 at 15:08

2 Answers 2


Such strong passwords can be safely stored unsalted with a fast algorithm like SHA256, there is no problem in that.

The problems are different, you have to trust the client, the secure transportation to the server, and you have to make sure that the generated passwords are indeed unpredictable.


Sufficiently long passwords generated by a secure random number generator hashed by an algorithm with long output (at least 128 bit) and no known weakness (at least SHA256) will become infeasible to bruteforce (either against a single hash or compute a useful rainbow table) and salting will not be necessary.

Your description of your implementation doesn't satisfy the italic points. The password should contain enough entropy to deter bruteforcing. It should at least be 128-bits these days. Also, there's no way to get true randomness in a browser without non-standard browser extensions*. Naively using a PRNG does not give you very random numbers.


* This is now possible with the Web Cryptography API, but any wrapper library that falls back to other ways of generating random numbers must be used with care.

  • There is an experimental JavaScript API meant to provide cryptographic random number generation in JavaScript, see this answer, and 80 bits password seems generally considered good enough. However, from a practical point-of-view, I'm still wondering how the OP expects his users to remember cookies off the top of head... Jul 2, 2016 at 8:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .