Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/worker/src/PHPSecLi.../Crypt
File: DES.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/**
[2] Fix | Delete
* Pure-PHP implementation of DES.
[3] Fix | Delete
*
[4] Fix | Delete
* Uses mcrypt, if available, and an internal implementation, otherwise.
[5] Fix | Delete
*
[6] Fix | Delete
* PHP versions 4 and 5
[7] Fix | Delete
*
[8] Fix | Delete
* Useful resources are as follows:
[9] Fix | Delete
*
[10] Fix | Delete
* - {@link http://en.wikipedia.org/wiki/DES_supplementary_material Wikipedia: DES supplementary material}
[11] Fix | Delete
* - {@link http://www.itl.nist.gov/fipspubs/fip46-2.htm FIPS 46-2 - (DES), Data Encryption Standard}
[12] Fix | Delete
* - {@link http://www.cs.eku.edu/faculty/styer/460/Encrypt/JS-DES.html JavaScript DES Example}
[13] Fix | Delete
*
[14] Fix | Delete
* Here's a short example of how to use this library:
[15] Fix | Delete
* <code>
[16] Fix | Delete
* <?php
[17] Fix | Delete
* include 'Crypt/DES.php';
[18] Fix | Delete
*
[19] Fix | Delete
* $des = new Crypt_DES();
[20] Fix | Delete
*
[21] Fix | Delete
* $des->setKey('abcdefgh');
[22] Fix | Delete
*
[23] Fix | Delete
* $size = 10 * 1024;
[24] Fix | Delete
* $plaintext = '';
[25] Fix | Delete
* for ($i = 0; $i < $size; $i++) {
[26] Fix | Delete
* $plaintext.= 'a';
[27] Fix | Delete
* }
[28] Fix | Delete
*
[29] Fix | Delete
* echo $des->decrypt($des->encrypt($plaintext));
[30] Fix | Delete
* ?>
[31] Fix | Delete
* </code>
[32] Fix | Delete
*
[33] Fix | Delete
* LICENSE: Permission is hereby granted, free of charge, to any person obtaining a copy
[34] Fix | Delete
* of this software and associated documentation files (the "Software"), to deal
[35] Fix | Delete
* in the Software without restriction, including without limitation the rights
[36] Fix | Delete
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
[37] Fix | Delete
* copies of the Software, and to permit persons to whom the Software is
[38] Fix | Delete
* furnished to do so, subject to the following conditions:
[39] Fix | Delete
*
[40] Fix | Delete
* The above copyright notice and this permission notice shall be included in
[41] Fix | Delete
* all copies or substantial portions of the Software.
[42] Fix | Delete
*
[43] Fix | Delete
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
[44] Fix | Delete
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
[45] Fix | Delete
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
[46] Fix | Delete
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
[47] Fix | Delete
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
[48] Fix | Delete
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
[49] Fix | Delete
* THE SOFTWARE.
[50] Fix | Delete
*
[51] Fix | Delete
* @category Crypt
[52] Fix | Delete
* @package Crypt_DES
[53] Fix | Delete
* @author Jim Wigginton <terrafrost@php.net>
[54] Fix | Delete
* @copyright MMVII Jim Wigginton
[55] Fix | Delete
* @license http://www.opensource.org/licenses/mit-license.html MIT License
[56] Fix | Delete
* @link http://phpseclib.sourceforge.net
[57] Fix | Delete
*/
[58] Fix | Delete
[59] Fix | Delete
/**
[60] Fix | Delete
* Include Crypt_Base
[61] Fix | Delete
*
[62] Fix | Delete
* Base cipher class
[63] Fix | Delete
*/
[64] Fix | Delete
if (!class_exists('Crypt_Base')) {
[65] Fix | Delete
require_once dirname(__FILE__).'/Base.php';
[66] Fix | Delete
}
[67] Fix | Delete
[68] Fix | Delete
/**#@+
[69] Fix | Delete
* @access private
[70] Fix | Delete
* @see Crypt_DES::_setupKey()
[71] Fix | Delete
* @see Crypt_DES::_processBlock()
[72] Fix | Delete
*/
[73] Fix | Delete
/**
[74] Fix | Delete
* Contains $keys[CRYPT_DES_ENCRYPT]
[75] Fix | Delete
*/
[76] Fix | Delete
define('CRYPT_DES_ENCRYPT', 0);
[77] Fix | Delete
/**
[78] Fix | Delete
* Contains $keys[CRYPT_DES_DECRYPT]
[79] Fix | Delete
*/
[80] Fix | Delete
define('CRYPT_DES_DECRYPT', 1);
[81] Fix | Delete
/**#@-*/
[82] Fix | Delete
[83] Fix | Delete
/**#@+
[84] Fix | Delete
* @access public
[85] Fix | Delete
* @see Crypt_DES::encrypt()
[86] Fix | Delete
* @see Crypt_DES::decrypt()
[87] Fix | Delete
*/
[88] Fix | Delete
/**
[89] Fix | Delete
* Encrypt / decrypt using the Counter mode.
[90] Fix | Delete
*
[91] Fix | Delete
* Set to -1 since that's what Crypt/Random.php uses to index the CTR mode.
[92] Fix | Delete
*
[93] Fix | Delete
* @link http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Counter_.28CTR.29
[94] Fix | Delete
*/
[95] Fix | Delete
define('CRYPT_DES_MODE_CTR', CRYPT_MODE_CTR);
[96] Fix | Delete
/**
[97] Fix | Delete
* Encrypt / decrypt using the Electronic Code Book mode.
[98] Fix | Delete
*
[99] Fix | Delete
* @link http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Electronic_codebook_.28ECB.29
[100] Fix | Delete
*/
[101] Fix | Delete
define('CRYPT_DES_MODE_ECB', CRYPT_MODE_ECB);
[102] Fix | Delete
/**
[103] Fix | Delete
* Encrypt / decrypt using the Code Book Chaining mode.
[104] Fix | Delete
*
[105] Fix | Delete
* @link http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Cipher-block_chaining_.28CBC.29
[106] Fix | Delete
*/
[107] Fix | Delete
define('CRYPT_DES_MODE_CBC', CRYPT_MODE_CBC);
[108] Fix | Delete
/**
[109] Fix | Delete
* Encrypt / decrypt using the Cipher Feedback mode.
[110] Fix | Delete
*
[111] Fix | Delete
* @link http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Cipher_feedback_.28CFB.29
[112] Fix | Delete
*/
[113] Fix | Delete
define('CRYPT_DES_MODE_CFB', CRYPT_MODE_CFB);
[114] Fix | Delete
/**
[115] Fix | Delete
* Encrypt / decrypt using the Cipher Feedback mode.
[116] Fix | Delete
*
[117] Fix | Delete
* @link http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Output_feedback_.28OFB.29
[118] Fix | Delete
*/
[119] Fix | Delete
define('CRYPT_DES_MODE_OFB', CRYPT_MODE_OFB);
[120] Fix | Delete
/**#@-*/
[121] Fix | Delete
[122] Fix | Delete
/**#@+
[123] Fix | Delete
* @access private
[124] Fix | Delete
* @see Crypt_Base::Crypt_Base()
[125] Fix | Delete
*/
[126] Fix | Delete
/**
[127] Fix | Delete
* Toggles the internal implementation
[128] Fix | Delete
*/
[129] Fix | Delete
define('CRYPT_DES_MODE_INTERNAL', CRYPT_MODE_INTERNAL);
[130] Fix | Delete
/**
[131] Fix | Delete
* Toggles the mcrypt implementation
[132] Fix | Delete
*/
[133] Fix | Delete
define('CRYPT_DES_MODE_MCRYPT', CRYPT_MODE_MCRYPT);
[134] Fix | Delete
/**#@-*/
[135] Fix | Delete
[136] Fix | Delete
/**
[137] Fix | Delete
* Pure-PHP implementation of DES.
[138] Fix | Delete
*
[139] Fix | Delete
* @package Crypt_DES
[140] Fix | Delete
* @author Jim Wigginton <terrafrost@php.net>
[141] Fix | Delete
* @access public
[142] Fix | Delete
*/
[143] Fix | Delete
class Crypt_DES extends Crypt_Base
[144] Fix | Delete
{
[145] Fix | Delete
/**
[146] Fix | Delete
* Block Length of the cipher
[147] Fix | Delete
*
[148] Fix | Delete
* @see Crypt_Base::block_size
[149] Fix | Delete
* @var Integer
[150] Fix | Delete
* @access private
[151] Fix | Delete
*/
[152] Fix | Delete
public $block_size = 8;
[153] Fix | Delete
[154] Fix | Delete
/**
[155] Fix | Delete
* The Key
[156] Fix | Delete
*
[157] Fix | Delete
* @see Crypt_Base::key
[158] Fix | Delete
* @see setKey()
[159] Fix | Delete
* @var String
[160] Fix | Delete
* @access private
[161] Fix | Delete
*/
[162] Fix | Delete
public $key = "\0\0\0\0\0\0\0\0";
[163] Fix | Delete
[164] Fix | Delete
/**
[165] Fix | Delete
* The default password key_size used by setPassword()
[166] Fix | Delete
*
[167] Fix | Delete
* @see Crypt_Base::password_key_size
[168] Fix | Delete
* @see Crypt_Base::setPassword()
[169] Fix | Delete
* @var Integer
[170] Fix | Delete
* @access private
[171] Fix | Delete
*/
[172] Fix | Delete
public $password_key_size = 8;
[173] Fix | Delete
[174] Fix | Delete
/**
[175] Fix | Delete
* The namespace used by the cipher for its constants.
[176] Fix | Delete
*
[177] Fix | Delete
* @see Crypt_Base::const_namespace
[178] Fix | Delete
* @var String
[179] Fix | Delete
* @access private
[180] Fix | Delete
*/
[181] Fix | Delete
public $const_namespace = 'DES';
[182] Fix | Delete
[183] Fix | Delete
/**
[184] Fix | Delete
* The mcrypt specific name of the cipher
[185] Fix | Delete
*
[186] Fix | Delete
* @see Crypt_Base::cipher_name_mcrypt
[187] Fix | Delete
* @var String
[188] Fix | Delete
* @access private
[189] Fix | Delete
*/
[190] Fix | Delete
public $cipher_name_mcrypt = 'des';
[191] Fix | Delete
[192] Fix | Delete
/**
[193] Fix | Delete
* Optimizing value while CFB-encrypting
[194] Fix | Delete
*
[195] Fix | Delete
* @see Crypt_Base::cfb_init_len
[196] Fix | Delete
* @var Integer
[197] Fix | Delete
* @access private
[198] Fix | Delete
*/
[199] Fix | Delete
public $cfb_init_len = 500;
[200] Fix | Delete
[201] Fix | Delete
/**
[202] Fix | Delete
* Switch for DES/3DES encryption
[203] Fix | Delete
*
[204] Fix | Delete
* Used only if $engine == CRYPT_DES_MODE_INTERNAL
[205] Fix | Delete
*
[206] Fix | Delete
* @see Crypt_DES::_setupKey()
[207] Fix | Delete
* @see Crypt_DES::_processBlock()
[208] Fix | Delete
* @var Integer
[209] Fix | Delete
* @access private
[210] Fix | Delete
*/
[211] Fix | Delete
public $des_rounds = 1;
[212] Fix | Delete
[213] Fix | Delete
/**
[214] Fix | Delete
* max possible size of $key
[215] Fix | Delete
*
[216] Fix | Delete
* @see Crypt_DES::setKey()
[217] Fix | Delete
* @var String
[218] Fix | Delete
* @access private
[219] Fix | Delete
*/
[220] Fix | Delete
public $key_size_max = 8;
[221] Fix | Delete
[222] Fix | Delete
/**
[223] Fix | Delete
* The Key Schedule
[224] Fix | Delete
*
[225] Fix | Delete
* @see Crypt_DES::_setupKey()
[226] Fix | Delete
* @var Array
[227] Fix | Delete
* @access private
[228] Fix | Delete
*/
[229] Fix | Delete
public $keys;
[230] Fix | Delete
[231] Fix | Delete
/**
[232] Fix | Delete
* Shuffle table.
[233] Fix | Delete
*
[234] Fix | Delete
* For each byte value index, the entry holds an 8-byte string
[235] Fix | Delete
* with each byte containing all bits in the same state as the
[236] Fix | Delete
* corresponding bit in the index value.
[237] Fix | Delete
*
[238] Fix | Delete
* @see Crypt_DES::_processBlock()
[239] Fix | Delete
* @see Crypt_DES::_setupKey()
[240] Fix | Delete
* @var Array
[241] Fix | Delete
* @access private
[242] Fix | Delete
*/
[243] Fix | Delete
var $shuffle = array(
[244] Fix | Delete
"\x00\x00\x00\x00\x00\x00\x00\x00", "\x00\x00\x00\x00\x00\x00\x00\xFF",
[245] Fix | Delete
"\x00\x00\x00\x00\x00\x00\xFF\x00", "\x00\x00\x00\x00\x00\x00\xFF\xFF",
[246] Fix | Delete
"\x00\x00\x00\x00\x00\xFF\x00\x00", "\x00\x00\x00\x00\x00\xFF\x00\xFF",
[247] Fix | Delete
"\x00\x00\x00\x00\x00\xFF\xFF\x00", "\x00\x00\x00\x00\x00\xFF\xFF\xFF",
[248] Fix | Delete
"\x00\x00\x00\x00\xFF\x00\x00\x00", "\x00\x00\x00\x00\xFF\x00\x00\xFF",
[249] Fix | Delete
"\x00\x00\x00\x00\xFF\x00\xFF\x00", "\x00\x00\x00\x00\xFF\x00\xFF\xFF",
[250] Fix | Delete
"\x00\x00\x00\x00\xFF\xFF\x00\x00", "\x00\x00\x00\x00\xFF\xFF\x00\xFF",
[251] Fix | Delete
"\x00\x00\x00\x00\xFF\xFF\xFF\x00", "\x00\x00\x00\x00\xFF\xFF\xFF\xFF",
[252] Fix | Delete
"\x00\x00\x00\xFF\x00\x00\x00\x00", "\x00\x00\x00\xFF\x00\x00\x00\xFF",
[253] Fix | Delete
"\x00\x00\x00\xFF\x00\x00\xFF\x00", "\x00\x00\x00\xFF\x00\x00\xFF\xFF",
[254] Fix | Delete
"\x00\x00\x00\xFF\x00\xFF\x00\x00", "\x00\x00\x00\xFF\x00\xFF\x00\xFF",
[255] Fix | Delete
"\x00\x00\x00\xFF\x00\xFF\xFF\x00", "\x00\x00\x00\xFF\x00\xFF\xFF\xFF",
[256] Fix | Delete
"\x00\x00\x00\xFF\xFF\x00\x00\x00", "\x00\x00\x00\xFF\xFF\x00\x00\xFF",
[257] Fix | Delete
"\x00\x00\x00\xFF\xFF\x00\xFF\x00", "\x00\x00\x00\xFF\xFF\x00\xFF\xFF",
[258] Fix | Delete
"\x00\x00\x00\xFF\xFF\xFF\x00\x00", "\x00\x00\x00\xFF\xFF\xFF\x00\xFF",
[259] Fix | Delete
"\x00\x00\x00\xFF\xFF\xFF\xFF\x00", "\x00\x00\x00\xFF\xFF\xFF\xFF\xFF",
[260] Fix | Delete
"\x00\x00\xFF\x00\x00\x00\x00\x00", "\x00\x00\xFF\x00\x00\x00\x00\xFF",
[261] Fix | Delete
"\x00\x00\xFF\x00\x00\x00\xFF\x00", "\x00\x00\xFF\x00\x00\x00\xFF\xFF",
[262] Fix | Delete
"\x00\x00\xFF\x00\x00\xFF\x00\x00", "\x00\x00\xFF\x00\x00\xFF\x00\xFF",
[263] Fix | Delete
"\x00\x00\xFF\x00\x00\xFF\xFF\x00", "\x00\x00\xFF\x00\x00\xFF\xFF\xFF",
[264] Fix | Delete
"\x00\x00\xFF\x00\xFF\x00\x00\x00", "\x00\x00\xFF\x00\xFF\x00\x00\xFF",
[265] Fix | Delete
"\x00\x00\xFF\x00\xFF\x00\xFF\x00", "\x00\x00\xFF\x00\xFF\x00\xFF\xFF",
[266] Fix | Delete
"\x00\x00\xFF\x00\xFF\xFF\x00\x00", "\x00\x00\xFF\x00\xFF\xFF\x00\xFF",
[267] Fix | Delete
"\x00\x00\xFF\x00\xFF\xFF\xFF\x00", "\x00\x00\xFF\x00\xFF\xFF\xFF\xFF",
[268] Fix | Delete
"\x00\x00\xFF\xFF\x00\x00\x00\x00", "\x00\x00\xFF\xFF\x00\x00\x00\xFF",
[269] Fix | Delete
"\x00\x00\xFF\xFF\x00\x00\xFF\x00", "\x00\x00\xFF\xFF\x00\x00\xFF\xFF",
[270] Fix | Delete
"\x00\x00\xFF\xFF\x00\xFF\x00\x00", "\x00\x00\xFF\xFF\x00\xFF\x00\xFF",
[271] Fix | Delete
"\x00\x00\xFF\xFF\x00\xFF\xFF\x00", "\x00\x00\xFF\xFF\x00\xFF\xFF\xFF",
[272] Fix | Delete
"\x00\x00\xFF\xFF\xFF\x00\x00\x00", "\x00\x00\xFF\xFF\xFF\x00\x00\xFF",
[273] Fix | Delete
"\x00\x00\xFF\xFF\xFF\x00\xFF\x00", "\x00\x00\xFF\xFF\xFF\x00\xFF\xFF",
[274] Fix | Delete
"\x00\x00\xFF\xFF\xFF\xFF\x00\x00", "\x00\x00\xFF\xFF\xFF\xFF\x00\xFF",
[275] Fix | Delete
"\x00\x00\xFF\xFF\xFF\xFF\xFF\x00", "\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF",
[276] Fix | Delete
"\x00\xFF\x00\x00\x00\x00\x00\x00", "\x00\xFF\x00\x00\x00\x00\x00\xFF",
[277] Fix | Delete
"\x00\xFF\x00\x00\x00\x00\xFF\x00", "\x00\xFF\x00\x00\x00\x00\xFF\xFF",
[278] Fix | Delete
"\x00\xFF\x00\x00\x00\xFF\x00\x00", "\x00\xFF\x00\x00\x00\xFF\x00\xFF",
[279] Fix | Delete
"\x00\xFF\x00\x00\x00\xFF\xFF\x00", "\x00\xFF\x00\x00\x00\xFF\xFF\xFF",
[280] Fix | Delete
"\x00\xFF\x00\x00\xFF\x00\x00\x00", "\x00\xFF\x00\x00\xFF\x00\x00\xFF",
[281] Fix | Delete
"\x00\xFF\x00\x00\xFF\x00\xFF\x00", "\x00\xFF\x00\x00\xFF\x00\xFF\xFF",
[282] Fix | Delete
"\x00\xFF\x00\x00\xFF\xFF\x00\x00", "\x00\xFF\x00\x00\xFF\xFF\x00\xFF",
[283] Fix | Delete
"\x00\xFF\x00\x00\xFF\xFF\xFF\x00", "\x00\xFF\x00\x00\xFF\xFF\xFF\xFF",
[284] Fix | Delete
"\x00\xFF\x00\xFF\x00\x00\x00\x00", "\x00\xFF\x00\xFF\x00\x00\x00\xFF",
[285] Fix | Delete
"\x00\xFF\x00\xFF\x00\x00\xFF\x00", "\x00\xFF\x00\xFF\x00\x00\xFF\xFF",
[286] Fix | Delete
"\x00\xFF\x00\xFF\x00\xFF\x00\x00", "\x00\xFF\x00\xFF\x00\xFF\x00\xFF",
[287] Fix | Delete
"\x00\xFF\x00\xFF\x00\xFF\xFF\x00", "\x00\xFF\x00\xFF\x00\xFF\xFF\xFF",
[288] Fix | Delete
"\x00\xFF\x00\xFF\xFF\x00\x00\x00", "\x00\xFF\x00\xFF\xFF\x00\x00\xFF",
[289] Fix | Delete
"\x00\xFF\x00\xFF\xFF\x00\xFF\x00", "\x00\xFF\x00\xFF\xFF\x00\xFF\xFF",
[290] Fix | Delete
"\x00\xFF\x00\xFF\xFF\xFF\x00\x00", "\x00\xFF\x00\xFF\xFF\xFF\x00\xFF",
[291] Fix | Delete
"\x00\xFF\x00\xFF\xFF\xFF\xFF\x00", "\x00\xFF\x00\xFF\xFF\xFF\xFF\xFF",
[292] Fix | Delete
"\x00\xFF\xFF\x00\x00\x00\x00\x00", "\x00\xFF\xFF\x00\x00\x00\x00\xFF",
[293] Fix | Delete
"\x00\xFF\xFF\x00\x00\x00\xFF\x00", "\x00\xFF\xFF\x00\x00\x00\xFF\xFF",
[294] Fix | Delete
"\x00\xFF\xFF\x00\x00\xFF\x00\x00", "\x00\xFF\xFF\x00\x00\xFF\x00\xFF",
[295] Fix | Delete
"\x00\xFF\xFF\x00\x00\xFF\xFF\x00", "\x00\xFF\xFF\x00\x00\xFF\xFF\xFF",
[296] Fix | Delete
"\x00\xFF\xFF\x00\xFF\x00\x00\x00", "\x00\xFF\xFF\x00\xFF\x00\x00\xFF",
[297] Fix | Delete
"\x00\xFF\xFF\x00\xFF\x00\xFF\x00", "\x00\xFF\xFF\x00\xFF\x00\xFF\xFF",
[298] Fix | Delete
"\x00\xFF\xFF\x00\xFF\xFF\x00\x00", "\x00\xFF\xFF\x00\xFF\xFF\x00\xFF",
[299] Fix | Delete
"\x00\xFF\xFF\x00\xFF\xFF\xFF\x00", "\x00\xFF\xFF\x00\xFF\xFF\xFF\xFF",
[300] Fix | Delete
"\x00\xFF\xFF\xFF\x00\x00\x00\x00", "\x00\xFF\xFF\xFF\x00\x00\x00\xFF",
[301] Fix | Delete
"\x00\xFF\xFF\xFF\x00\x00\xFF\x00", "\x00\xFF\xFF\xFF\x00\x00\xFF\xFF",
[302] Fix | Delete
"\x00\xFF\xFF\xFF\x00\xFF\x00\x00", "\x00\xFF\xFF\xFF\x00\xFF\x00\xFF",
[303] Fix | Delete
"\x00\xFF\xFF\xFF\x00\xFF\xFF\x00", "\x00\xFF\xFF\xFF\x00\xFF\xFF\xFF",
[304] Fix | Delete
"\x00\xFF\xFF\xFF\xFF\x00\x00\x00", "\x00\xFF\xFF\xFF\xFF\x00\x00\xFF",
[305] Fix | Delete
"\x00\xFF\xFF\xFF\xFF\x00\xFF\x00", "\x00\xFF\xFF\xFF\xFF\x00\xFF\xFF",
[306] Fix | Delete
"\x00\xFF\xFF\xFF\xFF\xFF\x00\x00", "\x00\xFF\xFF\xFF\xFF\xFF\x00\xFF",
[307] Fix | Delete
"\x00\xFF\xFF\xFF\xFF\xFF\xFF\x00", "\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF",
[308] Fix | Delete
"\xFF\x00\x00\x00\x00\x00\x00\x00", "\xFF\x00\x00\x00\x00\x00\x00\xFF",
[309] Fix | Delete
"\xFF\x00\x00\x00\x00\x00\xFF\x00", "\xFF\x00\x00\x00\x00\x00\xFF\xFF",
[310] Fix | Delete
"\xFF\x00\x00\x00\x00\xFF\x00\x00", "\xFF\x00\x00\x00\x00\xFF\x00\xFF",
[311] Fix | Delete
"\xFF\x00\x00\x00\x00\xFF\xFF\x00", "\xFF\x00\x00\x00\x00\xFF\xFF\xFF",
[312] Fix | Delete
"\xFF\x00\x00\x00\xFF\x00\x00\x00", "\xFF\x00\x00\x00\xFF\x00\x00\xFF",
[313] Fix | Delete
"\xFF\x00\x00\x00\xFF\x00\xFF\x00", "\xFF\x00\x00\x00\xFF\x00\xFF\xFF",
[314] Fix | Delete
"\xFF\x00\x00\x00\xFF\xFF\x00\x00", "\xFF\x00\x00\x00\xFF\xFF\x00\xFF",
[315] Fix | Delete
"\xFF\x00\x00\x00\xFF\xFF\xFF\x00", "\xFF\x00\x00\x00\xFF\xFF\xFF\xFF",
[316] Fix | Delete
"\xFF\x00\x00\xFF\x00\x00\x00\x00", "\xFF\x00\x00\xFF\x00\x00\x00\xFF",
[317] Fix | Delete
"\xFF\x00\x00\xFF\x00\x00\xFF\x00", "\xFF\x00\x00\xFF\x00\x00\xFF\xFF",
[318] Fix | Delete
"\xFF\x00\x00\xFF\x00\xFF\x00\x00", "\xFF\x00\x00\xFF\x00\xFF\x00\xFF",
[319] Fix | Delete
"\xFF\x00\x00\xFF\x00\xFF\xFF\x00", "\xFF\x00\x00\xFF\x00\xFF\xFF\xFF",
[320] Fix | Delete
"\xFF\x00\x00\xFF\xFF\x00\x00\x00", "\xFF\x00\x00\xFF\xFF\x00\x00\xFF",
[321] Fix | Delete
"\xFF\x00\x00\xFF\xFF\x00\xFF\x00", "\xFF\x00\x00\xFF\xFF\x00\xFF\xFF",
[322] Fix | Delete
"\xFF\x00\x00\xFF\xFF\xFF\x00\x00", "\xFF\x00\x00\xFF\xFF\xFF\x00\xFF",
[323] Fix | Delete
"\xFF\x00\x00\xFF\xFF\xFF\xFF\x00", "\xFF\x00\x00\xFF\xFF\xFF\xFF\xFF",
[324] Fix | Delete
"\xFF\x00\xFF\x00\x00\x00\x00\x00", "\xFF\x00\xFF\x00\x00\x00\x00\xFF",
[325] Fix | Delete
"\xFF\x00\xFF\x00\x00\x00\xFF\x00", "\xFF\x00\xFF\x00\x00\x00\xFF\xFF",
[326] Fix | Delete
"\xFF\x00\xFF\x00\x00\xFF\x00\x00", "\xFF\x00\xFF\x00\x00\xFF\x00\xFF",
[327] Fix | Delete
"\xFF\x00\xFF\x00\x00\xFF\xFF\x00", "\xFF\x00\xFF\x00\x00\xFF\xFF\xFF",
[328] Fix | Delete
"\xFF\x00\xFF\x00\xFF\x00\x00\x00", "\xFF\x00\xFF\x00\xFF\x00\x00\xFF",
[329] Fix | Delete
"\xFF\x00\xFF\x00\xFF\x00\xFF\x00", "\xFF\x00\xFF\x00\xFF\x00\xFF\xFF",
[330] Fix | Delete
"\xFF\x00\xFF\x00\xFF\xFF\x00\x00", "\xFF\x00\xFF\x00\xFF\xFF\x00\xFF",
[331] Fix | Delete
"\xFF\x00\xFF\x00\xFF\xFF\xFF\x00", "\xFF\x00\xFF\x00\xFF\xFF\xFF\xFF",
[332] Fix | Delete
"\xFF\x00\xFF\xFF\x00\x00\x00\x00", "\xFF\x00\xFF\xFF\x00\x00\x00\xFF",
[333] Fix | Delete
"\xFF\x00\xFF\xFF\x00\x00\xFF\x00", "\xFF\x00\xFF\xFF\x00\x00\xFF\xFF",
[334] Fix | Delete
"\xFF\x00\xFF\xFF\x00\xFF\x00\x00", "\xFF\x00\xFF\xFF\x00\xFF\x00\xFF",
[335] Fix | Delete
"\xFF\x00\xFF\xFF\x00\xFF\xFF\x00", "\xFF\x00\xFF\xFF\x00\xFF\xFF\xFF",
[336] Fix | Delete
"\xFF\x00\xFF\xFF\xFF\x00\x00\x00", "\xFF\x00\xFF\xFF\xFF\x00\x00\xFF",
[337] Fix | Delete
"\xFF\x00\xFF\xFF\xFF\x00\xFF\x00", "\xFF\x00\xFF\xFF\xFF\x00\xFF\xFF",
[338] Fix | Delete
"\xFF\x00\xFF\xFF\xFF\xFF\x00\x00", "\xFF\x00\xFF\xFF\xFF\xFF\x00\xFF",
[339] Fix | Delete
"\xFF\x00\xFF\xFF\xFF\xFF\xFF\x00", "\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF",
[340] Fix | Delete
"\xFF\xFF\x00\x00\x00\x00\x00\x00", "\xFF\xFF\x00\x00\x00\x00\x00\xFF",
[341] Fix | Delete
"\xFF\xFF\x00\x00\x00\x00\xFF\x00", "\xFF\xFF\x00\x00\x00\x00\xFF\xFF",
[342] Fix | Delete
"\xFF\xFF\x00\x00\x00\xFF\x00\x00", "\xFF\xFF\x00\x00\x00\xFF\x00\xFF",
[343] Fix | Delete
"\xFF\xFF\x00\x00\x00\xFF\xFF\x00", "\xFF\xFF\x00\x00\x00\xFF\xFF\xFF",
[344] Fix | Delete
"\xFF\xFF\x00\x00\xFF\x00\x00\x00", "\xFF\xFF\x00\x00\xFF\x00\x00\xFF",
[345] Fix | Delete
"\xFF\xFF\x00\x00\xFF\x00\xFF\x00", "\xFF\xFF\x00\x00\xFF\x00\xFF\xFF",
[346] Fix | Delete
"\xFF\xFF\x00\x00\xFF\xFF\x00\x00", "\xFF\xFF\x00\x00\xFF\xFF\x00\xFF",
[347] Fix | Delete
"\xFF\xFF\x00\x00\xFF\xFF\xFF\x00", "\xFF\xFF\x00\x00\xFF\xFF\xFF\xFF",
[348] Fix | Delete
"\xFF\xFF\x00\xFF\x00\x00\x00\x00", "\xFF\xFF\x00\xFF\x00\x00\x00\xFF",
[349] Fix | Delete
"\xFF\xFF\x00\xFF\x00\x00\xFF\x00", "\xFF\xFF\x00\xFF\x00\x00\xFF\xFF",
[350] Fix | Delete
"\xFF\xFF\x00\xFF\x00\xFF\x00\x00", "\xFF\xFF\x00\xFF\x00\xFF\x00\xFF",
[351] Fix | Delete
"\xFF\xFF\x00\xFF\x00\xFF\xFF\x00", "\xFF\xFF\x00\xFF\x00\xFF\xFF\xFF",
[352] Fix | Delete
"\xFF\xFF\x00\xFF\xFF\x00\x00\x00", "\xFF\xFF\x00\xFF\xFF\x00\x00\xFF",
[353] Fix | Delete
"\xFF\xFF\x00\xFF\xFF\x00\xFF\x00", "\xFF\xFF\x00\xFF\xFF\x00\xFF\xFF",
[354] Fix | Delete
"\xFF\xFF\x00\xFF\xFF\xFF\x00\x00", "\xFF\xFF\x00\xFF\xFF\xFF\x00\xFF",
[355] Fix | Delete
"\xFF\xFF\x00\xFF\xFF\xFF\xFF\x00", "\xFF\xFF\x00\xFF\xFF\xFF\xFF\xFF",
[356] Fix | Delete
"\xFF\xFF\xFF\x00\x00\x00\x00\x00", "\xFF\xFF\xFF\x00\x00\x00\x00\xFF",
[357] Fix | Delete
"\xFF\xFF\xFF\x00\x00\x00\xFF\x00", "\xFF\xFF\xFF\x00\x00\x00\xFF\xFF",
[358] Fix | Delete
"\xFF\xFF\xFF\x00\x00\xFF\x00\x00", "\xFF\xFF\xFF\x00\x00\xFF\x00\xFF",
[359] Fix | Delete
"\xFF\xFF\xFF\x00\x00\xFF\xFF\x00", "\xFF\xFF\xFF\x00\x00\xFF\xFF\xFF",
[360] Fix | Delete
"\xFF\xFF\xFF\x00\xFF\x00\x00\x00", "\xFF\xFF\xFF\x00\xFF\x00\x00\xFF",
[361] Fix | Delete
"\xFF\xFF\xFF\x00\xFF\x00\xFF\x00", "\xFF\xFF\xFF\x00\xFF\x00\xFF\xFF",
[362] Fix | Delete
"\xFF\xFF\xFF\x00\xFF\xFF\x00\x00", "\xFF\xFF\xFF\x00\xFF\xFF\x00\xFF",
[363] Fix | Delete
"\xFF\xFF\xFF\x00\xFF\xFF\xFF\x00", "\xFF\xFF\xFF\x00\xFF\xFF\xFF\xFF",
[364] Fix | Delete
"\xFF\xFF\xFF\xFF\x00\x00\x00\x00", "\xFF\xFF\xFF\xFF\x00\x00\x00\xFF",
[365] Fix | Delete
"\xFF\xFF\xFF\xFF\x00\x00\xFF\x00", "\xFF\xFF\xFF\xFF\x00\x00\xFF\xFF",
[366] Fix | Delete
"\xFF\xFF\xFF\xFF\x00\xFF\x00\x00", "\xFF\xFF\xFF\xFF\x00\xFF\x00\xFF",
[367] Fix | Delete
"\xFF\xFF\xFF\xFF\x00\xFF\xFF\x00", "\xFF\xFF\xFF\xFF\x00\xFF\xFF\xFF",
[368] Fix | Delete
"\xFF\xFF\xFF\xFF\xFF\x00\x00\x00", "\xFF\xFF\xFF\xFF\xFF\x00\x00\xFF",
[369] Fix | Delete
"\xFF\xFF\xFF\xFF\xFF\x00\xFF\x00", "\xFF\xFF\xFF\xFF\xFF\x00\xFF\xFF",
[370] Fix | Delete
"\xFF\xFF\xFF\xFF\xFF\xFF\x00\x00", "\xFF\xFF\xFF\xFF\xFF\xFF\x00\xFF",
[371] Fix | Delete
"\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00", "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF",
[372] Fix | Delete
);
[373] Fix | Delete
[374] Fix | Delete
/**
[375] Fix | Delete
* IP mapping helper table.
[376] Fix | Delete
*
[377] Fix | Delete
* Indexing this table with each source byte performs the initial bit permutation.
[378] Fix | Delete
*
[379] Fix | Delete
* @var Array
[380] Fix | Delete
* @access private
[381] Fix | Delete
*/
[382] Fix | Delete
var $ipmap = array(
[383] Fix | Delete
0x00, 0x10, 0x01, 0x11, 0x20, 0x30, 0x21, 0x31,
[384] Fix | Delete
0x02, 0x12, 0x03, 0x13, 0x22, 0x32, 0x23, 0x33,
[385] Fix | Delete
0x40, 0x50, 0x41, 0x51, 0x60, 0x70, 0x61, 0x71,
[386] Fix | Delete
0x42, 0x52, 0x43, 0x53, 0x62, 0x72, 0x63, 0x73,
[387] Fix | Delete
0x04, 0x14, 0x05, 0x15, 0x24, 0x34, 0x25, 0x35,
[388] Fix | Delete
0x06, 0x16, 0x07, 0x17, 0x26, 0x36, 0x27, 0x37,
[389] Fix | Delete
0x44, 0x54, 0x45, 0x55, 0x64, 0x74, 0x65, 0x75,
[390] Fix | Delete
0x46, 0x56, 0x47, 0x57, 0x66, 0x76, 0x67, 0x77,
[391] Fix | Delete
0x80, 0x90, 0x81, 0x91, 0xA0, 0xB0, 0xA1, 0xB1,
[392] Fix | Delete
0x82, 0x92, 0x83, 0x93, 0xA2, 0xB2, 0xA3, 0xB3,
[393] Fix | Delete
0xC0, 0xD0, 0xC1, 0xD1, 0xE0, 0xF0, 0xE1, 0xF1,
[394] Fix | Delete
0xC2, 0xD2, 0xC3, 0xD3, 0xE2, 0xF2, 0xE3, 0xF3,
[395] Fix | Delete
0x84, 0x94, 0x85, 0x95, 0xA4, 0xB4, 0xA5, 0xB5,
[396] Fix | Delete
0x86, 0x96, 0x87, 0x97, 0xA6, 0xB6, 0xA7, 0xB7,
[397] Fix | Delete
0xC4, 0xD4, 0xC5, 0xD5, 0xE4, 0xF4, 0xE5, 0xF5,
[398] Fix | Delete
0xC6, 0xD6, 0xC7, 0xD7, 0xE6, 0xF6, 0xE7, 0xF7,
[399] Fix | Delete
0x08, 0x18, 0x09, 0x19, 0x28, 0x38, 0x29, 0x39,
[400] Fix | Delete
0x0A, 0x1A, 0x0B, 0x1B, 0x2A, 0x3A, 0x2B, 0x3B,
[401] Fix | Delete
0x48, 0x58, 0x49, 0x59, 0x68, 0x78, 0x69, 0x79,
[402] Fix | Delete
0x4A, 0x5A, 0x4B, 0x5B, 0x6A, 0x7A, 0x6B, 0x7B,
[403] Fix | Delete
0x0C, 0x1C, 0x0D, 0x1D, 0x2C, 0x3C, 0x2D, 0x3D,
[404] Fix | Delete
0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
[405] Fix | Delete
0x4C, 0x5C, 0x4D, 0x5D, 0x6C, 0x7C, 0x6D, 0x7D,
[406] Fix | Delete
0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
[407] Fix | Delete
0x88, 0x98, 0x89, 0x99, 0xA8, 0xB8, 0xA9, 0xB9,
[408] Fix | Delete
0x8A, 0x9A, 0x8B, 0x9B, 0xAA, 0xBA, 0xAB, 0xBB,
[409] Fix | Delete
0xC8, 0xD8, 0xC9, 0xD9, 0xE8, 0xF8, 0xE9, 0xF9,
[410] Fix | Delete
0xCA, 0xDA, 0xCB, 0xDB, 0xEA, 0xFA, 0xEB, 0xFB,
[411] Fix | Delete
0x8C, 0x9C, 0x8D, 0x9D, 0xAC, 0xBC, 0xAD, 0xBD,
[412] Fix | Delete
0x8E, 0x9E, 0x8F, 0x9F, 0xAE, 0xBE, 0xAF, 0xBF,
[413] Fix | Delete
0xCC, 0xDC, 0xCD, 0xDD, 0xEC, 0xFC, 0xED, 0xFD,
[414] Fix | Delete
0xCE, 0xDE, 0xCF, 0xDF, 0xEE, 0xFE, 0xEF, 0xFF,
[415] Fix | Delete
);
[416] Fix | Delete
[417] Fix | Delete
/**
[418] Fix | Delete
* Inverse IP mapping helper table.
[419] Fix | Delete
* Indexing this table with a byte value reverses the bit order.
[420] Fix | Delete
*
[421] Fix | Delete
* @var Array
[422] Fix | Delete
* @access private
[423] Fix | Delete
*/
[424] Fix | Delete
var $invipmap = array(
[425] Fix | Delete
0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0,
[426] Fix | Delete
0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0,
[427] Fix | Delete
0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8,
[428] Fix | Delete
0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8,
[429] Fix | Delete
0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4,
[430] Fix | Delete
0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4,
[431] Fix | Delete
0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC,
[432] Fix | Delete
0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC,
[433] Fix | Delete
0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2,
[434] Fix | Delete
0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2,
[435] Fix | Delete
0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA,
[436] Fix | Delete
0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA,
[437] Fix | Delete
0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6,
[438] Fix | Delete
0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6,
[439] Fix | Delete
0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE,
[440] Fix | Delete
0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE,
[441] Fix | Delete
0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1,
[442] Fix | Delete
0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1,
[443] Fix | Delete
0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9,
[444] Fix | Delete
0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9,
[445] Fix | Delete
0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5,
[446] Fix | Delete
0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5,
[447] Fix | Delete
0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED,
[448] Fix | Delete
0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD,
[449] Fix | Delete
0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3,
[450] Fix | Delete
0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3,
[451] Fix | Delete
0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB,
[452] Fix | Delete
0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB,
[453] Fix | Delete
0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7,
[454] Fix | Delete
0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7,
[455] Fix | Delete
0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF,
[456] Fix | Delete
0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF,
[457] Fix | Delete
);
[458] Fix | Delete
[459] Fix | Delete
/**
[460] Fix | Delete
* Pre-permuted S-box1
[461] Fix | Delete
*
[462] Fix | Delete
* Each box ($sbox1-$sbox8) has been vectorized, then each value pre-permuted using the
[463] Fix | Delete
* P table: concatenation can then be replaced by exclusive ORs.
[464] Fix | Delete
*
[465] Fix | Delete
* @var Array
[466] Fix | Delete
* @access private
[467] Fix | Delete
*/
[468] Fix | Delete
var $sbox1 = array(
[469] Fix | Delete
0x00808200, 0x00000000, 0x00008000, 0x00808202,
[470] Fix | Delete
0x00808002, 0x00008202, 0x00000002, 0x00008000,
[471] Fix | Delete
0x00000200, 0x00808200, 0x00808202, 0x00000200,
[472] Fix | Delete
0x00800202, 0x00808002, 0x00800000, 0x00000002,
[473] Fix | Delete
0x00000202, 0x00800200, 0x00800200, 0x00008200,
[474] Fix | Delete
0x00008200, 0x00808000, 0x00808000, 0x00800202,
[475] Fix | Delete
0x00008002, 0x00800002, 0x00800002, 0x00008002,
[476] Fix | Delete
0x00000000, 0x00000202, 0x00008202, 0x00800000,
[477] Fix | Delete
0x00008000, 0x00808202, 0x00000002, 0x00808000,
[478] Fix | Delete
0x00808200, 0x00800000, 0x00800000, 0x00000200,
[479] Fix | Delete
0x00808002, 0x00008000, 0x00008200, 0x00800002,
[480] Fix | Delete
0x00000200, 0x00000002, 0x00800202, 0x00008202,
[481] Fix | Delete
0x00808202, 0x00008002, 0x00808000, 0x00800202,
[482] Fix | Delete
0x00800002, 0x00000202, 0x00008202, 0x00808200,
[483] Fix | Delete
0x00000202, 0x00800200, 0x00800200, 0x00000000,
[484] Fix | Delete
0x00008002, 0x00008200, 0x00000000, 0x00808002,
[485] Fix | Delete
);
[486] Fix | Delete
[487] Fix | Delete
/**
[488] Fix | Delete
* Pre-permuted S-box2
[489] Fix | Delete
*
[490] Fix | Delete
* @var Array
[491] Fix | Delete
* @access private
[492] Fix | Delete
*/
[493] Fix | Delete
var $sbox2 = array(
[494] Fix | Delete
0x40084010, 0x40004000, 0x00004000, 0x00084010,
[495] Fix | Delete
0x00080000, 0x00000010, 0x40080010, 0x40004010,
[496] Fix | Delete
0x40000010, 0x40084010, 0x40084000, 0x40000000,
[497] Fix | Delete
0x40004000, 0x00080000, 0x00000010, 0x40080010,
[498] Fix | Delete
0x00084000, 0x00080010, 0x40004010, 0x00000000,
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function