function decode($encryptedText, $upperLeft, $upperRight, $lowerLeft, $lowerRight)
{
    $decodedText = "";
    for ($i = 0; $i < strlen($encryptedText) - 1; $i += 2) {
        $pair = textPairing($encryptedText, $i);
        $decodedText .= match($pair, $upperLeft, $upperRight, $lowerLeft, $lowerRight);
    }
    return $decodedText;
}
Beispiel #2
0
function decode($encryptedText, $key)
{
    $decodedText = "";
    $alphabetTemplate = "abcdefghiklmnopqrstuvwxyz";
    $cipherTable = tableMaker($key);
    for ($i = 0; $i < strlen($encryptedText) - 1; $i += 2) {
        $pair = textPairing($encryptedText, $i);
        $match = decodeMatch($pair, $cipherTable);
        $decodedText .= $match;
    }
    return $decodedText;
}