-
-
Notifications
You must be signed in to change notification settings - Fork 430
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
Webcrypto #111
Webcrypto #111
Conversation
It looks like you can't use a the web crypto API in a node module. So I don't think we can remove the crypto.js dependency from the CLI. |
@tarpdalton can't you continue to use crypto-js in the node module, but just change the code in the template HTML file to use the web crypto API (and fallback to asynchronously loading crypto-js if needed?) |
@epicfaace yeah we could do that. We would just have to make sure the something encrypted by crypto-js can be decrypted by webcrypto correctly |
I guess this can be revisited now since Node.js 15 has a Webcrypto module now. Current stable Node.js version is 16. Also there is this package: https://www.npmjs.com/package/node-webcrypto-ossl |
thats cool. yeah we should use the webcrypto api in the node, and then crypto-js can be fully removed |
i got the cli working with node webcrypto api. crypto-js is removed. I don't really use this lib so I can't test it out, but it worked for some simple things. Someone should test it out before it merges |
Hey @tarpdalton , thanks a lot for this big PR and my sincere apologies for taking so long to answer (3.5 years since you first opened it 🙄 ). It would be great to remove the I have two concerns:
I'll link to your fork in the readme in the meantime if some people want to use that version already. |
We now finally rely on WebCrypto in StatiCrypt! The code was merged in #164 , it's pretty noisy due to wanting to be as compatible as possible with 2.x custom templates, but it'll get much cleaner in 3.x (the WIP branch is already here). Thank you very much for opening and updating this PR over the years, it's been a good sanity check for me to read your approach here and useful for the final implementation. As a (very small) token of gratitude, I added your name in the "Thank you! 🙏" README section. Thanks! |
this removes the dependency on crypto.js and uses the webcrypto API. I haven't updated the CLI with the new logic, but I wanted to open this PR with what I had so far. #20