!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/smm.picotech.app/public_html/vendor/phpseclib/phpseclib/phpseclib/Crypt/   drwxr-xr-x
Free 28.53 GB of 117.98 GB (24.18%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     DES.php (67.18 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/**
 * Pure-PHP implementation of DES.
 *
 * Uses mcrypt, if available, and an internal implementation, otherwise.
 *
 * PHP version 5
 *
 * Useful resources are as follows:
 *
 *  - {@link http://en.wikipedia.org/wiki/DES_supplementary_material Wikipedia: DES supplementary material}
 *  - {@link http://www.itl.nist.gov/fipspubs/fip46-2.htm FIPS 46-2 - (DES), Data Encryption Standard}
 *  - {@link http://www.cs.eku.edu/faculty/styer/460/Encrypt/JS-DES.html JavaScript DES Example}
 *
 * Here's a short example of how to use this library:
 * <code>
 * <?php
 *    include 'vendor/autoload.php';
 *
 *    $des = new \phpseclib3\Crypt\DES('ctr');
 *
 *    $des->setKey('abcdefgh');
 *
 *    $size = 10 * 1024;
 *    $plaintext = '';
 *    for ($i = 0; $i < $size; $i++) {
 *        $plaintext.= 'a';
 *    }
 *
 *    echo $des->decrypt($des->encrypt($plaintext));
 * ?>
 * </code>
 *
 * @author    Jim Wigginton <terrafrost@php.net>
 * @copyright 2007 Jim Wigginton
 * @license   http://www.opensource.org/licenses/mit-license.html  MIT License
 * @link      http://phpseclib.sourceforge.net
 */

namespace phpseclib3\Crypt;

use 
phpseclib3\Crypt\Common\BlockCipher;
use 
phpseclib3\Exception\BadModeException;

/**
 * Pure-PHP implementation of DES.
 *
 * @author  Jim Wigginton <terrafrost@php.net>
 */
class DES extends BlockCipher
{
    
/**
     * Contains $keys[self::ENCRYPT]
     *
     * @see \phpseclib3\Crypt\DES::setupKey()
     * @see \phpseclib3\Crypt\DES::processBlock()
     */
    
const ENCRYPT 0;
    
/**
     * Contains $keys[self::DECRYPT]
     *
     * @see \phpseclib3\Crypt\DES::setupKey()
     * @see \phpseclib3\Crypt\DES::processBlock()
     */
    
const DECRYPT 1;

    
/**
     * Block Length of the cipher
     *
     * @see \phpseclib3\Crypt\Common\SymmetricKey::block_size
     * @var int
     */
    
protected $block_size 8;

    
/**
     * Key Length (in bytes)
     *
     * @see \phpseclib3\Crypt\Common\SymmetricKey::setKeyLength()
     * @var int
     */
    
protected $key_length 8;

    
/**
     * The mcrypt specific name of the cipher
     *
     * @see \phpseclib3\Crypt\Common\SymmetricKey::cipher_name_mcrypt
     * @var string
     */
    
protected $cipher_name_mcrypt 'des';

    
/**
     * The OpenSSL names of the cipher / modes
     *
     * @see \phpseclib3\Crypt\Common\SymmetricKey::openssl_mode_names
     * @var array
     */
    
protected $openssl_mode_names = [
        
self::MODE_ECB => 'des-ecb',
        
self::MODE_CBC => 'des-cbc',
        
self::MODE_CFB => 'des-cfb',
        
self::MODE_OFB => 'des-ofb'
        
// self::MODE_CTR is undefined for DES
    
];

    
/**
     * Optimizing value while CFB-encrypting
     *
     * @see \phpseclib3\Crypt\Common\SymmetricKey::cfb_init_len
     * @var int
     */
    
protected $cfb_init_len 500;

    
/**
     * Switch for DES/3DES encryption
     *
     * Used only if $engine == self::ENGINE_INTERNAL
     *
     * @see self::setupKey()
     * @see self::processBlock()
     * @var int
     */
    
protected $des_rounds 1;

    
/**
     * max possible size of $key
     *
     * @see self::setKey()
     * @var string
     */
    
protected $key_length_max 8;

    
/**
     * The Key Schedule
     *
     * @see self::setupKey()
     * @var array
     */
    
private $keys;

    
/**
     * Key Cache "key"
     *
     * @see self::setupKey()
     * @var array
     */
    
private $kl;

    
/**
     * Shuffle table.
     *
     * For each byte value index, the entry holds an 8-byte string
     * with each byte containing all bits in the same state as the
     * corresponding bit in the index value.
     *
     * @see self::processBlock()
     * @see self::setupKey()
     * @var array
     */
    
protected static $shuffle = [
        
"\x00\x00\x00\x00\x00\x00\x00\x00""\x00\x00\x00\x00\x00\x00\x00\xFF",
        
"\x00\x00\x00\x00\x00\x00\xFF\x00""\x00\x00\x00\x00\x00\x00\xFF\xFF",
        
"\x00\x00\x00\x00\x00\xFF\x00\x00""\x00\x00\x00\x00\x00\xFF\x00\xFF",
        
"\x00\x00\x00\x00\x00\xFF\xFF\x00""\x00\x00\x00\x00\x00\xFF\xFF\xFF",
        
"\x00\x00\x00\x00\xFF\x00\x00\x00""\x00\x00\x00\x00\xFF\x00\x00\xFF",
        
"\x00\x00\x00\x00\xFF\x00\xFF\x00""\x00\x00\x00\x00\xFF\x00\xFF\xFF",
        
"\x00\x00\x00\x00\xFF\xFF\x00\x00""\x00\x00\x00\x00\xFF\xFF\x00\xFF",
        
"\x00\x00\x00\x00\xFF\xFF\xFF\x00""\x00\x00\x00\x00\xFF\xFF\xFF\xFF",
        
"\x00\x00\x00\xFF\x00\x00\x00\x00""\x00\x00\x00\xFF\x00\x00\x00\xFF",
        
"\x00\x00\x00\xFF\x00\x00\xFF\x00""\x00\x00\x00\xFF\x00\x00\xFF\xFF",
        
"\x00\x00\x00\xFF\x00\xFF\x00\x00""\x00\x00\x00\xFF\x00\xFF\x00\xFF",
        
"\x00\x00\x00\xFF\x00\xFF\xFF\x00""\x00\x00\x00\xFF\x00\xFF\xFF\xFF",
        
"\x00\x00\x00\xFF\xFF\x00\x00\x00""\x00\x00\x00\xFF\xFF\x00\x00\xFF",
        
"\x00\x00\x00\xFF\xFF\x00\xFF\x00""\x00\x00\x00\xFF\xFF\x00\xFF\xFF",
        
"\x00\x00\x00\xFF\xFF\xFF\x00\x00""\x00\x00\x00\xFF\xFF\xFF\x00\xFF",
        
"\x00\x00\x00\xFF\xFF\xFF\xFF\x00""\x00\x00\x00\xFF\xFF\xFF\xFF\xFF",
        
"\x00\x00\xFF\x00\x00\x00\x00\x00""\x00\x00\xFF\x00\x00\x00\x00\xFF",
        
"\x00\x00\xFF\x00\x00\x00\xFF\x00""\x00\x00\xFF\x00\x00\x00\xFF\xFF",
        
"\x00\x00\xFF\x00\x00\xFF\x00\x00""\x00\x00\xFF\x00\x00\xFF\x00\xFF",
        
"\x00\x00\xFF\x00\x00\xFF\xFF\x00""\x00\x00\xFF\x00\x00\xFF\xFF\xFF",
        
"\x00\x00\xFF\x00\xFF\x00\x00\x00""\x00\x00\xFF\x00\xFF\x00\x00\xFF",
        
"\x00\x00\xFF\x00\xFF\x00\xFF\x00""\x00\x00\xFF\x00\xFF\x00\xFF\xFF",
        
"\x00\x00\xFF\x00\xFF\xFF\x00\x00""\x00\x00\xFF\x00\xFF\xFF\x00\xFF",
        
"\x00\x00\xFF\x00\xFF\xFF\xFF\x00""\x00\x00\xFF\x00\xFF\xFF\xFF\xFF",
        
"\x00\x00\xFF\xFF\x00\x00\x00\x00""\x00\x00\xFF\xFF\x00\x00\x00\xFF",
        
"\x00\x00\xFF\xFF\x00\x00\xFF\x00""\x00\x00\xFF\xFF\x00\x00\xFF\xFF",
        
"\x00\x00\xFF\xFF\x00\xFF\x00\x00""\x00\x00\xFF\xFF\x00\xFF\x00\xFF",
        
"\x00\x00\xFF\xFF\x00\xFF\xFF\x00""\x00\x00\xFF\xFF\x00\xFF\xFF\xFF",
        
"\x00\x00\xFF\xFF\xFF\x00\x00\x00""\x00\x00\xFF\xFF\xFF\x00\x00\xFF",
        
"\x00\x00\xFF\xFF\xFF\x00\xFF\x00""\x00\x00\xFF\xFF\xFF\x00\xFF\xFF",
        
"\x00\x00\xFF\xFF\xFF\xFF\x00\x00""\x00\x00\xFF\xFF\xFF\xFF\x00\xFF",
        
"\x00\x00\xFF\xFF\xFF\xFF\xFF\x00""\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF",
        
"\x00\xFF\x00\x00\x00\x00\x00\x00""\x00\xFF\x00\x00\x00\x00\x00\xFF",
        
"\x00\xFF\x00\x00\x00\x00\xFF\x00""\x00\xFF\x00\x00\x00\x00\xFF\xFF",
        
"\x00\xFF\x00\x00\x00\xFF\x00\x00""\x00\xFF\x00\x00\x00\xFF\x00\xFF",
        
"\x00\xFF\x00\x00\x00\xFF\xFF\x00""\x00\xFF\x00\x00\x00\xFF\xFF\xFF",
        
"\x00\xFF\x00\x00\xFF\x00\x00\x00""\x00\xFF\x00\x00\xFF\x00\x00\xFF",
        
"\x00\xFF\x00\x00\xFF\x00\xFF\x00""\x00\xFF\x00\x00\xFF\x00\xFF\xFF",
        
"\x00\xFF\x00\x00\xFF\xFF\x00\x00""\x00\xFF\x00\x00\xFF\xFF\x00\xFF",
        
"\x00\xFF\x00\x00\xFF\xFF\xFF\x00""\x00\xFF\x00\x00\xFF\xFF\xFF\xFF",
        
"\x00\xFF\x00\xFF\x00\x00\x00\x00""\x00\xFF\x00\xFF\x00\x00\x00\xFF",
        
"\x00\xFF\x00\xFF\x00\x00\xFF\x00""\x00\xFF\x00\xFF\x00\x00\xFF\xFF",
        
"\x00\xFF\x00\xFF\x00\xFF\x00\x00""\x00\xFF\x00\xFF\x00\xFF\x00\xFF",
        
"\x00\xFF\x00\xFF\x00\xFF\xFF\x00""\x00\xFF\x00\xFF\x00\xFF\xFF\xFF",
        
"\x00\xFF\x00\xFF\xFF\x00\x00\x00""\x00\xFF\x00\xFF\xFF\x00\x00\xFF",
        
"\x00\xFF\x00\xFF\xFF\x00\xFF\x00""\x00\xFF\x00\xFF\xFF\x00\xFF\xFF",
        
"\x00\xFF\x00\xFF\xFF\xFF\x00\x00""\x00\xFF\x00\xFF\xFF\xFF\x00\xFF",
        
"\x00\xFF\x00\xFF\xFF\xFF\xFF\x00""\x00\xFF\x00\xFF\xFF\xFF\xFF\xFF",
        
"\x00\xFF\xFF\x00\x00\x00\x00\x00""\x00\xFF\xFF\x00\x00\x00\x00\xFF",
        
"\x00\xFF\xFF\x00\x00\x00\xFF\x00""\x00\xFF\xFF\x00\x00\x00\xFF\xFF",
        
"\x00\xFF\xFF\x00\x00\xFF\x00\x00""\x00\xFF\xFF\x00\x00\xFF\x00\xFF",
        
"\x00\xFF\xFF\x00\x00\xFF\xFF\x00""\x00\xFF\xFF\x00\x00\xFF\xFF\xFF",
        
"\x00\xFF\xFF\x00\xFF\x00\x00\x00""\x00\xFF\xFF\x00\xFF\x00\x00\xFF",
        
"\x00\xFF\xFF\x00\xFF\x00\xFF\x00""\x00\xFF\xFF\x00\xFF\x00\xFF\xFF",
        
"\x00\xFF\xFF\x00\xFF\xFF\x00\x00""\x00\xFF\xFF\x00\xFF\xFF\x00\xFF",
        
"\x00\xFF\xFF\x00\xFF\xFF\xFF\x00""\x00\xFF\xFF\x00\xFF\xFF\xFF\xFF",
        
"\x00\xFF\xFF\xFF\x00\x00\x00\x00""\x00\xFF\xFF\xFF\x00\x00\x00\xFF",
        
"\x00\xFF\xFF\xFF\x00\x00\xFF\x00""\x00\xFF\xFF\xFF\x00\x00\xFF\xFF",
        
"\x00\xFF\xFF\xFF\x00\xFF\x00\x00""\x00\xFF\xFF\xFF\x00\xFF\x00\xFF",
        
"\x00\xFF\xFF\xFF\x00\xFF\xFF\x00""\x00\xFF\xFF\xFF\x00\xFF\xFF\xFF",
        
"\x00\xFF\xFF\xFF\xFF\x00\x00\x00""\x00\xFF\xFF\xFF\xFF\x00\x00\xFF",
        
"\x00\xFF\xFF\xFF\xFF\x00\xFF\x00""\x00\xFF\xFF\xFF\xFF\x00\xFF\xFF",
        
"\x00\xFF\xFF\xFF\xFF\xFF\x00\x00""\x00\xFF\xFF\xFF\xFF\xFF\x00\xFF",
        
"\x00\xFF\xFF\xFF\xFF\xFF\xFF\x00""\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF",
        
"\xFF\x00\x00\x00\x00\x00\x00\x00""\xFF\x00\x00\x00\x00\x00\x00\xFF",
        
"\xFF\x00\x00\x00\x00\x00\xFF\x00""\xFF\x00\x00\x00\x00\x00\xFF\xFF",
        
"\xFF\x00\x00\x00\x00\xFF\x00\x00""\xFF\x00\x00\x00\x00\xFF\x00\xFF",
        
"\xFF\x00\x00\x00\x00\xFF\xFF\x00""\xFF\x00\x00\x00\x00\xFF\xFF\xFF",
        
"\xFF\x00\x00\x00\xFF\x00\x00\x00""\xFF\x00\x00\x00\xFF\x00\x00\xFF",
        
"\xFF\x00\x00\x00\xFF\x00\xFF\x00""\xFF\x00\x00\x00\xFF\x00\xFF\xFF",
        
"\xFF\x00\x00\x00\xFF\xFF\x00\x00""\xFF\x00\x00\x00\xFF\xFF\x00\xFF",
        
"\xFF\x00\x00\x00\xFF\xFF\xFF\x00""\xFF\x00\x00\x00\xFF\xFF\xFF\xFF",
        
"\xFF\x00\x00\xFF\x00\x00\x00\x00""\xFF\x00\x00\xFF\x00\x00\x00\xFF",
        
"\xFF\x00\x00\xFF\x00\x00\xFF\x00""\xFF\x00\x00\xFF\x00\x00\xFF\xFF",
        
"\xFF\x00\x00\xFF\x00\xFF\x00\x00""\xFF\x00\x00\xFF\x00\xFF\x00\xFF",
        
"\xFF\x00\x00\xFF\x00\xFF\xFF\x00""\xFF\x00\x00\xFF\x00\xFF\xFF\xFF",
        
"\xFF\x00\x00\xFF\xFF\x00\x00\x00""\xFF\x00\x00\xFF\xFF\x00\x00\xFF",
        
"\xFF\x00\x00\xFF\xFF\x00\xFF\x00""\xFF\x00\x00\xFF\xFF\x00\xFF\xFF",
        
"\xFF\x00\x00\xFF\xFF\xFF\x00\x00""\xFF\x00\x00\xFF\xFF\xFF\x00\xFF",
        
"\xFF\x00\x00\xFF\xFF\xFF\xFF\x00""\xFF\x00\x00\xFF\xFF\xFF\xFF\xFF",
        
"\xFF\x00\xFF\x00\x00\x00\x00\x00""\xFF\x00\xFF\x00\x00\x00\x00\xFF",
        
"\xFF\x00\xFF\x00\x00\x00\xFF\x00""\xFF\x00\xFF\x00\x00\x00\xFF\xFF",
        
"\xFF\x00\xFF\x00\x00\xFF\x00\x00""\xFF\x00\xFF\x00\x00\xFF\x00\xFF",
        
"\xFF\x00\xFF\x00\x00\xFF\xFF\x00""\xFF\x00\xFF\x00\x00\xFF\xFF\xFF",
        
"\xFF\x00\xFF\x00\xFF\x00\x00\x00""\xFF\x00\xFF\x00\xFF\x00\x00\xFF",
        
"\xFF\x00\xFF\x00\xFF\x00\xFF\x00""\xFF\x00\xFF\x00\xFF\x00\xFF\xFF",
        
"\xFF\x00\xFF\x00\xFF\xFF\x00\x00""\xFF\x00\xFF\x00\xFF\xFF\x00\xFF",
        
"\xFF\x00\xFF\x00\xFF\xFF\xFF\x00""\xFF\x00\xFF\x00\xFF\xFF\xFF\xFF",
        
"\xFF\x00\xFF\xFF\x00\x00\x00\x00""\xFF\x00\xFF\xFF\x00\x00\x00\xFF",
        
"\xFF\x00\xFF\xFF\x00\x00\xFF\x00""\xFF\x00\xFF\xFF\x00\x00\xFF\xFF",
        
"\xFF\x00\xFF\xFF\x00\xFF\x00\x00""\xFF\x00\xFF\xFF\x00\xFF\x00\xFF",
        
"\xFF\x00\xFF\xFF\x00\xFF\xFF\x00""\xFF\x00\xFF\xFF\x00\xFF\xFF\xFF",
        
"\xFF\x00\xFF\xFF\xFF\x00\x00\x00""\xFF\x00\xFF\xFF\xFF\x00\x00\xFF",
        
"\xFF\x00\xFF\xFF\xFF\x00\xFF\x00""\xFF\x00\xFF\xFF\xFF\x00\xFF\xFF",
        
"\xFF\x00\xFF\xFF\xFF\xFF\x00\x00""\xFF\x00\xFF\xFF\xFF\xFF\x00\xFF",
        
"\xFF\x00\xFF\xFF\xFF\xFF\xFF\x00""\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF",
        
"\xFF\xFF\x00\x00\x00\x00\x00\x00""\xFF\xFF\x00\x00\x00\x00\x00\xFF",
        
"\xFF\xFF\x00\x00\x00\x00\xFF\x00""\xFF\xFF\x00\x00\x00\x00\xFF\xFF",
        
"\xFF\xFF\x00\x00\x00\xFF\x00\x00""\xFF\xFF\x00\x00\x00\xFF\x00\xFF",
        
"\xFF\xFF\x00\x00\x00\xFF\xFF\x00""\xFF\xFF\x00\x00\x00\xFF\xFF\xFF",
        
"\xFF\xFF\x00\x00\xFF\x00\x00\x00""\xFF\xFF\x00\x00\xFF\x00\x00\xFF",
        
"\xFF\xFF\x00\x00\xFF\x00\xFF\x00""\xFF\xFF\x00\x00\xFF\x00\xFF\xFF",
        
"\xFF\xFF\x00\x00\xFF\xFF\x00\x00""\xFF\xFF\x00\x00\xFF\xFF\x00\xFF",
        
"\xFF\xFF\x00\x00\xFF\xFF\xFF\x00""\xFF\xFF\x00\x00\xFF\xFF\xFF\xFF",
        
"\xFF\xFF\x00\xFF\x00\x00\x00\x00""\xFF\xFF\x00\xFF\x00\x00\x00\xFF",
        
"\xFF\xFF\x00\xFF\x00\x00\xFF\x00""\xFF\xFF\x00\xFF\x00\x00\xFF\xFF",
        
"\xFF\xFF\x00\xFF\x00\xFF\x00\x00""\xFF\xFF\x00\xFF\x00\xFF\x00\xFF",
        
"\xFF\xFF\x00\xFF\x00\xFF\xFF\x00""\xFF\xFF\x00\xFF\x00\xFF\xFF\xFF",
        
"\xFF\xFF\x00\xFF\xFF\x00\x00\x00""\xFF\xFF\x00\xFF\xFF\x00\x00\xFF",
        
"\xFF\xFF\x00\xFF\xFF\x00\xFF\x00""\xFF\xFF\x00\xFF\xFF\x00\xFF\xFF",
        
"\xFF\xFF\x00\xFF\xFF\xFF\x00\x00""\xFF\xFF\x00\xFF\xFF\xFF\x00\xFF",
        
"\xFF\xFF\x00\xFF\xFF\xFF\xFF\x00""\xFF\xFF\x00\xFF\xFF\xFF\xFF\xFF",
        
"\xFF\xFF\xFF\x00\x00\x00\x00\x00""\xFF\xFF\xFF\x00\x00\x00\x00\xFF",
        
"\xFF\xFF\xFF\x00\x00\x00\xFF\x00""\xFF\xFF\xFF\x00\x00\x00\xFF\xFF",
        
"\xFF\xFF\xFF\x00\x00\xFF\x00\x00""\xFF\xFF\xFF\x00\x00\xFF\x00\xFF",
        
"\xFF\xFF\xFF\x00\x00\xFF\xFF\x00""\xFF\xFF\xFF\x00\x00\xFF\xFF\xFF",
        
"\xFF\xFF\xFF\x00\xFF\x00\x00\x00""\xFF\xFF\xFF\x00\xFF\x00\x00\xFF",
        
"\xFF\xFF\xFF\x00\xFF\x00\xFF\x00""\xFF\xFF\xFF\x00\xFF\x00\xFF\xFF",
        
"\xFF\xFF\xFF\x00\xFF\xFF\x00\x00""\xFF\xFF\xFF\x00\xFF\xFF\x00\xFF",
        
"\xFF\xFF\xFF\x00\xFF\xFF\xFF\x00""\xFF\xFF\xFF\x00\xFF\xFF\xFF\xFF",
        
"\xFF\xFF\xFF\xFF\x00\x00\x00\x00""\xFF\xFF\xFF\xFF\x00\x00\x00\xFF",
        
"\xFF\xFF\xFF\xFF\x00\x00\xFF\x00""\xFF\xFF\xFF\xFF\x00\x00\xFF\xFF",
        
"\xFF\xFF\xFF\xFF\x00\xFF\x00\x00""\xFF\xFF\xFF\xFF\x00\xFF\x00\xFF",
        
"\xFF\xFF\xFF\xFF\x00\xFF\xFF\x00""\xFF\xFF\xFF\xFF\x00\xFF\xFF\xFF",
        
"\xFF\xFF\xFF\xFF\xFF\x00\x00\x00""\xFF\xFF\xFF\xFF\xFF\x00\x00\xFF",
        
"\xFF\xFF\xFF\xFF\xFF\x00\xFF\x00""\xFF\xFF\xFF\xFF\xFF\x00\xFF\xFF",
        
"\xFF\xFF\xFF\xFF\xFF\xFF\x00\x00""\xFF\xFF\xFF\xFF\xFF\xFF\x00\xFF",
        
"\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00""\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"
    
];

    
/**
     * IP mapping helper table.
     *
     * Indexing this table with each source byte performs the initial bit permutation.
     *
     * @var array
     */
    
protected static $ipmap = [
        
0x000x100x010x110x200x300x210x31,
        
0x020x120x030x130x220x320x230x33,
        
0x400x500x410x510x600x700x610x71,
        
0x420x520x430x530x620x720x630x73,
        
0x040x140x050x150x240x340x250x35,
        
0x060x160x070x170x260x360x270x37,
        
0x440x540x450x550x640x740x650x75,
        
0x460x560x470x570x660x760x670x77,
        
0x800x900x810x910xA00xB00xA10xB1,
        
0x820x920x830x930xA20xB20xA30xB3,
        
0xC00xD00xC10xD10xE00xF00xE10xF1,
        
0xC20xD20xC30xD30xE20xF20xE30xF3,
        
0x840x940x850x950xA40xB40xA50xB5,
        
0x860x960x870x970xA60xB60xA70xB7,
        
0xC40xD40xC50xD50xE40xF40xE50xF5,
        
0xC60xD60xC70xD70xE60xF60xE70xF7,
        
0x080x180x090x190x280x380x290x39,
        
0x0A0x1A0x0B0x1B0x2A0x3A0x2B0x3B,
        
0x480x580x490x590x680x780x690x79,
        
0x4A0x5A0x4B0x5B0x6A0x7A0x6B0x7B,
        
0x0C0x1C0x0D0x1D0x2C0x3C0x2D0x3D,
        
0x0E0x1E0x0F0x1F0x2E0x3E0x2F0x3F,
        
0x4C0x5C0x4D0x5D0x6C0x7C0x6D0x7D,
        
0x4E0x5E0x4F0x5F0x6E0x7E0x6F0x7F,
        
0x880x980x890x990xA80xB80xA90xB9,
        
0x8A0x9A0x8B0x9B0xAA0xBA0xAB0xBB,
        
0xC80xD80xC90xD90xE80xF80xE90xF9,
        
0xCA0xDA0xCB0xDB0xEA0xFA0xEB0xFB,
        
0x8C0x9C0x8D0x9D0xAC0xBC0xAD0xBD,
        
0x8E0x9E0x8F0x9F0xAE0xBE0xAF0xBF,
        
0xCC0xDC0xCD0xDD0xEC0xFC0xED0xFD,
        
0xCE0xDE0xCF0xDF0xEE0xFE0xEF0xFF
    
];

    
/**
     * Inverse IP mapping helper table.
     * Indexing this table with a byte value reverses the bit order.
     *
     * @var array
     */
    
protected static $invipmap = [
        
0x000x800x400xC00x200xA00x600xE0,
        
0x100x900x500xD00x300xB00x700xF0,
        
0x080x880x480xC80x280xA80x680xE8,
        
0x180x980x580xD80x380xB80x780xF8,
        
0x040x840x440xC40x240xA40x640xE4,
        
0x140x940x540xD40x340xB40x740xF4,
        
0x0C0x8C0x4C0xCC0x2C0xAC0x6C0xEC,
        
0x1C0x9C0x5C0xDC0x3C0xBC0x7C0xFC,
        
0x020x820x420xC20x220xA20x620xE2,
        
0x120x920x520xD20x320xB20x720xF2,
        
0x0A0x8A0x4A0xCA0x2A0xAA0x6A0xEA,
        
0x1A0x9A0x5A0xDA0x3A0xBA0x7A0xFA,
        
0x060x860x460xC60x260xA60x660xE6,
        
0x160x960x560xD60x360xB60x760xF6,
        
0x0E0x8E0x4E0xCE0x2E0xAE0x6E0xEE,
        
0x1E0x9E0x5E0xDE0x3E0xBE0x7E0xFE,
        
0x010x810x410xC10x210xA10x610xE1,
        
0x110x910x510xD10x310xB10x710xF1,
        
0x090x890x490xC90x290xA90x690xE9,
        
0x190x990x590xD90x390xB90x790xF9,
        
0x050x850x450xC50x250xA50x650xE5,
        
0x150x950x550xD50x350xB50x750xF5,
        
0x0D0x8D0x4D0xCD0x2D0xAD0x6D0xED,
        
0x1D0x9D0x5D0xDD0x3D0xBD0x7D0xFD,
        
0x030x830x430xC30x230xA30x630xE3,
        
0x130x930x530xD30x330xB30x730xF3,
        
0x0B0x8B0x4B0xCB0x2B0xAB0x6B0xEB,
        
0x1B0x9B0x5B0xDB0x3B0xBB0x7B0xFB,
        
0x070x870x470xC70x270xA70x670xE7,
        
0x170x970x570xD70x370xB70x770xF7,
        
0x0F0x8F0x4F0xCF0x2F0xAF0x6F0xEF,
        
0x1F0x9F0x5F0xDF0x3F0xBF0x7F0xFF
    
];

    
/**
     * Pre-permuted S-box1
     *
     * Each box ($sbox1-$sbox8) has been vectorized, then each value pre-permuted using the
     * P table: concatenation can then be replaced by exclusive ORs.
     *
     * @var array
     */
    
protected static $sbox1 = [
        
0x008082000x000000000x000080000x00808202,
        
0x008080020x000082020x000000020x00008000,
        
0x000002000x008082000x008082020x00000200,
        
0x008002020x008080020x008000000x00000002,
        
0x000002020x008002000x008002000x00008200,
        
0x000082000x008080000x008080000x00800202,
        
0x000080020x008000020x008000020x00008002,
        
0x000000000x000002020x000082020x00800000,
        
0x000080000x008082020x000000020x00808000,
        
0x008082000x008000000x008000000x00000200,
        
0x008080020x000080000x000082000x00800002,
        
0x000002000x000000020x008002020x00008202,
        
0x008082020x000080020x008080000x00800202,
        
0x008000020x000002020x000082020x00808200,
        
0x000002020x008002000x008002000x00000000,
        
0x000080020x000082000x000000000x00808002
    
];

    
/**
     * Pre-permuted S-box2
     *
     * @var array
     */
    
protected static $sbox2 = [
        
0x400840100x400040000x000040000x00084010,
        
0x000800000x000000100x400800100x40004010,
        
0x400000100x400840100x400840000x40000000,
        
0x400040000x000800000x000000100x40080010,
        
0x000840000x000800100x400040100x00000000,
        
0x400000000x000040000x000840100x40080000,
        
0x000800100x400000100x000000000x00084000,
        
0x000040100x400840000x400800000x00004010,
        
0x000000000x000840100x400800100x00080000,
        
0x400040100x400800000x400840000x00004000,
        
0x400800000x400040000x000000100x40084010,
        
0x000840100x000000100x000040000x40000000,
        
0x000040100x400840000x000800000x40000010,
        
0x000800100x400040100x400000100x00080010,
        
0x000840000x000000000x400040000x00004010,
        
0x400000000x400800100x400840100x00084000
    
];

    
/**
     * Pre-permuted S-box3
     *
     * @var array
     */
    
protected static $sbox3 = [
        
0x000001040x040101000x000000000x04010004,
        
0x040001000x000000000x000101040x04000100,
        
0x000100040x040000040x040000040x00010000,
        
0x040101040x000100040x040100000x00000104,
        
0x040000000x000000040x040101000x00000100,
        
0x000101000x040100000x040100040x00010104,
        
0x040001040x000101000x000100000x04000104,
        
0x000000040x040101040x000001000x04000000,
        
0x040101000x040000000x000100040x00000104,
        
0x000100000x040101000x040001000x00000000,
        
0x000001000x000100040x040101040x04000100,
        
0x040000040x000001000x000000000x04010004,
        
0x040001040x000100000x040000000x04010104,
        
0x000000040x000101040x000101000x04000004,
        
0x040100000x040001040x000001040x04010000,
        
0x000101040x000000040x040100040x00010100
    
];

    
/**
     * Pre-permuted S-box4
     *
     * @var array
     */
    
protected static $sbox4 = [
        
0x804010000x800010400x800010400x00000040,
        
0x004010400x804000400x804000000x80001000,
        
0x000000000x004010000x004010000x80401040,
        
0x800000400x000000000x004000400x80400000,
        
0x800000000x000010000x004000000x80401000,
        
0x000000400x004000000x800010000x00001040,
        
0x804000400x800000000x000010400x00400040,
        
0x000010000x004010400x804010400x80000040,
        
0x004000400x804000000x004010000x80401040,
        
0x800000400x000000000x000000000x00401000,
        
0x000010400x004000400x804000400x80000000,
        
0x804010000x800010400x800010400x00000040,
        
0x804010400x800000400x800000000x00001000,
        
0x804000000x800010000x004010400x80400040,
        
0x800010000x000010400x004000000x80401000,
        
0x000000400x004000000x000010000x00401040
    
];

    
/**
     * Pre-permuted S-box5
     *
     * @var array
     */
    
protected static $sbox5 = [
        
0x000000800x010400800x010400000x21000080,
        
0x000400000x000000800x200000000x01040000,
        
0x200400800x000400000x010000800x20040080,
        
0x210000800x210400000x000400800x20000000,
        
0x010000000x200400000x200400000x00000000,
        
0x200000800x210400800x210400800x01000080,
        
0x210400000x200000800x000000000x21000000,
        
0x010400800x010000000x210000000x00040080,
        
0x000400000x210000800x000000800x01000000,
        
0x200000000x010400000x210000800x20040080,
        
0x010000800x200000000x210400000x01040080,
        
0x200400800x000000800x010000000x21040000,
        
0x210400800x000400800x210000000x21040080,
        
0x010400000x000000000x200400000x21000000,
        
0x000400800x010000800x200000800x00040000,
        
0x000000000x200400000x010400800x20000080
    
];

    
/**
     * Pre-permuted S-box6
     *
     * @var array
     */
    
protected static $sbox6 = [
        
0x100000080x102000000x000020000x10202008,
        
0x102000000x000000080x102020080x00200000,
        
0x100020000x002020080x002000000x10000008,
        
0x002000080x100020000x100000000x00002008,
        
0x000000000x002000080x100020080x00002000,
        
0x002020000x100020080x000000080x10200008,
        
0x102000080x000000000x002020080x10202000,
        
0x000020080x002020000x102020000x10000000,
        
0x100020000x000000080x102000080x00202000,
        
0x102020080x002000000x000020080x10000008,
        
0x002000000x100020000x100000000x00002008,
        
0x100000080x102020080x002020000x10200000,
        
0x002020080x102020000x000000000x10200008,
        
0x000000080x000020000x102000000x00202008,
        
0x000020000x002000080x100020080x00000000,
        
0x102020000x100000000x002000080x10002008
    
];

    
/**
     * Pre-permuted S-box7
     *
     * @var array
     */
    
protected static $sbox7 = [
        
0x001000000x021000010x020004010x00000000,
        
0x000004000x020004010x001004010x02100400,
        
0x021004010x001000000x000000000x02000001,
        
0x000000010x020000000x021000010x00000401,
        
0x020004000x001004010x001000010x02000400,
        
0x020000010x021000000x021004000x00100001,
        
0x021000000x000004000x000004010x02100401,
        
0x001004000x000000010x020000000x00100400,
        
0x020000000x001004000x001000000x02000401,
        
0x020004010x021000010x021000010x00000001,
        
0x001000010x020000000x020004000x00100000,
        
0x021004000x000004010x001004010x02100400,
        
0x000004010x020000010x021004010x02100000,
        
0x001004000x000000000x000000010x02100401,
        
0x000000000x001004010x021000000x00000400,
        
0x020000010x020004000x000004000x00100001
    
];

    
/**
     * Pre-permuted S-box8
     *
     * @var array
     */
    
protected static $sbox8 = [
        
0x080008200x000008000x000200000x08020820,
        
0x080000000x080008200x000000200x08000000,
        
0x000200200x080200000x080208200x00020800,
        
0x080208000x000208200x000008000x00000020,
        
0x080200000x080000200x080008000x00000820,
        
0x000208000x000200200x080200200x08020800,
        
0x000008200x000000000x000000000x08020020,
        
0x080000200x080008000x000208200x00020000,
        
0x000208200x000200000x080208000x00000800,
        
0x000000200x080200200x000008000x00020820,
        
0x080008000x000000200x080000200x08020000,
        
0x080200200x080000000x000200000x08000820,
        
0x000000000x080208200x000200200x08000020,
        
0x080200000x080008000x080008200x00000000,
        
0x080208200x000208000x000208000x00000820,
        
0x000008200x000200200x080000000x08020800
    
];

    
/**
     * Default Constructor.
     *
     * @param string $mode
     * @throws BadModeException if an invalid / unsupported mode is provided
     */
    
public function __construct($mode)
    {
        
parent::__construct($mode);

        if (
$this->mode == self::MODE_STREAM) {
            throw new 
BadModeException('Block ciphers cannot be ran in stream mode');
        }
    }

    
/**
     * Test for engine validity
     *
     * This is mainly just a wrapper to set things up for \phpseclib3\Crypt\Common\SymmetricKey::isValidEngine()
     *
     * @see \phpseclib3\Crypt\Common\SymmetricKey::isValidEngine()
     * @param int $engine
     * @return bool
     */
    
protected function isValidEngineHelper($engine)
    {
        if (
$this->key_length_max == 8) {
            if (
$engine == self::ENGINE_OPENSSL) {
                
// quoting https://www.openssl.org/news/openssl-3.0-notes.html, OpenSSL 3.0.1
                // "Moved all variations of the EVP ciphers CAST5, BF, IDEA, SEED, RC2, RC4, RC5, and DES to the legacy provider"
                // in theory openssl_get_cipher_methods() should catch this but, on GitHub Actions, at least, it does not
                
if (defined('OPENSSL_VERSION_TEXT') && version_compare(preg_replace('#OpenSSL (\d+\.\d+\.\d+) .*#''$1'OPENSSL_VERSION_TEXT), '3.0.1''>=')) {
                    return 
false;
                }
                
$this->cipher_name_openssl_ecb 'des-ecb';
                
$this->cipher_name_openssl 'des-' $this->openssl_translate_mode();
            }
        }

        return 
parent::isValidEngineHelper($engine);
    }

    
/**
     * Sets the key.
     *
     * Keys must be 64-bits long or 8 bytes long.
     *
     * DES also requires that every eighth bit be a parity bit, however, we'll ignore that.
     *
     * @see \phpseclib3\Crypt\Common\SymmetricKey::setKey()
     * @param string $key
     */
    
public function setKey($key)
    {
        if (!(
$this instanceof TripleDES) && strlen($key) != 8) {
            throw new 
\LengthException('Key of size ' strlen($key) . ' not supported by this algorithm. Only keys of size 8 are supported');
        }

        
// Sets the key
        
parent::setKey($key);
    }

    
/**
     * Encrypts a block
     *
     * @see \phpseclib3\Crypt\Common\SymmetricKey::encryptBlock()
     * @see \phpseclib3\Crypt\Common\SymmetricKey::encrypt()
     * @see self::encrypt()
     * @param string $in
     * @return string
     */
    
protected function encryptBlock($in)
    {
        return 
$this->processBlock($inself::ENCRYPT);
    }

    
/**
     * Decrypts a block
     *
     * @see \phpseclib3\Crypt\Common\SymmetricKey::decryptBlock()
     * @see \phpseclib3\Crypt\Common\SymmetricKey::decrypt()
     * @see self::decrypt()
     * @param string $in
     * @return string
     */
    
protected function decryptBlock($in)
    {
        return 
$this->processBlock($inself::DECRYPT);
    }

    
/**
     * Encrypts or decrypts a 64-bit block
     *
     * $mode should be either self::ENCRYPT or self::DECRYPT.  See
     * {@link http://en.wikipedia.org/wiki/Image:Feistel.png Feistel.png} to get a general
     * idea of what this function does.
     *
     * @see self::encryptBlock()
     * @see self::decryptBlock()
     * @param string $block
     * @param int $mode
     * @return string
     */
    
private function processBlock($block$mode)
    {
        static 
$sbox1$sbox2$sbox3$sbox4$sbox5$sbox6$sbox7$sbox8$shuffleip$shuffleinvip;
        if (!
$sbox1) {
            
$sbox1 array_map('intval'self::$sbox1);
            
$sbox2 array_map('intval'self::$sbox2);
            
$sbox3 array_map('intval'self::$sbox3);
            
$sbox4 array_map('intval'self::$sbox4);
            
$sbox5 array_map('intval'self::$sbox5);
            
$sbox6 array_map('intval'self::$sbox6);
            
$sbox7 array_map('intval'self::$sbox7);
            
$sbox8 array_map('intval'self::$sbox8);
            
/* Merge $shuffle with $[inv]ipmap */
            
for ($i 0$i 256; ++$i) {
                
$shuffleip[]    =  self::$shuffle[self::$ipmap[$i]];
                
$shuffleinvip[] =  self::$shuffle[self::$invipmap[$i]];
            }
        }

        
$keys  $this->keys[$mode];
        
$ki    = -1;

        
// Do the initial IP permutation.
        
$t unpack('Nl/Nr'$block);
        list(
$l$r) = [$t['l'], $t['r']];
        
$block = ($shuffleip$r        0xFF] & "\x80\x80\x80\x80\x80\x80\x80\x80") |
                 (
$shuffleip[($r >>  8) & 0xFF] & "\x40\x40\x40\x40\x40\x40\x40\x40") |
                 (
$shuffleip[($r >> 16) & 0xFF] & "\x20\x20\x20\x20\x20\x20\x20\x20") |
                 (
$shuffleip[($r >> 24) & 0xFF] & "\x10\x10\x10\x10\x10\x10\x10\x10") |
                 (
$shuffleip$l        0xFF] & "\x08\x08\x08\x08\x08\x08\x08\x08") |
                 (
$shuffleip[($l >>  8) & 0xFF] & "\x04\x04\x04\x04\x04\x04\x04\x04") |
                 (
$shuffleip[($l >> 16) & 0xFF] & "\x02\x02\x02\x02\x02\x02\x02\x02") |
                 (
$shuffleip[($l >> 24) & 0xFF] & "\x01\x01\x01\x01\x01\x01\x01\x01");

        
// Extract L0 and R0.
        
$t unpack('Nl/Nr'$block);
        list(
$l$r) = [$t['l'], $t['r']];

        for (
$des_round 0$des_round $this->des_rounds; ++$des_round) {
            
// Perform the 16 steps.
            
for ($i 0$i 16$i++) {
                
// start of "the Feistel (F) function" - see the following URL:
                // http://en.wikipedia.org/wiki/Image:Data_Encryption_Standard_InfoBox_Diagram.png
                // Merge key schedule.
                
$b1 = (($r >>  3) & 0x1FFFFFFF) ^ ($r << 29) ^ $keys[++$ki];
                
$b2 = (($r >> 31) & 0x00000001) ^ ($r <<  1) ^ $keys[++$ki];

                
// S-box indexing.
                
$t $sbox1[($b1 >> 24) & 0x3F] ^ $sbox2[($b2 >> 24) & 0x3F] ^
                     
$sbox3[($b1 >> 16) & 0x3F] ^ $sbox4[($b2 >> 16) & 0x3F] ^
                     
$sbox5[($b1 >>  8) & 0x3F] ^ $sbox6[($b2 >>  8) & 0x3F] ^
                     
$sbox7$b1        0x3F] ^ $sbox8$b2        0x3F] ^ $l;
                
// end of "the Feistel (F) function"

                
$l $r;
                
$r $t;
            }

            
// Last step should not permute L & R.
            
$t $l;
            
$l $r;
            
$r $t;
        }

        
// Perform the inverse IP permutation.
        
return ($shuffleinvip[($r >> 24) & 0xFF] & "\x80\x80\x80\x80\x80\x80\x80\x80") |
               (
$shuffleinvip[($l >> 24) & 0xFF] & "\x40\x40\x40\x40\x40\x40\x40\x40") |
               (
$shuffleinvip[($r >> 16) & 0xFF] & "\x20\x20\x20\x20\x20\x20\x20\x20") |
               (
$shuffleinvip[($l >> 16) & 0xFF] & "\x10\x10\x10\x10\x10\x10\x10\x10") |
               (
$shuffleinvip[($r >>  8) & 0xFF] & "\x08\x08\x08\x08\x08\x08\x08\x08") |
               (
$shuffleinvip[($l >>  8) & 0xFF] & "\x04\x04\x04\x04\x04\x04\x04\x04") |
               (
$shuffleinvip$r        0xFF] & "\x02\x02\x02\x02\x02\x02\x02\x02") |
               (
$shuffleinvip$l        0xFF] & "\x01\x01\x01\x01\x01\x01\x01\x01");
    }

    
/**
     * Creates the key schedule
     *
     * @see \phpseclib3\Crypt\Common\SymmetricKey::setupKey()
     */
    
protected function setupKey()
    {
        if (isset(
$this->kl['key']) && $this->key === $this->kl['key'] && $this->des_rounds === $this->kl['des_rounds']) {
            
// already expanded
            
return;
        }
        
$this->kl = ['key' => $this->key'des_rounds' => $this->des_rounds];

        static 
$shifts = [ // number of key bits shifted per round
            
1122222212222221
        
];

        static 
$pc1map = [
            
0x000x000x080x080x040x040x0C0x0C,
            
0x020x020x0A0x0A0x060x060x0E0x0E,
            
0x100x100x180x180x140x140x1C0x1C,
            
0x120x120x1A0x1A0x160x160x1E0x1E,
            
0x200x200x280x280x240x240x2C0x2C,
            
0x220x220x2A0x2A0x260x260x2E0x2E,
            
0x300x300x380x380x340x340x3C0x3C,
            
0x320x320x3A0x3A0x360x360x3E0x3E,
            
0x400x400x480x480x440x440x4C0x4C,
            
0x420x420x4A0x4A0x460x460x4E0x4E,
            
0x500x500x580x580x540x540x5C0x5C,
            
0x520x520x5A0x5A0x560x560x5E0x5E,
            
0x600x600x680x680x640x640x6C0x6C,
            
0x620x620x6A0x6A0x660x660x6E0x6E,
            
0x700x700x780x780x740x740x7C0x7C,
            
0x720x720x7A0x7A0x760x760x7E0x7E,
            
0x800x800x880x880x840x840x8C0x8C,
            
0x820x820x8A0x8A0x860x860x8E0x8E,
            
0x900x900x980x980x940x940x9C0x9C,
            
0x920x920x9A0x9A0x960x960x9E0x9E,
            
0xA00xA00xA80xA80xA40xA40xAC0xAC,
            
0xA20xA20xAA0xAA0xA60xA60xAE0xAE,
            
0xB00xB00xB80xB80xB40xB40xBC0xBC,
            
0xB20xB20xBA0xBA0xB60xB60xBE0xBE,
            
0xC00xC00xC80xC80xC40xC40xCC0xCC,
            
0xC20xC20xCA0xCA0xC60xC60xCE0xCE,
            
0xD00xD00xD80xD80xD40xD40xDC0xDC,
            
0xD20xD20xDA0xDA0xD60xD60xDE0xDE,
            
0xE00xE00xE80xE80xE40xE40xEC0xEC,
            
0xE20xE20xEA0xEA0xE60xE60xEE0xEE,
            
0xF00xF00xF80xF80xF40xF40xFC0xFC,
            
0xF20xF20xFA0xFA0xF60xF60xFE0xFE
        
];

        
// Mapping tables for the PC-2 transformation.
        
static $pc2mapc1 = [
            
0x000000000x000004000x002000000x00200400,
            
0x000000010x000004010x002000010x00200401,
            
0x020000000x020004000x022000000x02200400,
            
0x020000010x020004010x022000010x02200401
        
];
        static 
$pc2mapc2 = [
            
0x000000000x000008000x080000000x08000800,
            
0x000100000x000108000x080100000x08010800,
            
0x000000000x000008000x080000000x08000800,
            
0x000100000x000108000x080100000x08010800,
            
0x000001000x000009000x080001000x08000900,
            
0x000101000x000109000x080101000x08010900,
            
0x000001000x000009000x080001000x08000900,
            
0x000101000x000109000x080101000x08010900,
            
0x000000100x000008100x080000100x08000810,
            
0x000100100x000108100x080100100x08010810,
            
0x000000100x000008100x080000100x08000810,
            
0x000100100x000108100x080100100x08010810,
            
0x000001100x000009100x080001100x08000910,
            
0x000101100x000109100x080101100x08010910,
            
0x000001100x000009100x080001100x08000910,
            
0x000101100x000109100x080101100x08010910,
            
0x000400000x000408000x080400000x08040800,
            
0x000500000x000508000x080500000x08050800,
            
0x000400000x000408000x080400000x08040800,
            
0x000500000x000508000x080500000x08050800,
            
0x000401000x000409000x080401000x08040900,
            
0x000501000x000509000x080501000x08050900,
            
0x000401000x000409000x080401000x08040900,
            
0x000501000x000509000x080501000x08050900,
            
0x000400100x000408100x080400100x08040810,
            
0x000500100x000508100x080500100x08050810,
            
0x000400100x000408100x080400100x08040810,
            
0x000500100x000508100x080500100x08050810,
            
0x000401100x000409100x080401100x08040910,
            
0x000501100x000509100x080501100x08050910,
            
0x000401100x000409100x080401100x08040910,
            
0x000501100x000509100x080501100x08050910,
            
0x010000000x010008000x090000000x09000800,
            
0x010100000x010108000x090100000x09010800,
            
0x010000000x010008000x090000000x09000800,
            
0x010100000x010108000x090100000x09010800,
            
0x010001000x010009000x090001000x09000900,
            
0x010101000x010109000x090101000x09010900,
            
0x010001000x010009000x090001000x09000900,
            
0x010101000x010109000x090101000x09010900,
            
0x010000100x010008100x090000100x09000810,
            
0x010100100x010108100x090100100x09010810,
            
0x010000100x010008100x090000100x09000810,
            
0x010100100x010108100x090100100x09010810,
            
0x010001100x010009100x090001100x09000910,
            
0x010101100x010109100x090101100x09010910,
            
0x010001100x010009100x090001100x09000910,
            
0x010101100x010109100x090101100x09010910,
            
0x010400000x010408000x090400000x09040800,
            
0x010500000x010508000x090500000x09050800,
            
0x010400000x010408000x090400000x09040800,
            
0x010500000x010508000x090500000x09050800,
            
0x010401000x010409000x090401000x09040900,
            
0x010501000x010509000x090501000x09050900,
            
0x010401000x010409000x090401000x09040900,
            
0x010501000x010509000x090501000x09050900,
            
0x010400100x010408100x090400100x09040810,
            
0x010500100x010508100x090500100x09050810,
            
0x010400100x010408100x090400100x09040810,
            
0x010500100x010508100x090500100x09050810,
            
0x010401100x010409100x090401100x09040910,
            
0x010501100x010509100x090501100x09050910,
            
0x010401100x010409100x090401100x09040910,
            
0x010501100x010509100x090501100x09050910
        
];
        static 
$pc2mapc3 = [
            
0x000000000x000000040x000010000x00001004,
            
0x000000000x000000040x000010000x00001004,
            
0x100000000x100000040x100010000x10001004,
            
0x100000000x100000040x100010000x10001004,
            
0x000000200x000000240x000010200x00001024,
            
0x000000200x000000240x000010200x00001024,
            
0x100000200x100000240x100010200x10001024,
            
0x100000200x100000240x100010200x10001024,
            
0x000800000x000800040x000810000x00081004,
            
0x000800000x000800040x000810000x00081004,
            
0x100800000x100800040x100810000x10081004,
            
0x100800000x100800040x100810000x10081004,
            
0x000800200x000800240x000810200x00081024,
            
0x000800200x000800240x000810200x00081024,
            
0x100800200x100800240x100810200x10081024,
            
0x100800200x100800240x100810200x10081024,
            
0x200000000x200000040x200010000x20001004,
            
0x200000000x200000040x200010000x20001004,
            
0x300000000x300000040x300010000x30001004,
            
0x300000000x300000040x300010000x30001004,
            
0x200000200x200000240x200010200x20001024,
            
0x200000200x200000240x200010200x20001024,
            
0x300000200x300000240x300010200x30001024,
            
0x300000200x300000240x300010200x30001024,
            
0x200800000x200800040x200810000x20081004,
            
0x200800000x200800040x200810000x20081004,
            
0x300800000x300800040x300810000x30081004,
            
0x300800000x300800040x300810000x30081004,
            
0x200800200x200800240x200810200x20081024,
            
0x200800200x200800240x200810200x20081024,
            
0x300800200x300800240x300810200x30081024,
            
0x300800200x300800240x300810200x30081024,
            
0x000000020x000000060x000010020x00001006,
            
0x000000020x000000060x000010020x00001006,
            
0x100000020x100000060x100010020x10001006,
            
0x100000020x100000060x100010020x10001006,
            
0x000000220x000000260x000010220x00001026,
            
0x000000220x000000260x000010220x00001026,
            
0x100000220x100000260x100010220x10001026,
            
0x100000220x100000260x100010220x10001026,
            
0x000800020x000800060x000810020x00081006,
            
0x000800020x000800060x000810020x00081006,
            
0x100800020x100800060x100810020x10081006,
            
0x100800020x100800060x100810020x10081006,
            
0x000800220x000800260x000810220x00081026,
            
0x000800220x000800260x000810220x00081026,
            
0x100800220x100800260x100810220x10081026,
            
0x100800220x100800260x100810220x10081026,
            
0x200000020x200000060x200010020x20001006,
            
0x200000020x200000060x200010020x20001006,
            
0x300000020x300000060x300010020x30001006,
            
0x300000020x300000060x300010020x30001006,
            
0x200000220x200000260x200010220x20001026,
            
0x200000220x200000260x200010220x20001026,
            
0x300000220x300000260x300010220x30001026,
            
0x300000220x300000260x300010220x30001026,
            
0x200800020x200800060x200810020x20081006,
            
0x200800020x200800060x200810020x20081006,
            
0x300800020x300800060x300810020x30081006,
            
0x300800020x300800060x300810020x30081006,
            
0x200800220x200800260x200810220x20081026,
            
0x200800220x200800260x200810220x20081026,
            
0x300800220x300800260x300810220x30081026,
            
0x300800220x300800260x300810220x30081026
        
];
        static 
$pc2mapc4 = [
            
0x000000000x001000000x000000080x00100008,
            
0x000002000x001002000x000002080x00100208,
            
0x000000000x001000000x000000080x00100008,
            
0x000002000x001002000x000002080x00100208,
            
0x040000000x041000000x040000080x04100008,
            
0x040002000x041002000x040002080x04100208,
            
0x040000000x041000000x040000080x04100008,
            
0x040002000x041002000x040002080x04100208,
            
0x000020000x001020000x000020080x00102008,
            
0x000022000x001022000x000022080x00102208,
            
0x000020000x001020000x000020080x00102008,
            
0x000022000x001022000x000022080x00102208,
            
0x040020000x041020000x040020080x04102008,
            
0x040022000x041022000x040022080x04102208,
            
0x040020000x041020000x040020080x04102008,
            
0x040022000x041022000x040022080x04102208,
            
0x000000000x001000000x000000080x00100008,
            
0x000002000x001002000x000002080x00100208,
            
0x000000000x001000000x000000080x00100008,
            
0x000002000x001002000x000002080x00100208,
            
0x040000000x041000000x040000080x04100008,
            
0x040002000x041002000x040002080x04100208,
            
0x040000000x041000000x040000080x04100008,
            
0x040002000x041002000x040002080x04100208,
            
0x000020000x001020000x000020080x00102008,
            
0x000022000x001022000x000022080x00102208,
            
0x000020000x001020000x000020080x00102008,
            
0x000022000x001022000x000022080x00102208,
            
0x040020000x041020000x040020080x04102008,
            
0x040022000x041022000x040022080x04102208,
            
0x040020000x041020000x040020080x04102008,
            
0x040022000x041022000x040022080x04102208,
            
0x000200000x001200000x000200080x00120008,
            
0x000202000x001202000x000202080x00120208,
            
0x000200000x001200000x000200080x00120008,
            
0x000202000x001202000x000202080x00120208,
            
0x040200000x041200000x040200080x04120008,
            
0x040202000x041202000x040202080x04120208,
            
0x040200000x041200000x040200080x04120008,
            
0x040202000x041202000x040202080x04120208,
            
0x000220000x001220000x000220080x00122008,
            
0x000222000x001222000x000222080x00122208,
            
0x000220000x001220000x000220080x00122008,
            
0x000222000x001222000x000222080x00122208,
            
0x040220000x041220000x040220080x04122008,
            
0x040222000x041222000x040222080x04122208,
            
0x040220000x041220000x040220080x04122008,
            
0x040222000x041222000x040222080x04122208,
            
0x000200000x001200000x000200080x00120008,
            
0x000202000x001202000x000202080x00120208,
            
0x000200000x001200000x000200080x00120008,
            
0x000202000x001202000x000202080x00120208,
            
0x040200000x041200000x040200080x04120008,
            
0x040202000x041202000x040202080x04120208,
            
0x040200000x041200000x040200080x04120008,
            
0x040202000x041202000x040202080x04120208,
            
0x000220000x001220000x000220080x00122008,
            
0x000222000x001222000x000222080x00122208,
            
0x000220000x001220000x000220080x00122008,
            
0x000222000x001222000x000222080x00122208,
            
0x040220000x041220000x040220080x04122008,
            
0x040222000x041222000x040222080x04122208,
            
0x040220000x041220000x040220080x04122008,
            
0x040222000x041222000x040222080x04122208
        
];
        static 
$pc2mapd1 = [
            
0x000000000x000000010x080000000x08000001,
            
0x002000000x002000010x082000000x08200001,
            
0x000000020x000000030x080000020x08000003,
            
0x002000020x002000030x082000020x08200003
        
];
        static 
$pc2mapd2 = [
            
0x000000000x001000000x000008000x00100800,
            
0x000000000x001000000x000008000x00100800,
            
0x040000000x041000000x040008000x04100800,
            
0x040000000x041000000x040008000x04100800,
            
0x000000040x001000040x000008040x00100804,
            
0x000000040x001000040x000008040x00100804,
            
0x040000040x041000040x040008040x04100804,
            
0x040000040x041000040x040008040x04100804,
            
0x000000000x001000000x000008000x00100800,
            
0x000000000x001000000x000008000x00100800,
            
0x040000000x041000000x040008000x04100800,
            
0x040000000x041000000x040008000x04100800,
            
0x000000040x001000040x000008040x00100804,
            
0x000000040x001000040x000008040x00100804,
            
0x040000040x041000040x040008040x04100804,
            
0x040000040x041000040x040008040x04100804,
            
0x000002000x001002000x00000A000x00100A00,
            
0x000002000x001002000x00000A000x00100A00,
            
0x040002000x041002000x04000A000x04100A00,
            
0x040002000x041002000x04000A000x04100A00,
            
0x000002040x001002040x00000A040x00100A04,
            
0x000002040x001002040x00000A040x00100A04,
            
0x040002040x041002040x04000A040x04100A04,
            
0x040002040x041002040x04000A040x04100A04,
            
0x000002000x001002000x00000A000x00100A00,
            
0x000002000x001002000x00000A000x00100A00,
            
0x040002000x041002000x04000A000x04100A00,
            
0x040002000x041002000x04000A000x04100A00,
            
0x000002040x001002040x00000A040x00100A04,
            
0x000002040x001002040x00000A040x00100A04,
            
0x040002040x041002040x04000A040x04100A04,
            
0x040002040x041002040x04000A040x04100A04,
            
0x000200000x001200000x000208000x00120800,
            
0x000200000x001200000x000208000x00120800,
            
0x040200000x041200000x040208000x04120800,
            
0x040200000x041200000x040208000x04120800,
            
0x000200040x001200040x000208040x00120804,
            
0x000200040x001200040x000208040x00120804,
            
0x040200040x041200040x040208040x04120804,
            
0x040200040x041200040x040208040x04120804,
            
0x000200000x001200000x000208000x00120800,
            
0x000200000x001200000x000208000x00120800,
            
0x040200000x041200000x040208000x04120800,
            
0x040200000x041200000x040208000x04120800,
            
0x000200040x001200040x000208040x00120804,
            
0x000200040x001200040x000208040x00120804,
            
0x040200040x041200040x040208040x04120804,
            
0x040200040x041200040x040208040x04120804,
            
0x000202000x001202000x00020A000x00120A00,
            
0x000202000x001202000x00020A000x00120A00,
            
0x040202000x041202000x04020A000x04120A00,
            
0x040202000x041202000x04020A000x04120A00,
            
0x000202040x001202040x00020A040x00120A04,
            
0x000202040x001202040x00020A040x00120A04,
            
0x040202040x041202040x04020A040x04120A04,
            
0x040202040x041202040x04020A040x04120A04,
            
0x000202000x001202000x00020A000x00120A00,
            
0x000202000x001202000x00020A000x00120A00,
            
0x040202000x041202000x04020A000x04120A00,
            
0x040202000x041202000x04020A000x04120A00,
            
0x000202040x001202040x00020A040x00120A04,
            
0x000202040x001202040x00020A040x00120A04,
            
0x040202040x041202040x04020A040x04120A04,
            
0x040202040x041202040x04020A040x04120A04
        
];
        static 
$pc2mapd3 = [
            
0x000000000x000100000x020000000x02010000,
            
0x000000200x000100200x020000200x02010020,
            
0x000400000x000500000x020400000x02050000,
            
0x000400200x000500200x020400200x02050020,
            
0x000020000x000120000x020020000x02012000,
            
0x000020200x000120200x020020200x02012020,
            
0x000420000x000520000x020420000x02052000,
            
0x000420200x000520200x020420200x02052020,
            
0x000000000x000100000x020000000x02010000,
            
0x000000200x000100200x020000200x02010020,
            
0x000400000x000500000x020400000x02050000,
            
0x000400200x000500200x020400200x02050020,
            
0x000020000x000120000x020020000x02012000,
            
0x000020200x000120200x020020200x02012020,
            
0x000420000x000520000x020420000x02052000,
            
0x000420200x000520200x020420200x02052020,
            
0x000000100x000100100x020000100x02010010,
            
0x000000300x000100300x020000300x02010030,
            
0x000400100x000500100x020400100x02050010,
            
0x000400300x000500300x020400300x02050030,
            
0x000020100x000120100x020020100x02012010,
            
0x000020300x000120300x020020300x02012030,
            
0x000420100x000520100x020420100x02052010,
            
0x000420300x000520300x020420300x02052030,
            
0x000000100x000100100x020000100x02010010,
            
0x000000300x000100300x020000300x02010030,
            
0x000400100x000500100x020400100x02050010,
            
0x000400300x000500300x020400300x02050030,
            
0x000020100x000120100x020020100x02012010,
            
0x000020300x000120300x020020300x02012030,
            
0x000420100x000520100x020420100x02052010,
            
0x000420300x000520300x020420300x02052030,
            
0x200000000x200100000x220000000x22010000,
            
0x200000200x200100200x220000200x22010020,
            
0x200400000x200500000x220400000x22050000,
            
0x200400200x200500200x220400200x22050020,
            
0x200020000x200120000x220020000x22012000,
            
0x200020200x200120200x220020200x22012020,
            
0x200420000x200520000x220420000x22052000,
            
0x200420200x200520200x220420200x22052020,
            
0x200000000x200100000x220000000x22010000,
            
0x200000200x200100200x220000200x22010020,
            
0x200400000x200500000x220400000x22050000,
            
0x200400200x200500200x220400200x22050020,
            
0x200020000x200120000x220020000x22012000,
            
0x200020200x200120200x220020200x22012020,
            
0x200420000x200520000x220420000x22052000,
            
0x200420200x200520200x220420200x22052020,
            
0x200000100x200100100x220000100x22010010,
            
0x200000300x200100300x220000300x22010030,
            
0x200400100x200500100x220400100x22050010,
            
0x200400300x200500300x220400300x22050030,
            
0x200020100x200120100x220020100x22012010,
            
0x200020300x200120300x220020300x22012030,
            
0x200420100x200520100x220420100x22052010,
            
0x200420300x200520300x220420300x22052030,
            
0x200000100x200100100x220000100x22010010,
            
0x200000300x200100300x220000300x22010030,
            
0x200400100x200500100x220400100x22050010,
            
0x200400300x200500300x220400300x22050030,
            
0x200020100x200120100x220020100x22012010,
            
0x200020300x200120300x220020300x22012030,
            
0x200420100x200520100x220420100x22052010,
            
0x200420300x200520300x220420300x22052030
        
];
        static 
$pc2mapd4 = [
            
0x000000000x000004000x010000000x01000400,
            
0x000000000x000004000x010000000x01000400,
            
0x000001000x000005000x010001000x01000500,
            
0x000001000x000005000x010001000x01000500,
            
0x100000000x100004000x110000000x11000400,
            
0x100000000x100004000x110000000x11000400,
            
0x100001000x100005000x110001000x11000500,
            
0x100001000x100005000x110001000x11000500,
            
0x000800000x000804000x010800000x01080400,
            
0x000800000x000804000x010800000x01080400,
            
0x000801000x000805000x010801000x01080500,
            
0x000801000x000805000x010801000x01080500,
            
0x100800000x100804000x110800000x11080400,
            
0x100800000x100804000x110800000x11080400,
            
0x100801000x100805000x110801000x11080500,
            
0x100801000x100805000x110801000x11080500,
            
0x000000080x000004080x010000080x01000408,
            
0x000000080x000004080x010000080x01000408,
            
0x000001080x000005080x010001080x01000508,
            
0x000001080x000005080x010001080x01000508,
            
0x100000080x100004080x110000080x11000408,
            
0x100000080x100004080x110000080x11000408,
            
0x100001080x100005080x110001080x11000508,
            
0x100001080x100005080x110001080x11000508,
            
0x000800080x000804080x010800080x01080408,
            
0x000800080x000804080x010800080x01080408,
            
0x000801080x000805080x010801080x01080508,
            
0x000801080x000805080x010801080x01080508,
            
0x100800080x100804080x110800080x11080408,
            
0x100800080x100804080x110800080x11080408,
            
0x100801080x100805080x110801080x11080508,
            
0x100801080x100805080x110801080x11080508,
            
0x000010000x000014000x010010000x01001400,
            
0x000010000x000014000x010010000x01001400,
            
0x000011000x000015000x010011000x01001500,
            
0x000011000x000015000x010011000x01001500,
            
0x100010000x100014000x110010000x11001400,
            
0x100010000x100014000x110010000x11001400,
            
0x100011000x100015000x110011000x11001500,
            
0x100011000x100015000x110011000x11001500,
            
0x000810000x000814000x010810000x01081400,
            
0x000810000x000814000x010810000x01081400,
            
0x000811000x000815000x010811000x01081500,
            
0x000811000x000815000x010811000x01081500,
            
0x100810000x100814000x110810000x11081400,
            
0x100810000x100814000x110810000x11081400,
            
0x100811000x100815000x110811000x11081500,
            
0x100811000x100815000x110811000x11081500,
            
0x000010080x000014080x010010080x01001408,
            
0x000010080x000014080x010010080x01001408,
            
0x000011080x000015080x010011080x01001508,
            
0x000011080x000015080x010011080x01001508,
            
0x100010080x100014080x110010080x11001408,
            
0x100010080x100014080x110010080x11001408,
            
0x100011080x100015080x110011080x11001508,
            
0x100011080x100015080x110011080x11001508,
            
0x000810080x000814080x010810080x01081408,
            
0x000810080x000814080x010810080x01081408,
            
0x000811080x000815080x010811080x01081508,
            
0x000811080x000815080x010811080x01081508,
            
0x100810080x100814080x110810080x11081408,
            
0x100810080x100814080x110810080x11081408,
            
0x100811080x100815080x110811080x11081508,
            
0x100811080x100815080x110811080x11081508
        
];

        
$keys = [];
        for (
$des_round 0$des_round $this->des_rounds; ++$des_round) {
            
// pad the key and remove extra characters as appropriate.
            
$key str_pad(substr($this->key$des_round 88), 8"\0");

            
// Perform the PC/1 transformation and compute C and D.
            
$t unpack('Nl/Nr'$key);
            list(
$l$r) = [$t['l'], $t['r']];
            
$key = (self::$shuffle[$pc1map$r        0xFF]] & "\x80\x80\x80\x80\x80\x80\x80\x00") |
                   (
self::$shuffle[$pc1map[($r >>  8) & 0xFF]] & "\x40\x40\x40\x40\x40\x40\x40\x00") |
                   (
self::$shuffle[$pc1map[($r >> 16) & 0xFF]] & "\x20\x20\x20\x20\x20\x20\x20\x00") |
                   (
self::$shuffle[$pc1map[($r >> 24) & 0xFF]] & "\x10\x10\x10\x10\x10\x10\x10\x00") |
                   (
self::$shuffle[$pc1map$l        0xFF]] & "\x08\x08\x08\x08\x08\x08\x08\x00") |
                   (
self::$shuffle[$pc1map[($l >>  8) & 0xFF]] & "\x04\x04\x04\x04\x04\x04\x04\x00") |
                   (
self::$shuffle[$pc1map[($l >> 16) & 0xFF]] & "\x02\x02\x02\x02\x02\x02\x02\x00") |
                   (
self::$shuffle[$pc1map[($l >> 24) & 0xFF]] & "\x01\x01\x01\x01\x01\x01\x01\x00");
            
$key unpack('Nc/Nd'$key);
            
$c = ( $key['c'] >> 4) & 0x0FFFFFFF;
            
$d = (($key['d'] >> 4) & 0x0FFFFFF0) | ($key['c'] & 0x0F);

            
$keys[$des_round] = [
                
self::ENCRYPT => [],
                
self::DECRYPT => array_fill(0320)
            ];
            for (
$i 0$ki 31$i 16; ++$i$ki -= 2) {
                
$c <<= $shifts[$i];
                
$c = ($c | ($c >> 28)) & 0x0FFFFFFF;
                
$d <<= $shifts[$i];
                
$d = ($d | ($d >> 28)) & 0x0FFFFFFF;

                
// Perform the PC-2 transformation.
                
$cp $pc2mapc1$c >> 24        ] | $pc2mapc2[($c >> 16) & 0xFF] |
                      
$pc2mapc3[($c >>  8) & 0xFF] | $pc2mapc4$c        0xFF];
                
$dp $pc2mapd1$d >> 24        ] | $pc2mapd2[($d >> 16) & 0xFF] |
                      
$pc2mapd3[($d >>  8) & 0xFF] | $pc2mapd4$d        0xFF];

                
// Reorder: odd bytes/even bytes. Push the result in key schedule.
                
$val1 = ( $cp        intval(0xFF000000)) | (($cp <<  8) & 0x00FF0000) |
                        ((
$dp >> 16) & 0x0000FF00) | (($dp >>  8) & 0x000000FF);
                
$val2 = (($cp <<  8) & intval(0xFF000000)) | (($cp << 16) & 0x00FF0000) |
                        ((
$dp >>  8) & 0x0000FF00) | ( $dp        0x000000FF);
                
$keys[$des_round][self::ENCRYPT][       ] = $val1;
                
$keys[$des_round][self::DECRYPT][$ki 1] = $val1;
                
$keys[$des_round][self::ENCRYPT][       ] = $val2;
                
$keys[$des_round][self::DECRYPT][$ki    ] = $val2;
            }
        }

        switch (
$this->des_rounds) {
            case 
3// 3DES keys
                
$this->keys = [
                    
self::ENCRYPT => array_merge(
                        
$keys[0][self::ENCRYPT],
                        
$keys[1][self::DECRYPT],
                        
$keys[2][self::ENCRYPT]
                    ),
                    
self::DECRYPT => array_merge(
                        
$keys[2][self::DECRYPT],
                        
$keys[1][self::ENCRYPT],
                        
$keys[0][self::DECRYPT]
                    )
                ];
                break;
            
// case 1: // DES keys
            
default:
                
$this->keys = [
                    
self::ENCRYPT => $keys[0][self::ENCRYPT],
                    
self::DECRYPT => $keys[0][self::DECRYPT]
                ];
        }
    }

    
/**
     * Setup the performance-optimized function for de/encrypt()
     *
     * @see \phpseclib3\Crypt\Common\SymmetricKey::setupInlineCrypt()
     */
    
protected function setupInlineCrypt()
    {
        
// Engine configuration for:
        // -  DES ($des_rounds == 1) or
        // - 3DES ($des_rounds == 3)
        
$des_rounds $this->des_rounds;

        
$init_crypt 'static $sbox1, $sbox2, $sbox3, $sbox4, $sbox5, $sbox6, $sbox7, $sbox8, $shuffleip, $shuffleinvip;
            if (!$sbox1) {
                $sbox1 = array_map("intval", self::$sbox1);
                $sbox2 = array_map("intval", self::$sbox2);
                $sbox3 = array_map("intval", self::$sbox3);
                $sbox4 = array_map("intval", self::$sbox4);
                $sbox5 = array_map("intval", self::$sbox5);
                $sbox6 = array_map("intval", self::$sbox6);
                $sbox7 = array_map("intval", self::$sbox7);
                $sbox8 = array_map("intval", self::$sbox8);'
                
/* Merge $shuffle with $[inv]ipmap */ '
                for ($i = 0; $i < 256; ++$i) {
                    $shuffleip[]    =  self::$shuffle[self::$ipmap[$i]];
                    $shuffleinvip[] =  self::$shuffle[self::$invipmap[$i]];
                }
            }
        '
;

        
$k = [
            
self::ENCRYPT => $this->keys[self::ENCRYPT],
            
self::DECRYPT => $this->keys[self::DECRYPT]
        ];
        
$init_encrypt '';
        
$init_decrypt '';

        
// Creating code for en- and decryption.
        
$crypt_block = [];
        foreach ([
self::ENCRYPTself::DECRYPT] as $c) {
            
/* Do the initial IP permutation. */
            
$crypt_block[$c] = '
                $in = unpack("N*", $in);
                $l  = $in[1];
                $r  = $in[2];
                $in = unpack("N*",
                    ($shuffleip[ $r        & 0xFF] & "\x80\x80\x80\x80\x80\x80\x80\x80") |
                    ($shuffleip[($r >>  8) & 0xFF] & "\x40\x40\x40\x40\x40\x40\x40\x40") |
                    ($shuffleip[($r >> 16) & 0xFF] & "\x20\x20\x20\x20\x20\x20\x20\x20") |
                    ($shuffleip[($r >> 24) & 0xFF] & "\x10\x10\x10\x10\x10\x10\x10\x10") |
                    ($shuffleip[ $l        & 0xFF] & "\x08\x08\x08\x08\x08\x08\x08\x08") |
                    ($shuffleip[($l >>  8) & 0xFF] & "\x04\x04\x04\x04\x04\x04\x04\x04") |
                    ($shuffleip[($l >> 16) & 0xFF] & "\x02\x02\x02\x02\x02\x02\x02\x02") |
                    ($shuffleip[($l >> 24) & 0xFF] & "\x01\x01\x01\x01\x01\x01\x01\x01")
                );
                ' 
/* Extract L0 and R0 */ '
                $l = $in[1];
                $r = $in[2];
            '
;

            
$l '$l';
            
$r '$r';

            
// Perform DES or 3DES.
            
for ($ki = -1$des_round 0$des_round $des_rounds; ++$des_round) {
                
// Perform the 16 steps.
                
for ($i 0$i 16; ++$i) {
                    
// start of "the Feistel (F) function" - see the following URL:
                    // http://en.wikipedia.org/wiki/Image:Data_Encryption_Standard_InfoBox_Diagram.png
                    // Merge key schedule.
                    
$crypt_block[$c] .= '
                        $b1 = ((' 
$r ' >>  3) & 0x1FFFFFFF)  ^ (' $r ' << 29) ^ ' $k[$c][++$ki] . ';
                        $b2 = ((' 
$r ' >> 31) & 0x00000001)  ^ (' $r ' <<  1) ^ ' $k[$c][++$ki] . ';' .
                        
/* S-box indexing. */
                        
$l ' = $sbox1[($b1 >> 24) & 0x3F] ^ $sbox2[($b2 >> 24) & 0x3F] ^
                                 $sbox3[($b1 >> 16) & 0x3F] ^ $sbox4[($b2 >> 16) & 0x3F] ^
                                 $sbox5[($b1 >>  8) & 0x3F] ^ $sbox6[($b2 >>  8) & 0x3F] ^
                                 $sbox7[ $b1        & 0x3F] ^ $sbox8[ $b2        & 0x3F] ^ ' 
$l ';
                    '
;
                    
// end of "the Feistel (F) function"

                    // swap L & R
                    
list($l$r) = [$r$l];
                }
                list(
$l$r) = [$r$l];
            }

            
// Perform the inverse IP permutation.
            
$crypt_block[$c] .= '$in =
                ($shuffleinvip[($l >> 24) & 0xFF] & "\x80\x80\x80\x80\x80\x80\x80\x80") |
                ($shuffleinvip[($r >> 24) & 0xFF] & "\x40\x40\x40\x40\x40\x40\x40\x40") |
                ($shuffleinvip[($l >> 16) & 0xFF] & "\x20\x20\x20\x20\x20\x20\x20\x20") |
                ($shuffleinvip[($r >> 16) & 0xFF] & "\x10\x10\x10\x10\x10\x10\x10\x10") |
                ($shuffleinvip[($l >>  8) & 0xFF] & "\x08\x08\x08\x08\x08\x08\x08\x08") |
                ($shuffleinvip[($r >>  8) & 0xFF] & "\x04\x04\x04\x04\x04\x04\x04\x04") |
                ($shuffleinvip[ $l        & 0xFF] & "\x02\x02\x02\x02\x02\x02\x02\x02") |
                ($shuffleinvip[ $r        & 0xFF] & "\x01\x01\x01\x01\x01\x01\x01\x01");
            '
;
        }

        
// Creates the inline-crypt function
        
$this->inline_crypt $this->createInlineCryptFunction(
            [
               
'init_crypt'    => $init_crypt,
               
'init_encrypt'  => $init_encrypt,
               
'init_decrypt'  => $init_decrypt,
               
'encrypt_block' => $crypt_block[self::ENCRYPT],
               
'decrypt_block' => $crypt_block[self::DECRYPT]
            ]
        );
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0142 ]--