Contao3-Ninja / contao-cron

Contao CRON Scheduler
GNU Lesser General Public License v3.0
1 stars 1 forks source link

phpseclib Erweiterung verwenden in der eigenen Encrypt Klasse #18

Open BugBuster1701 opened 10 years ago

BugBuster1701 commented 10 years ago

sample...

    public function __construct()
    {
        if (!file_exists(TL_ROOT . '/system/modules/phpseclib/Crypt/AES.php'))
        {
            throw new Exception("Missing AES plugin in '/system/modules/phpseclib/Crypt/AES.php'");
        }
       else
       {
              include_once(TL_ROOT . '/system/modules/phpseclib/Crypt/AES.php');
       }
    }

    public function Encrypt($text,$strKey)
    {
        $this->objAES = new \Crypt_AES();
        $this->objAES->setKey($strKey);
        return $this->objAES->encrypt($text);
    }

    public function Decrypt($text,$strKey)
    {
        $this->objAES = new \Crypt_AES();
        $this->objAES->setKey($this->strKey);
        return $this->objAES->decrypt($text);
    }