Hi guys I am wondering if anyone has experience using nodejs to decrypt fields from Salesforce using the encryptWithManagedIV.
I have tried implementing something from this post
How to decrypt AES-256 in node.js
But keep getting the invalid IV length:
for example this is what i did:
var crypto = require('crypto');
password = '6IAVE+56U5t7USZhb+9wCcqrTyJHqAu09j0t6fBngNo=';
var cryptoStr = 'lpGtzfMaWao1hYR9SkWFHvRnHMsDCsvAy6agp9gF8huK26qeOM/sr+0nVevlkREkmhfLts6TiwE6ZZ7fMLtzbw==';
var buf = new Buffer(cryptoStr, 'base64');
var iv = buf.slice(0, 16);
var crypt = buf.toString('base64');
var decipher = crypto.createDecipheriv('aes-256-cbc', new Buffer(password, 'base64'), iv);
decipher.setAutoPadding(false);
var dec = decipher.update(crypt, 'base64', 'utf-8');
dec += decipher.final('utf-8');
console.log('Decrypted content: ' + dec);