Giter Site home page Giter Site logo

Comments (16)

tjconcept avatar tjconcept commented on June 12, 2024

I'd rather not expire my users passwords, but in stead just silently replace hashes with stronger ones
on log in. I think this has to be handled in user land. Something along the lines of:

  1. fetch user from storage
  2. verify
  3. if hash i considered outdated, save a new hash from cleartext password

from credential.

ericelliott avatar ericelliott commented on June 12, 2024

For safety, password should expire periodically, anyway. Not frequently, but annually isn't terrible.

from credential.

ericelliott avatar ericelliott commented on June 12, 2024

Both those password update options should be out-of-scope for this library, anyway, since they really have nothing to do with password hashing and verification, and everything to do with your UX. Detecting that the password is out of date should be enough to get the ball rolling.

from credential.

tjconcept avatar tjconcept commented on June 12, 2024

Yes, but that is the responsibility of the application IMO.

I propose a method such as "expired(hash, threshold) -> bool"
Is there maybe a better word than "expired"? Something stating; this hash could be better.

A threshold and a more-than-annual increase would be nice to avoid having all users upgrade at 01.01.2016 00:00:00 on the same server each hour ;-)

from credential.

tjconcept avatar tjconcept commented on June 12, 2024

Well, you said it. We were actually more on the same page than I realized.

from credential.

ericelliott avatar ericelliott commented on June 12, 2024

👍

How about "untrusted" instead of "expired"?

from credential.

ericelliott avatar ericelliott commented on June 12, 2024

Want to take a crack at a PR?

from credential.

tjconcept avatar tjconcept commented on June 12, 2024

Would love to, will try to squeeze it in this weekend.

from credential.

ericelliott avatar ericelliott commented on June 12, 2024

Awesome. 👍

from credential.

calebboyd avatar calebboyd commented on June 12, 2024

It seems that if there isn't an explicit iteration count included with the hash, so there would need to be either a year or created field added so that the hashes can be calculated and compared. This was my concern in #9.

from credential.

tjconcept avatar tjconcept commented on June 12, 2024

I've seen #9, and I think the iteration count should be stored as well. I think this is what scrypt does as well (https://github.com/barrysteyn/node-scrypt).

from credential.

ericelliott avatar ericelliott commented on June 12, 2024

I'm willing to ditch the hidden work unit modifier in favor of storing the year in the hash.

from credential.

ericelliott avatar ericelliott commented on June 12, 2024

Go ahead with the breaking change. I think that basing iterations on the current year is much more secure than the security by obscurity in the "hidden" iteration count. ;)

from credential.

tjconcept avatar tjconcept commented on June 12, 2024

Awesome.
The stored hash should IMO be independent from the implementation such that you can freely update/enhance the implementation without invalidating the whole database.

from credential.

tjconcept avatar tjconcept commented on June 12, 2024

I think #14 should be solved first/independently as this seems more like a smaller enhancement to the "determine iterations"-logic.
But I'll happily have a crack at it all in the weekend.

from credential.

ericelliott avatar ericelliott commented on June 12, 2024

Sounds like a great plan. Thanks! 👍

from credential.

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.