8 ms·
Why is there a limit on password length for a Weebly account? How are you storing passwords?
by yukichan 12y ago
Why is there a limit on password length for a Weebly account? How are you storing passwords?
- drusenko 12y agoPretty sure this is a vestige of times past. We should definitely allow longer passwords. We salt and hash all passwords using a variable-cost bcrypt implementation.
- thirsteh 12y agoWith bcrypt you should set a limit of 72 bytes to avoid fooling users into thinking the stuff beyond the 72nd byte matters (bcrypt truncates it.)
- rescripting 12y agoWhy should I have to choose a different, shorter password because of your implementation details? Seems like an unnecessary annoyance.
- deleted 12y ago[deleted]
- thirsteh 12y agoIt is annoying, but it is necessary to avoid users choosing longer passwords where the necessary randomness is beyond the 72nd byte. Allowing a password of unlimited length when you support only e.g. 20 or 50 bytes is just as bad as putting in a maximum length restriction when you don't have one. Ideally, just use scrypt or PBKDF2, which don't have length restrictions.
- just2n 12y agoI wouldn't want to limit the password a user supplies. Any password should work, including 1 byte or 1 gb passwords. Restrictions of any form have always just caused more problems than they've solved. But the solution I've favored is hashing the user's password on the client with a hash that provides enough significant bits that your key derivation on the server is not weakened. This way you get the benefit of not needing to deal with differences in transmission size and the user's plaintext password is never exposed to any listener (regardless of whether the connection is secure, or believed to be secure).
- mscarborough 12y agoYour passwords are routinely longer than 72 bytes, and this is an inconvenience?
- hueving 12y agoOr hash it first using SHA3. Then you get the slowness of bcrypt (which is what you're using it for) and the variable length input of SHA3. You're only risk is a SHA3 collision, which is not something that is realistically going to happen.
- thirsteh 12y agoYep. Absolutely.
- drusenko 12y agoWe fixed the password limit. Thanks for the great feedback.
- rajacombinator 12y agoNow that, folks, is how you take care of your users. Other startups (Coinbase I'm looking at you...) would do well to take note.