-
Notifications
You must be signed in to change notification settings - Fork 282
Use a constant-time secure comparison for passwords #119
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
Conversation
16f31c1
to
bbc1553
Compare
Use a constant-time byte-by-byte secure comparison to compare potential password hashes rather than `String#==`, which uses strcmp under the hood and stops as soon as there's an unmatched byte.
see #42, which I didn't notice until after I did this. |
Also, this is breaking on a build on ruby-head - don't know if that's my fault |
(Bumping for CI) |
It buys nothing except "we're following best practices," which is in itself valuable. |
another +1 |
👍 from me too |
It is described in #43 why it is not necessary in this case. Has anything changed since then? |
Bcrypt has preimage resistance according to known methods. Science is a process and remember There is really no practical argument here, not to include this. The negligible performance decrease is not worth the security decrease. |
I’m not sure why you saw fit to resurrect a decade-old issue and specifically tag me but here we go.
Leave me alone. |
Closing in favor of #282. @glittershark I cherry-picked your commit in to #282 then added some trivial performance related stuff (specifically just avoiding array allocations). |
Use a constant-time byte-by-byte secure comparison to compare potential
password hashes rather than
String#==
, which uses strcmp under thehood and stops as soon as there's an unmatched byte.