Example #1
0
function trennen($text, $num)
{
    # Codetext in monoalfabetischen Buchstabenmengen aufteilen
    $txt = str_splitt($text);
    for ($t = 0; $t < sizeof($txt); $t++) {
        $strngs[$t % $num] = $strngs[$t % $num] . $txt[$t];
    }
    return $strngs;
}
Example #2
0
}
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);
    $orgtxt = "";
    for ($t = 0; $t < strlen($codtxt); $t++) {
        if ($t % 2 == 0) {
            $orgtxt .= substr($orgtxt1, $t, 1);
        } else {
            $orgtxt .= substr($orgtxt2, $t, 1);