How could I implement the following Node.js function in Java?
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;
}
I've read that crypto derives the key and iv from password but I don't know how to do that with Java.
Thanks.
 
     
    