Giter Club home page Giter Club logo

Comments (5)

codahale avatar codahale commented on September 24, 2024 1

To be clear, I’ve personally softened my position since then. I don’t think using a constant-time comparison function adds any actual security, but if it makes people feel better (and therefore more likely to use bcrypt instead of rolling their own), the cost isn’t particularly high.

I’m not maintaining the codebase, however, so I’ll defer to those who would actually bear that cost.

from bcrypt-ruby.

codahale avatar codahale commented on September 24, 2024

No. One of the desired properties of a cryptographic hash function is preimage attack resistance, which means there is no shortcut for generating a message which, when hashed, produces a specific digest.

Finding a first-preimage attack for bcrypt would be surprising, to say the least.

from bcrypt-ruby.

waiting-for-dev avatar waiting-for-dev commented on September 24, 2024

Hey, I have been worried recently about this issue. I understand the reason why it is not needed, but it seems that other language implementations like timingsafe_bcmp.c in py-bcrypt or password_verify() in PHP use constant time functions, following defence in depth policy.

I just took this information from a post in security stackexchange:

For hashing schemes such as Bcrypt, Scrypt, etc., timing attacks are irrelevant. Using comparisons such as == and === isn't a problem. Having that said, using constant time comparison is a good practice as part of a defence-in-depth policy. In fact, many Bcrypt implementations already used timing-safe comparison just in case (timingsafe_bcmp.c in py-bcrypt, for example).

What do you think about it?

from bcrypt-ruby.

tjschuck avatar tjschuck commented on September 24, 2024

@waiting-for-dev See #43 for much more information about why this is unnecessary.

Regarding "defense in depth" for this specific issue, @codahale said it best on #43:

It's like saying holding an umbrella gives you a "slight advantage" over holding nothing over your head when a piano is dropped on you.

from bcrypt-ruby.

waiting-for-dev avatar waiting-for-dev commented on September 24, 2024

Ok, thanks for pointing me there :)

from bcrypt-ruby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.