<?php
/* Коды для замены букв */
'а' => '1', 'б' => '2', 'в' => '3',
'г' => '4', 'д' => '5', 'е' => '6',
'ё' => '7', 'ж' => '8', 'з' => '9',
'и' => '0', 'й' => '#', 'к' => 'a',
'л' => 'b', 'м' => 'c', 'н' => 'd',
'о' => 'e', 'п' => 'f', 'р' => 'g',
'с' => 'h', 'т' => 'i', 'у' => 'j',
'ф' => 'k', 'х' => 'l', 'ц' => 'm',
'ч' => 'n', 'ш' => 'o', 'щ' => 'p',
'ъ' => 'q', 'ы' => 'r', 'ь' => 's',
'э' => 't', 'ю' => 'u', 'я' => 'v'
);
$text = 'нас предали. явка провалена.';
$cipher = strtr($text, $code);
echo "Оригинал: {$text}\nШифровка: {$cipher}\n";
$text = strtr($cipher, $code); echo "Оригинал: {$text}\n\n";
PD9waHAKCmVycm9yX3JlcG9ydGluZygtMSk7CgovKiDQmtC+0LTRiyDQtNC70Y8g0LfQsNC80LXQvdGLINCx0YPQutCyICovCiRjb2RlID0gYXJyYXkoCiAgICAn0LAnCT0+CScxJywgICAgJ9CxJwk9PgknMicsICAgICfQsicJPT4JJzMnLAogICAgJ9CzJwk9PgknNCcsICAgICfQtCcJPT4JJzUnLCAgICAn0LUnCT0+CSc2JywKICAgICfRkScJPT4JJzcnLCAgICAn0LYnCT0+CSc4JywgICAgJ9C3Jwk9PgknOScsCiAgICAn0LgnCT0+CScwJywgICAgJ9C5Jwk9PgknIycsICAgICfQuicgPT4gICdhJywKICAgICfQuycgPT4gICdiJywgICAgJ9C8JyA9PiAgJ2MnLCAgICAn0L0nID0+ICAnZCcsCiAgICAn0L4nID0+ICAnZScsICAgICfQvycgPT4gICdmJywgICAgJ9GAJyA9PiAgJ2cnLAogICAgJ9GBJyA9PiAgJ2gnLCAgICAn0YInID0+ICAnaScsICAgICfRgycgPT4gICdqJywKICAgICfRhCcgPT4gICdrJywgICAgJ9GFJyA9PiAgJ2wnLCAgICAn0YYnID0+ICAnbScsCiAgICAn0YcnID0+ICAnbicsICAgICf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