<?php
/* Коды для замены букв */
'а' => '1',
'б' => '2',
'в' => '3',
'г' => '4',
'д' => '5',
'е' => '6',
'ё' => '7',
'ж' => '8',
'з' => '9',
'и' => '0',
'й' => '#',
'к' => '/',
'л' => '@',
'о' => 'х',
'н' => '&',
'п' => '^',
'р' => '%',
'я' => '$',
'с' => '*'
);
$text = 'нас предали. явка провалена.';
$cipher = strtr($text, $code);
echo "Оригинал: {$text}\nШифровка: {$cipher}\n";
echo "РасШифровка: {$code2}\n";
PD9waHAKCmVycm9yX3JlcG9ydGluZygtMSk7CgovKiDQmtC+0LTRiyDQtNC70Y8g0LfQsNC80LXQvdGLINCx0YPQutCyICovCiRjb2RlID0gYXJyYXkoCiAgICAn0LAnCT0+CScxJywKICAgICfQsScJPT4JJzInLAogICAgJ9CyJwk9PgknMycsCiAgICAn0LMnCT0+CSc0JywKICAgICfQtCcJPT4JJzUnLAogICAgJ9C1Jwk9PgknNicsCiAgICAn0ZEnCT0+CSc3JywKICAgICfQticJPT4JJzgnLAogICAgJ9C3Jwk9PgknOScsCiAgICAn0LgnCT0+CScwJywKICAgICfQuScJPT4JJyMnLAogICAgJ9C6JyA9PiAgJy8nLAogICAgJ9C7JyA9PiAgJ0AnLAogICAgJ9C+JyA9PiAgJ9GFJywKICAgICfQvScgPT4gICcmJywKICAgICfQvycgPT4gICdeJywKICAgICfRgCcgPT4gICclJywKICAgICfRjycgPT4gICckJywKICAgICfRgScgPT4gICcqJwopOwoKJHRleHQgPSAn0L3QsNGBINC/0YDQtdC00LDQu9C4LiDRj9Cy0LrQsCDQv9GA0L7QstCw0LvQtdC90LAuJzsKJGNpcGhlciA9IHN0cnRyKCR0ZXh0LCAkY29kZSk7CgplY2hvICLQntGA0LjQs9C40L3QsNC7OiB7JHRleHR9XG7QqNC40YTRgNC+0LLQutCwOiB7JGNpcGhlcn1cbiI7CgokY29kZTIgPSBhcnJheV9mbGlwKCRjb2RlKTsKZWNobyAi0KDQsNGB0KjQuNGE0YDQvtCy0LrQsDogeyRjb2RlMn1cbiI7