如何在 Java 中实现以下 Node.js 函数?
function encrypt(text)
{
var crypto = require('crypto');
var cipher = crypto.createCipher('aes-256-cbc','my-password')
var crypted = cipher.update(text,'utf8','hex')
crypted += cipher.final('hex');
return crypted;
}
我读过crypto从密码中派生密钥和iv,但我不知道如何用Java做到这一点。
谢谢。