GithubHelp home page GithubHelp logo

pswd's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

kingcody mvila

pswd's Issues

Timing Attack Vulnerability

The password and hash comparison is vulnerable to a timing attack.

It would be best to replace it with a time-constant operation.

function compare(str1, str2) {
  if (str1.length !== str2.length)
    return false
  var i = 0, result = 0
  for (; i < str1.length; i++)
    result |= str1[i].charCodeAt(0) ^ str2[i].charCodeAt(0)
  return result === 0
}

Constant time equality proof

Hi,

I'm the maintainer of Credential. We're currently trying to harden our constant time equality check in Credential, and we're looking for a good statistics test to ensure that our timing is constant enough to thwart timing attacks.

Your experience and feedback would be very useful. Please take a look at this proposed constant time string comparison. I'm especially interested in producing a test suite that can guarantee statistically significant constant time equality comparisons, and I believe such tests would be useful to your library, as well.

My assertion is that none of our libs are complete without a statistical proof that our constant time comparisons are constant enough to thwart actual timing attacks. See Crosby et al:

"We have shown that, even though the Internet induces significant timing jitter, we can reliably distinguish remote timing differences as low as 20 µs. A LAN environment has lower timing jitter, allowing us to reliably distinguish remote timing differences as small as 100 ns (possibly even smaller). These precise timing differences can be distinguished with only hundreds or possibly thousands of measurements." Crosby et al., "Opportunities and Limits of Remote Timing Attacks"

So if we're going to implement libraries and call them secure, we need to prove it in our test suites. Wouldn't you agree? With Credential, I don't just expect people to trust that it's secure. I'm putting my money where my mouth is.

Because what we do in our libraries potentially impacts the personal security of millions of people, I think it's our responsibility as security library maintainers to provide assurances that we take these things seriously.

Thanks for taking security seriously,

Eric Elliott
Author, "Programming JavaScript Applications"

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.