Example #1
0
}
if (isset($_POST['random'])) {
    $key_t = mt_rand(0, count($mulzahl) - 1);
    $key2_t = mt_rand(0, count($rotzahl) - 1);
    $key = $mulzahl[$key_t];
    $key2 = $rotzahl[$key2_t];
}
for ($t = 0; $t < 100; $t++) {
    if ($t < 10) {
        $tt = "0" . $t;
    } else {
        $tt = $t;
    }
    $subst[] = $tt;
}
$subst2 = createMulAlfa($subst, $key);
$subst2 = rotieren($subst2, $key2);
$alfah = makehomoalfa($subst2, "de");
foreach ($alfah as $num) {
    foreach ($num as $bla[]) {
    }
}
for ($t = 0; $t < sizeof($mulzahl); $t++) {
    $sObj2 .= "\n<option value=\"" . $mulzahl[$t] . "\"";
    if ($mulzahl[$t] == $key) {
        $sObj2 .= " SELECTED ";
    }
    $sObj2 .= ">" . $mulzahl[$t] . "</option>";
}
for ($t = 0; $t < sizeof($rotzahl); $t++) {
    $sObj3 .= "\n<option value=\"" . $rotzahl[$t] . "\"";
Example #2
0
    $alfa2 = array_flipp($alfa2);
}
#$kkey1=normalize($kkey1);
#$kkey1=strtoupper($kkey1);
if (strlen(trim($kkey1)) > 0) {
    $alfa2 = array_merge(array_unique(str_split($kkey1)), array_diff($alfa2, str_split($kkey1)));
}
if ($flip1b) {
    $alfa2 = array_flipp($alfa2);
}
################################################################################
if (!$mkey2) {
    $mkey2 = 1;
}
$alfa3 = rotieren($alfa, $rkey2);
$alfa3 = createMulAlfa($alfa3, $mkey2);
if ($flip2a) {
    $alfa3 = array_flipp($alfa3);
}
$kkey2 = strtoupper(normalisiere($kkey2, $alfa));
if (strlen(trim($kkey2)) > 0) {
    $alfa3 = array_merge(array_unique(str_splitt($kkey2)), array_diff($alfa3, str_split($kkey2)));
}
if ($flip2b) {
    $alfa3 = array_flipp($alfa3);
}
################################################################################
if (isset($_POST['decode'])) {
    $sel1 = "SELECTED";
    $orgtxt1 = substituiere($codtxt, $alfa2, $alfa);
    $orgtxt2 = substituiere($codtxt, $alfa3, $alfa);
Example #3
0
}
if ($num && !$alf) {
    $palfa = $polluxalfa[0];
    $n = 0;
}
if (!$num && $alf) {
    $palfa = $polluxalfa[1];
    $n = 1;
}
if ($num && $alf) {
    $palfa = $polluxalfa[2];
    $n = 2;
}
# einfache Mischung über den gemeinsamen Teilerfremden 7 zu 10, 26 und 36
if ($misch) {
    $palfa = createMulAlfa($palfa, 7);
}
$eingabe[0] = array_slice($palfa, 0, $pvert[$n][0]);
$eingabe[1] = array_slice($palfa, $pvert[$n][0], $pvert[$n][1]);
$eingabe[2] = array_slice($palfa, $pvert[$n][0] + $pvert[$n][1], $pvert[$n][2]);
$codtxt = str_replace(' ', '', $codtxt);
if (!$spacing) {
    $spacing = 5;
}
# Kodieren / Dekodieren
#if ($clean) {$coder->setCleanflag();}
$codtxt = str_replace(' ', '', $codtxt);
$orgtxt = str_replace(' ', '', $orgtxt);
if (isset($_POST['decode'])) {
    $codtxt = str_replace(' ', '', $codtxt);
    $orgtxt = str_replace(' ', '', $orgtxt);
Example #4
0
        if ($mulv == 1) {
            $mulv = 3;
        }
        $mkey = array_search($mulv, $mulzahl);
        $mulv = $mulzahl[($mkey - 1) % sizeof($mulzahl)];
        unset($mult);
    }
    if ($rott) {
        $rotv = findrot($codtxt);
    }
    if ($mult) {
        $mulv = findmul($codtxt);
        $alfa2 = createMulAlfa($alfa, $mulv);
        $rotv = 0;
    }
    $alfa2 = createMulAlfa($alfa, $mulv);
    $codtxt = substituiere($codtxt, $alfa2, $alfa);
    $codtxt = dekodieren($codtxt, buchstabeVonIndex($alfa, $rotv), $alfa);
    $codtxt = kodieren($codtxt, buchstabeVonIndex($alfa, $rotv), $alfa);
    $codtxt = substituiere($codtxt, $alfa, $alfa2);
}
$lang_multiplier = JTEXT::_('MULTIPLIER');
$lang_frequency = JTEXT::_('FREQUENCYANALYSIS');
$inhalt .= '
<form name=formular method=post>
<table border=0>
    <tr>
        <td colspan=2>
            <table>
            <tr>
            <td>