Your IP : 216.73.216.229


Current Path : /home/jeromecohp/www/plugins/system/yooessentials/modules/core/src/Encryption/
Upload File :
Current File : /home/jeromecohp/www/plugins/system/yooessentials/modules/core/src/Encryption/OpenSSLLibrary.php

<?php
/**
 * @package   Essentials YOOtheme Pro (Freemium) 2.0.19 build 1026.0920
 * @author    ZOOlanders https://www.zoolanders.com
 * @copyright Copyright (C) Joolanders, SL
 * @license   http://www.gnu.org/licenses/gpl.html GNU/GPL
 */

namespace ZOOlanders\YOOessentials\Encryption;

class OpenSSLLibrary extends Library
{
    public const CIPHER = 'AES-128-CBC';

    /**
     * @inheritdoc
     */
    public function encrypt($data, $key, $iv)
    {
        return openssl_encrypt($data, static::CIPHER, $key, 0, $iv);
    }

    /**
     * @inheritdoc
     */
    public function decrypt($data, $key, $iv)
    {
        return openssl_decrypt($data, static::CIPHER, $key, 0, $iv);
    }

    /**
     * @inheritdoc
     */
    public function generateIv()
    {
        return openssl_random_pseudo_bytes(openssl_cipher_iv_length(static::CIPHER));
    }
}