HEX
Server: Apache/2.4.57 (Unix) OpenSSL/1.1.1k
System: Linux tam.zee-supreme-vps.net 4.18.0-513.9.1.el8_9.x86_64 #1 SMP Sat Dec 2 05:23:44 EST 2023 x86_64
User: adltc (1070)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/adltc/public_html/wp-content/plugins/rometheme-for-elementor/libs/AES256/aes.php
<?php

namespace Rometheme;

use RomeTheme;

if(!class_exists('RomeTheme\AES256')) {
    class AES256 {
        private $key;
        private $iv;
    
        public function __construct($key, $iv) {
            $this->key = hash('sha256', $key, true);
            $this->iv = substr(hash('sha256', $iv, true), 0, 16); // Mengambil 16 byte pertama dari hash IV
        }
    
        public function encrypt($data) {
            $encryptedData = openssl_encrypt($data, 'aes-256-cbc', $this->key, OPENSSL_RAW_DATA, $this->iv);
            return base64_encode($encryptedData);
        }
    
        public function decrypt($data) {
            $encryptedData = base64_decode($data);
            return openssl_decrypt($encryptedData, 'aes-256-cbc', $this->key, OPENSSL_RAW_DATA, $this->iv);
        }
    
    }
}