Skip to content
This repository has been archived by the owner on Oct 19, 2018. It is now read-only.

Pre-hash passwords to avoid max character limit in bcrypt #46

Open
Kaptard opened this issue Aug 17, 2018 · 0 comments
Open

Pre-hash passwords to avoid max character limit in bcrypt #46

Kaptard opened this issue Aug 17, 2018 · 0 comments

Comments

@Kaptard
Copy link
Member

Kaptard commented Aug 17, 2018

The issue is that technically, bcrypt can only handle 72 bytes of data, minus one byte for the null terminator.

One way to avoid this is by pre-hashing passwords with something like sha256 or sha512. This should always give us a fixed byte length. However, this leads to the issue that the sha hash effectively becomes the password, meaning one would lose the maximum possible entropy when using high-entropy passwords. On the other hand, it may actually increase the entropy of most common passwords, as long as they're not part of rainbowtables.

I'm not quite sure how to go about this, so any feedback would be appreciated.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant