예제 #1
0
function findpw_ak($text, $pwl)
{
    # Passwort ermitteln für Autokey
    global $alfa;
    global $AP;
    $texte = trennen($text, $pwl);
    for ($t = 0; $t < sizeof($texte); $t++) {
        unset($arr);
        for ($u = 0; $u < sizeof($alfa); $u++) {
            $arr[] = koinzidenzIndex(dekAutokey($texte[$t], $alfa[$u], $alfa));
        }
        #echo '<br>';
        $y[$t][0] = array_search(min($arr), $arr);
        #echo $alfa[$y[$t][0]].$y[$t][0]." ";
        $arr2 = array_merge(array_slice($arr, 0, $y[$t][0] - 1), array_slice($arr, $y[$t][0] + 1, sizeof($arr)));
        $y[$t][1] = array_search(min($arr2), $arr2);
        if ($y[$t][1] >= $y[$t][0]) {
            $y[$t][1]++;
            $y[$t][1]++;
        }
        #echo $alfa[$y[$t][1]].$y[$t][1];
        $rot1 = abs(13 - findrot(dekAutokey($texte[$t], $alfa[$y[$t][0]], $alfa)));
        $rot2 = abs(13 - findrot(dekAutokey($texte[$t], $alfa[$y[$t][1]], $alfa)));
        #echo ' '.$rot1.' '.$rot2;
        if ($rot1 == 13) {
            $letter = $alfa[$y[$t][0]];
        }
        if ($rot2 == 13) {
            $letter = $alfa[$y[$t][1]];
        }
        $pass = $pass . $letter;
    }
    return $pass;
}
예제 #2
0
    }
    if ($mul == "+") {
        $mkey = array_search($mulv, $mulzahl);
        $mulv = $mulzahl[($mkey + 1) % sizeof($mulzahl)];
        unset($mult);
    }
    if ($mul == "-") {
        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 .= '