-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do passwords need to be null terminated? #76
Comments
I'm not sure tbh, we should see how other implementations handle it. From what I remember, it should be 71 bytes + 0 so yeah it might not be correct. |
By the Go implementation, I think it's 72 bytes + 0
Same as this C++ implementation, https://github.com/kelektiv/node.bcrypt.js/blob/master/src/bcrypt.cc#L220-L224 It's not bothering me -- just out of curiosity 😄 |
I guess it's an issue in this crate then, the push should be after the truncation. I guess no one really encode things that are more than 72 bytes in practice. |
I guess we should hash a password from the C++/Go implementation that has more than 72 bytes and ensure we can verify them |
When
password
has more than 72 bytes, it is truncated and the assumption may not hold true.I wonder if L109 is necessary.
rust-bcrypt/src/lib.rs
Lines 106 to 114 in b6af5e5
The text was updated successfully, but these errors were encountered: