-
Notifications
You must be signed in to change notification settings - Fork 98
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
Node vs Browser implementations incompatibility? #81
Comments
@fredeno did you ever find a solution to this? |
@ArjunRajJain No news about this problem unfortunately. |
We are opening this new issue following this question on Bad MAC errors occurring sometimes when decrypting data : #63
Indeed we are facing this problem in our application. Sometimes data encrypted in the browser can't be decrypted in Node.js, sometimes data encrypted in Node.js can't be decrypted by the browser. This happens around once for 300 occurrences.
In our case, eccrypto is used classically in a Node.js backend application and also used in a React web application with the help of browserify and Node Buffer API for browser (https://github.com/feross/buffer) so that the same code can run on both environments.
We are reaching the step where we think it is an eccrypto incompatibility between browser and Node implementations but that still may be in the way we use it…
We managed to reproduce the behavior with this code :
First we execute multipleEncrypt(300) in Node.js which encrypts 300 times the same data with the same key and parameters.
Then we inject the resulting array of values in this code to execute it in the web application:
When run in the browser, all values are decrypted except one (the second one in this example) for which we get a "Bad MAC" error.
We have the same behavior when encrypting in browser and decrypting in Node.js. But when we force to use the eccrypto browser implementation in Node.js, that works perfectly! This is an interesting workaround but not very satisfying and this alternative is only available on Node anyway…
Is there something to fix in eccrypto or in the way we use it?
Thanks in advance for your help.
The text was updated successfully, but these errors were encountered: