1
爲什麼不打印「你好」?節點加密 - 無法反向加密
var cipher = crypto.createCipheriv('rc4', 'secret', '');
crypt = cipher.update('hello', 'binary', 'utf8');
crypt += cipher.final('utf8');
var decipher = crypto.createDecipheriv('rc4','secret', '');
data = decipher.update(crypt, 'binary', 'utf8');
data += decipher.final('utf8');
console.log(data); // prints e/l
不。拋出「AssertionError:無法更改編碼」錯誤 – cyberwombat
對不起,沒有更改cipher.update。編輯我的答案,試試看。 – AronVietti