Giter Site home page Giter Site logo

Comments (8)

tjconcept avatar tjconcept commented on June 6, 2024
$ credential hash "test" --work 0.01
{"salt":"YTMazeNKJ12xRowgWSNFuiis4igrd5Ic4l202RMnh+9ikgfWhliTXgSLM8FzlzSfAqydVJO8j8UQhOHrM+YT8jJV","hash":"c2NilQ1y+tuFh/z65dG94J703cCWFdW0l5MqY4As8O9U36xbaIbS89R3JrlGPagUFCw1qJrPte4lGB2DH64GyHNl","keyLength":66,"hashMethod":"pbkdf2","iterations":2454}
$ credential verify '{"salt":"YTMazeNKJ12xRowgWSNFuiis4igrd5Ic4l202RMnh+9ikgfWhliTXgSLM8FzlzSfAqydVJO8j8UQhOHrM+YT8jJV","hash":"c2NilQ1y+tuFh/z65dG94J703cCWFdW0l5MqY4As8O9U36xbaIbS89R3JrlGPagUFCw1qJrPte4lGB2DH64GyHNl","keyLength":66,"hashMethod":"pbkdf2","iterations":2454}' "test"
Verified

Could it be an escaping issue? What is your result from:

$ TEST=$(credential hash test --work 0.01)
$ credential verify $TEST test

from credential.

mastilver avatar mastilver commented on June 6, 2024

I've just tried that:
verify '{"hash":"Bo8VvwqqJu0jC6aji9t/CBjFT52sYAaMpfuOZ88vIqB8ORhpGS4V21gSAYHM+GH3+IbZTkh8VnnMego1jgt6xga0","salt":"vnhth+OOghJy+rfdEddukuAZjthcM6sDPoeSfLWOoVpFctjEgsqAlJXVgI2QyIKizMllCY9hHtXjXPSfrwqtN/lW","keyLength":66,"hashMethod":"pbkdf2","iterations":245737}' password

I got back; [Error: Couldn't parse stored hash.]

I'm on a windows computer right now, I will try later on *unix

from credential.

tjconcept avatar tjconcept commented on June 6, 2024

Could you try logging the input when doing a verify? Somehow the JSON is missing or corrupted.

from credential.

mastilver avatar mastilver commented on June 6, 2024

so I've put: console.log(typeof hash, hash);

It displays me:
string {hash:Bo8VvwqqJu0jC6aji9t/CBjFT52sYAaMpfuOZ88vIqB8ORhpGS4V21gSAYHM+GH3+IbZTkh8VnnMego1jgt6xga0,salt:vnhth+OOghJy+rfdEddukuAZjthcM6sDPoeSfLWOoVpFctjEgsqAlJXVgI2QyIKizMllCY9hHtXjXPSfrwqtN/lW,keyLength:66,hashMethod:pbkdf2,iterations:245737}

from credential.

mastilver avatar mastilver commented on June 6, 2024

Could it be an escaping issue?

Must be that...
Can you think of a way to fix it without breaking *unix (I'm guessing it's working fine on *unix)

from credential.

tjconcept avatar tjconcept commented on June 6, 2024

Weird.. That string is not valid JSON because the " are missing. To me it seems like either your shell or something in between is doing bad stuff. At least I don't think it is a "code issue".

Could you try putting in something else with a " and see how it is received in Node? I don't have a Windows VM available atm. so I can't really debug.

from credential.

mastilver avatar mastilver commented on June 6, 2024

yep it's a windows issue (yet another one... ): http://stackoverflow.com/questions/7760545/cmd-escape-double-quotes-in-parameter
I should have check that earlier

from credential.

tjconcept avatar tjconcept commented on June 6, 2024

👍

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.