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; }
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; }