Comments (4)
Whatever is returned from hash
is supposed to go unmodified into verify
again.
The fact that hash
returns a JSON string is an implementation detail, is not documented, and could change without triggering a new major release. That's why you should not parse it and not store it as anything else than an opaque value.
If you really want to, you should parse it on one side (after hash
) and stringify it on the other (before verify
).
from credential.
Ah OK. That makes sense. From the description of hash
it says explicitly that it returns a JSON object, so I thought it would be stable. I'll change my database schema to simply accept a string.
Thanks for the quick reply!
from credential.
You're right, and I might be over-idealistic about it but unless you have some really good reason to, I'd not run the risk.
I'll close this for now, but feel free to follow up, I'll answer or reopen if necessary :)
from credential.
No problem at all, I can see the reasoning for it, and I'll hever used the password hash JSON directly, so it makes no difference to me.
It might be worth making this recommendation in the readme though, just in case.
from credential.
Related Issues (20)
- callback, promise or both HOT 10
- I can't make the cli work HOT 8
- What if an attacker know that I am using this library? HOT 9
- The use of "time" - a weakness worth noting? HOT 13
- Why hash() just return string rather than object? HOT 2
- fix failing CI server
- Does it really needs webpack? HOT 7
- Node v6 deprecation - "crypto.pbkdf2 without specifying a digest is deprecated" HOT 3
- Release v2.0.0 on npm HOT 3
- Support bcrypt hashing method? HOT 1
- performance optimisation HOT 4
- Make errors programmatically processable HOT 7
- Do not encourage people to write security issue in public places HOT 1
- Default number of iterations seems extreme HOT 2
- Due to the large number of iterations, Its consuming the full CPU usage. HOT 7
- Update deps, freshen code, release new major version. HOT 7
- Bad default settings HOT 4
- the 'verify' function takes too much time, about 1.3 seconds HOT 2
- Inconsistent use of bytes length/encodings? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from credential.