Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This brings support for webcrypto and switching from cryptojs to webcrypto implementation. Switching to WebCrypto should be :
This is heavily inspired by #139 (thank you very much for that PR @hurrymaplelad , it has been very useful!), and edited for backward compatibility. The PR also detects which password_template version the user is running, and tries to nudge them towards using WebCrypto.
Trying to make everything as backward compatible as possible makes the code sort of a mess and hard to reason about, but I wanted to put out something that could use WebCrypto in version 2.x so people can be nudged towards it. This will be the last update in 2.x appart from bugfixes, next will be a lot of clean up working towards 3.x, where I have a few nice ideas for improvement.
Anyone can feel free to review this and comment, especially the
webcryptoEngine.js
part. I'll do some more tests and merge in a short while.