When I run this Ruby program:
```rb
require 'base64'
require 'openssl'
aes = OpenSSL::Cipher::Cipher.new('AES-128-ECB')
aes.encrypt
aes.key = 'YELLOW SUBMARINE'
puts Base64.encode64(aes.update('yolo') + aes.final)
```
It prints "VznnoI/h3t03+40Igt+mtQ==". However, when I run this Node program:
```js
var crypto = require('crypto');
var message = 'VznnoI/h3t03+40Igt+mtQ==',
cipher = crypto.createDecipher('aes-128-ecb', 'YELLOW SUBMARINE');
console.log(cipher.update(message, 'base64', 'utf8') +
cipher.final('utf8'));
```
I get an error trying to decrypt the message, using the same cipher mode
and key. What am I missing?
--
James Coglan
http://jcoglan.com
+44 (0) 7771512510
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.