Use native aes-128-gcm support in Node 4 rather than npm-node-aes-gcm package #7548
Conversation
decipher.setAuthTag(new Buffer(ciphertext.authTag, "base64")); | ||
var chunks = [decipher.update( | ||
new Buffer(ciphertext.ciphertext, "base64"))]; | ||
chunks.push(decipher.final()); |
glasser
Aug 2, 2016
Member
Not clear to me at which step crypto throws or otherwise indicates decryption or authentication errors but it looks like this change does affect how errors are detected? Or do you need to add an error handler?
Not clear to me at which step crypto throws or otherwise indicates decryption or authentication errors but it looks like this change does affect how errors are detected? Or do you need to add an error handler?
glasser
Aug 2, 2016
Member
Oh never mind. I remembered that we tried to remove details from errors but not how it was implemented. Should be fine.
Oh never mind. I remembered that we tried to remove details from errors but not how it was implemented. Should be fine.
benjamn
Aug 2, 2016
Author
Member
For what it's worth, my understanding is that (de)cipher.final()
throws if there are encryption/decryption errors.
For what it's worth, my understanding is that (de)cipher.final()
throws if there are encryption/decryption errors.
There's also a no longer accurate comment in encrypt.js saying that the crypto API doesn't support AAD. Though I doubt we actually want to incur the compatibility issues of changing to follow the suggestion there. |
benjamn
added a commit
that referenced
this pull request
Aug 2, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Inspired by this comment from @glasser.