This repository has been archived by the owner on Feb 2, 2024. It is now read-only.
Make encrypting and decrypting progressive/async with streams #5
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.
Hey, this addition would make the ciphering process progressive.
We are investigating a performance issue (blocked UI thread) in our react-native app and thought that redux-persist-transform-encrypt was the culprit. In the end we think it turns out not to be the case. In the process, I've made this. I think it should be an improvement over the synchronous encrypt/decrypt
CryptoJS.AES
methods. Especially if you have a large state object, like we have in our app. Although at the moment, I have no way of actually testing the performance...I don't know what your code style preference is, there is a
class
and some arrow functions, which only work with node >=4.I would be happy to work on this some more and especially find out if there actually is a performance increase. The key thing would probably be knowing how redux-persist handles individual transforms. Can they be async/streams?
Also, I'm no SSL expert, so don't know the strength of the cipher used the derive the initialization vector for the encryptor. But I would suspect the strength of the
secretKey
is more important?Note: Works in react-native with rn-nodeify.