level 2
var decipher = crypto.createDecipheriv('AES-256-ECB', key,iv);
这个iv参数是一个什么意思! 目前理解是指我的key长度不够32位, 这个iv作为补充? 请问那位大兄弟用NODE做过这个退款的回调!!谢谢了
2018年09月04日 16点09分
1
level 1
exports.decrypto_wxrefund = function (data, mch_key) {
var md5 = crypto.createHash('md5'),
clearEncoding = 'utf8',
cipherEncoding = 'base64',
cipherChunks = [];
let md5key = md5.update(mch_key).digest('hex').toLowerCase();
let decipher = crypto.createDecipheriv('aes-256-ecb', md5key, '');
decipher.setAutoPadding(true);
cipherChunks.push(decipher.update(data, cipherEncoding, clearEncoding));
cipherChunks.push(decipher.final(clearEncoding));
//console.log(cipherChunks.join(''));
return cipherChunks.join('');
};
2018年09月25日 11点09分
5