#!/usr/bin/php $max_a_p) && ($combine_max > $max_b_p)) { $new_p = $combine_max; $new_k = $combine_key; } else if ($max_a_p > $max_b_p) { $new_p = $max_a_p; $new_k = $max_a_k; } else { $new_p = $max_b_p; $new_k = $max_b_k; } $max_b_p = -1; $max_b_k = null; if ($new_p > $max_a_p) { $max_a_p = $new_p; $max_a_k = $new_k; $x1 = $max_a_k[0]; $x2 = $max_a_k[1]; $x3 = $max_a_k[2]; $x4 = $max_a_k[3]; $x5 = $max_a_k[4]; $z1 = do_replace($key_c1, $x1, $c1); $z2 = do_replace($key_c2, $x2, $c2); $z3 = do_replace($key_c3, $x3, $c3); $z4 = do_replace($key_c4, $x4, $c4); $z5 = do_replace($key_c5, $x5, $c5); $z = mix5($z1, $z2, $z3, $z4, $z5); $x = "K1=$x1; K2=$x2; K3=$x3; K4=$x4; K5=$x5"; $kkk = p($z, true, true); $kkk3 = p3($z, true, true); $markov = markov_score($z); $sinkov = sinkov_score($z); $z = strtolower($z); echo date('d.m.Y H:i:s').' - '; echo "($x) $z\n"; echo "\t--> (kkk: $kkk, kkk3: $kkk3, markov: $markov, sinkov: $sinkov)\n"; save($x1, $x2, $x3, $x4, $x5); } $x1 = randomkey(1); $x2 = randomkey(2); $x3 = randomkey(3); $x4 = randomkey(4); $x5 = randomkey(5); $column_to_swap = rand(1,5); } if ($column_to_swap == 1) $x1 = randomswap($x1, RANDOM_SWAP_SCHRITTE); if ($column_to_swap == 2) $x2 = randomswap($x2, RANDOM_SWAP_SCHRITTE); if ($column_to_swap == 3) $x3 = randomswap($x3, RANDOM_SWAP_SCHRITTE); if ($column_to_swap == 4) $x4 = randomswap($x4, RANDOM_SWAP_SCHRITTE, true); if ($column_to_swap == 5) $x5 = randomswap($x5, RANDOM_SWAP_SCHRITTE); $z1 = do_replace($key_c1, $x1, $c1); $z2 = do_replace($key_c2, $x2, $c2); $z3 = do_replace($key_c3, $x3, $c3); $z4 = do_replace($key_c4, $x4, $c4); $z5 = do_replace($key_c5, $x5, $c5); $z = mix5($z1, $z2, $z3, $z4, $z5); $tmp_p = p($z, true, true); if ($tmp_p > $max_b_p) { $max_b_p = $tmp_p; $max_b_k = array($x1, $x2, $x3, $x4, $x5); } } function combine($k_a, $k_b) { $ret = null; $max = -1; $z = mix5($k_a[0], $k_a[1], $k_a[2], $k_a[3], $k_a[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_a[0], $k_a[1], $k_a[2], $k_a[3], $k_a[4]); $max = $loc; } $z = mix5($k_a[0], $k_a[1], $k_a[2], $k_a[3], $k_b[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_a[0], $k_a[1], $k_a[2], $k_a[3], $k_b[4]); $max = $loc; } $z = mix5($k_a[0], $k_a[1], $k_a[2], $k_b[3], $k_a[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_a[0], $k_a[1], $k_a[2], $k_b[3], $k_a[4]); $max = $loc; } $z = mix5($k_a[0], $k_a[1], $k_a[2], $k_b[3], $k_b[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_a[0], $k_a[1], $k_a[2], $k_b[3], $k_b[4]); $max = $loc; } $z = mix5($k_a[0], $k_a[1], $k_b[2], $k_a[3], $k_a[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_a[0], $k_a[1], $k_b[2], $k_a[3], $k_a[4]); $max = $loc; } $z = mix5($k_a[0], $k_a[1], $k_b[2], $k_a[3], $k_b[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_a[0], $k_a[1], $k_b[2], $k_a[3], $k_b[4]); $max = $loc; } $z = mix5($k_a[0], $k_a[1], $k_b[2], $k_b[3], $k_a[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_a[0], $k_a[1], $k_b[2], $k_b[3], $k_a[4]); $max = $loc; } $z = mix5($k_a[0], $k_a[1], $k_b[2], $k_b[3], $k_b[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_a[0], $k_a[1], $k_b[2], $k_b[3], $k_b[4]); $max = $loc; } $z = mix5($k_a[0], $k_b[1], $k_a[2], $k_a[3], $k_a[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_a[0], $k_b[1], $k_a[2], $k_a[3], $k_a[4]); $max = $loc; } $z = mix5($k_a[0], $k_b[1], $k_a[2], $k_a[3], $k_b[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_a[0], $k_b[1], $k_a[2], $k_a[3], $k_b[4]); $max = $loc; } $z = mix5($k_a[0], $k_b[1], $k_a[2], $k_b[3], $k_a[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_a[0], $k_b[1], $k_a[2], $k_b[3], $k_a[4]); $max = $loc; } $z = mix5($k_a[0], $k_b[1], $k_a[2], $k_b[3], $k_b[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_a[0], $k_b[1], $k_a[2], $k_b[3], $k_b[4]); $max = $loc; } $z = mix5($k_a[0], $k_b[1], $k_b[2], $k_a[3], $k_a[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_a[0], $k_b[1], $k_b[2], $k_a[3], $k_a[4]); $max = $loc; } $z = mix5($k_a[0], $k_b[1], $k_b[2], $k_a[3], $k_b[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_a[0], $k_b[1], $k_b[2], $k_a[3], $k_b[4]); $max = $loc; } $z = mix5($k_a[0], $k_b[1], $k_b[2], $k_b[3], $k_a[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_a[0], $k_b[1], $k_b[2], $k_b[3], $k_a[4]); $max = $loc; } $z = mix5($k_a[0], $k_b[1], $k_b[2], $k_b[3], $k_b[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_a[0], $k_b[1], $k_b[2], $k_b[3], $k_b[4]); $max = $loc; } $z = mix5($k_b[0], $k_a[1], $k_a[2], $k_a[3], $k_a[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_b[0], $k_a[1], $k_a[2], $k_a[3], $k_a[4]); $max = $loc; } $z = mix5($k_b[0], $k_a[1], $k_a[2], $k_a[3], $k_b[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_b[0], $k_a[1], $k_a[2], $k_a[3], $k_b[4]); $max = $loc; } $z = mix5($k_b[0], $k_a[1], $k_a[2], $k_b[3], $k_a[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_b[0], $k_a[1], $k_a[2], $k_b[3], $k_a[4]); $max = $loc; } $z = mix5($k_b[0], $k_a[1], $k_a[2], $k_b[3], $k_b[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_b[0], $k_a[1], $k_a[2], $k_b[3], $k_b[4]); $max = $loc; } $z = mix5($k_b[0], $k_a[1], $k_b[2], $k_a[3], $k_a[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_b[0], $k_a[1], $k_b[2], $k_a[3], $k_a[4]); $max = $loc; } $z = mix5($k_b[0], $k_a[1], $k_b[2], $k_a[3], $k_b[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_b[0], $k_a[1], $k_b[2], $k_a[3], $k_b[4]); $max = $loc; } $z = mix5($k_b[0], $k_a[1], $k_b[2], $k_b[3], $k_a[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_b[0], $k_a[1], $k_b[2], $k_b[3], $k_a[4]); $max = $loc; } $z = mix5($k_b[0], $k_a[1], $k_b[2], $k_b[3], $k_b[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_b[0], $k_a[1], $k_b[2], $k_b[3], $k_b[4]); $max = $loc; } $z = mix5($k_b[0], $k_b[1], $k_a[2], $k_a[3], $k_a[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_b[0], $k_b[1], $k_a[2], $k_a[3], $k_a[4]); $max = $loc; } $z = mix5($k_b[0], $k_b[1], $k_a[2], $k_a[3], $k_b[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_b[0], $k_b[1], $k_a[2], $k_a[3], $k_b[4]); $max = $loc; } $z = mix5($k_b[0], $k_b[1], $k_a[2], $k_b[3], $k_a[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_b[0], $k_b[1], $k_a[2], $k_b[3], $k_a[4]); $max = $loc; } $z = mix5($k_b[0], $k_b[1], $k_a[2], $k_b[3], $k_b[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_b[0], $k_b[1], $k_a[2], $k_b[3], $k_b[4]); $max = $loc; } $z = mix5($k_b[0], $k_b[1], $k_b[2], $k_a[3], $k_a[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_b[0], $k_b[1], $k_b[2], $k_a[3], $k_a[4]); $max = $loc; } $z = mix5($k_b[0], $k_b[1], $k_b[2], $k_a[3], $k_b[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_b[0], $k_b[1], $k_b[2], $k_a[3], $k_b[4]); $max = $loc; } $z = mix5($k_b[0], $k_b[1], $k_b[2], $k_b[3], $k_a[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_b[0], $k_b[1], $k_b[2], $k_b[3], $k_a[4]); $max = $loc; } $z = mix5($k_b[0], $k_b[1], $k_b[2], $k_b[3], $k_b[4]); $loc = p($z, true, true); if ($loc > $max) { $ret = array($k_b[0], $k_b[1], $k_b[2], $k_b[3], $k_b[4]); $max = $loc; } return array($max, $ret); } # --- function save($x1, $x2, $x3, $x4, $x5) { file_put_contents(SAVESTATE_FILE, "$x1\n$x2\n$x3\n$x4\n$x5\n"); }