测试:用Java测试 源码
const crypto = require('crypto'); const algorithm ='aes-256-cbc'; const key = crypto.randomBytes(32); const iv = crypto.randomBytes(16); 函数crypto(text){let cipher = crypto.createCipheriv('aes-256-cbc',Buffer.from(key),iv); 让加密= cipher.update(text); 已加密= Buffer.concat([encrypted,cipher.final()]); 返回
用户评论