Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to NodeJS #55

Open
ChrisKader opened this issue Oct 7, 2019 · 5 comments
Open

Port to NodeJS #55

ChrisKader opened this issue Oct 7, 2019 · 5 comments

Comments

@ChrisKader
Copy link

Is there a documented spec you follow anywhere? I would like to bring this to NodeJS but I am not familiar enough with C to just straight port from C to JS

@paulodiovani
Copy link
Contributor

There shouldn't be easy to find the RSA spec to create a Node.js stoken implementation. But if you just need to add RSA capabilities to a Node app, you could instead:

  • Look for an existing RSA package (https://www.npmjs.com/search?q=rsa)
  • Implement a Node.js module in C++ based in stoken
  • Use stoken command line from a Node app woth child_process

@ChrisKader
Copy link
Author

There shouldn't be easy to find the RSA spec to create a Node.js stoken implementation. But if you just need to add RSA capabilities to a Node app, you could instead:

  • Look for an existing RSA package (https://www.npmjs.com/search?q=rsa)
  • Implement a Node.js module in C++ based in stoken
  • Use stoken command line from a Node app woth child_process
  1. From my searching, there is no library in node that does what this does (or what stoken does).

  2. I have tried using various tools but my lack of understanding of C++ does not allow for me to really take this approach. This also limits me to certain operating systems and I would like to make the library OS agnostic.

  3. I would like to port the C++ version to nodeJS. Building a wrapper around the stoken command prompt limits it to a very small subset of operating systems.

If I can get a basic understanding of whats done with critical elements from in the below flow, I can implement this in a pure nodeJS Library.

  • Token Import
    • XML or otherwise
  • Storage
    • What fields are critical and are needed to generate new PINs?
    • What fields can not be stored if export functionality is not desired, ect?
  • PIN Generation
    • What algorithms are used in combination with the user supplied PIN to generate a token
    • What timestamp is used?
      • EPOCH, Local, ect.

@tigrouind
Copy link

tigrouind commented Jan 14, 2020

@ChrisKader : I am looking for same things as you (a node.js port and possible documentation).
Node.js modules already implement many cryptographic functions like pbkdf2, hmac, ... so task should be easier than it looks.

EDIT : there is .NET port of this library called ursa. This is probably easier to read than C.

@ChrisKader
Copy link
Author

@tigrouind thank you! You are right, it is a lot easier to understand!

@ChrisKader
Copy link
Author

@ChrisKader : I am looking for same things as you (a node.js port and possible documentation).
Node.js modules already implement many cryptographic functions like pbkdf2, hmac, ... so task should be easier than it looks.

EDIT : there is .NET port of this library called ursa. This is probably easier to read than C.

I was able to successfully get this going on nodeJS my using the URSA project along with the original stoken library.

I am hoping I can get the stokenjs name on NPM as mine is an actual hand coded port with all functionality versus a "WASM" compiled version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants