Location: PHPKode > scripts > Solace script maze > solace-script-maze/table_shift_2.php
// #php version 4.1.0
// #Encoder
    $s = $this->php_implode($php_array);
    $p = rand(1, strlen($s));
    $s1 = substr($s, 0, $p);
    $s2 = substr($s, $p);
    $t1 = $this->table;

    do {
        $p1 = rand(1, 255);
        $t2 = substr($t1, $p1).substr($t1, 0, $p1);
        $es = strtr($s1, $t1, $t2);
    } while (!$this->safe_stream($es));
    $enc['enc_data1'] = $es;
    $enc['p1'] = $p1;

    do {
        $p2 = rand(1, 255);
        $t2 = substr($t1, $p2).substr($t1, 0, $p2);
        $es = strtr($s2, $t1, $t2);
    } while (!$this->safe_stream($es));
    $enc['enc_data2'] = $es;
    $enc['p2'] = $p2;


// #Decoder
<?php {MORPH_VARS}
    ob_start();
?>{ENC_DATA1}<?php
    $s1 = ob_get_contents();
    ob_clean();
?>{ENC_DATA2}<?php

function decod(&$s, $k) {
    declare(ticks=0);
    $t1 = $GLOBALS['V001'];
    $t2 = substr($t1, $k).substr($t1, 0, $k);
    return strtr($s, $t2, $t1);
}

function run($s) {
    return eval($s);
}

    $s2 = ob_get_contents();
    ob_end_clean();
    return run(decod($s1, {P1}).decod($s2, {P2}));
?>

Return current item: Solace script maze