Coder Social home page Coder Social logo

DoS with long password about pbkdf2 HOT 5 OPEN

Sc00bz avatar Sc00bz commented on August 17, 2024
DoS with long password

from pbkdf2.

Comments (5)

calvinmetcalf avatar calvinmetcalf commented on August 17, 2024

ok so the fist big issue is that you can't actually clone node crypto objects like this, but there is a reason we aren't actually using createHmac here and it's becasue it has a bunch of overhead related to streaming object creation that we didn't want which means that we probably can fix this in the library.

that being said looking at how we use the hmac and how the hmac works are you sure that applies here ?

from pbkdf2.

Sc00bz avatar Sc00bz commented on August 17, 2024

Sorry I removed the reference to the lines of code https://github.com/crypto-browserify/pbkdf2/blob/master/lib/sync.js#L36-L40

from pbkdf2.

calvinmetcalf avatar calvinmetcalf commented on August 17, 2024

from pbkdf2.

calvinmetcalf avatar calvinmetcalf commented on August 17, 2024

This library is pretty complex as it handles several different scenarios:

  • in node.js but an old one that doesn't support some of the newer features
  • the browser in synchronous mode or in browser that doesn't support webcypto
  • the browser asynchronously via web crypto

so it's not necessarily obvious at first glance what code path will be taken it what environment but I believe I actually tested this back in the day and it was faster to create a node.js hmac object then to use a non streaming one because the node.js one would use a native hmac function while in the browser it wouldn't.

from pbkdf2.

webmaster128 avatar webmaster128 commented on August 17, 2024

Unfortunately, the Hmac class does not have the copy method as the Hash class:

Bildschirmfoto 2020-06-03 um 23 28 49

But what could be pulled out of the loop is this key normalization https://github.com/crypto-browserify/pbkdf2/blob/v3.1.0/lib/sync-browser.js#L26-L30, such that the native hmac always gets the correct key length.

from pbkdf2.

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.