Encrypt and decrypt function from nodejs to java

i have a function like this write with javascript, how to i rewrite with JAVA ? i have try many function but still not working

const crypto = require('crypto');
const algorithm = 'aes-256-cbc';
const iv = Buffer.from('c080b0f7c7f8e7fbadfa74cda8ac0c29', "hex");
const key = crypto.createHash('sha256').update(String(process.env.ENCRYPTION_KEY)).digest('base64');
const key_in_bytes = Buffer.from(key, 'base64')

const controller = {}

controller.encrypt = (text) => {

    let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(key_in_bytes), iv);
    let encrypted = cipher.update(text);
    encrypted = Buffer.concat([encrypted, cipher.final()]);
    return encrypted.toString('hex').toString();
}

controller.decrypt = (text) => {
    let encryptedText = Buffer.from(text, 'hex');
    let decipher = crypto.createDecipheriv('aes-256-cbc', Buffer.from(key_in_bytes), iv);
    let decrypted = decipher.update(encryptedText);
    decrypted = Buffer.concat([decrypted, decipher.final()]);
    return decrypted.toString();
}

module.exports = controller