You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
In it, cesare created both a ruby and node encryption routines that yielded the same results at this comment #1395 (comment) . I am not seeing the same. When I run the ruby, I do see
Encoded length: 48
Encoded in Base64: ux+Flze2MzL1gvrXVvhmow7SukcIrWfg7MGbWmKvLe1lDoOe5IgaKEahwh1c1Nfm
But when I run the node version, I see:
Encoded length: 47
Encoded in Base64: /R/9/Tf9MzL9/f39Vv1m/Q66Rwj9Z/39/f1aYv0t/WUO/f39/RooRv39HVz9/f0=
I'm using Ruby 1.9.3/2.0 and node v0.10.15.
I'm wondering if something regressed or was there a change that I need to incorporate into the node version that I'm missing?
@scottam, Since version 0.9.3, default output format for encipher.update and encipher.final methods is "Buffer" format, so use Buffer concat method instead of concatenation string. In previous node versions, default format for those methods was "binary".
1ed4c6 -> crypto: Default to buffers instead of binary strings (isaacs, Fedor Indutny)
What @Math- said, Cipher#update() and Cipher#final() return buffers by default now. Either pick a different encoding or use Buffer.concat() to concatenate them. Implicit stringification of the buffer with += doesn't usually produce the expected results.
This is related to issue #1395 .
In it, cesare created both a ruby and node encryption routines that yielded the same results at this comment #1395 (comment) . I am not seeing the same. When I run the ruby, I do see
Encoded length: 48
Encoded in Base64: ux+Flze2MzL1gvrXVvhmow7SukcIrWfg7MGbWmKvLe1lDoOe5IgaKEahwh1c1Nfm
But when I run the node version, I see:
Encoded length: 47
Encoded in Base64: /R/9/Tf9MzL9/f39Vv1m/Q66Rwj9Z/39/f1aYv0t/WUO/f39/RooRv39HVz9/f0=
I'm using Ruby 1.9.3/2.0 and node v0.10.15.
I'm wondering if something regressed or was there a change that I need to incorporate into the node version that I'm missing?
Ruby Gist found here https://gist.github.com/scotttam/6542931
Node Gist found here: https://gist.github.com/scotttam/6542922
Thanks,
Scott
The text was updated successfully, but these errors were encountered: