<?php
/* Коды для замены букв */
'а' => '1',
'б' => '2',
'в' => '3',
'г' => '4',
'д' => '5',
'е' => '6',
'ё' => '7',
'ж' => '8',
'з' => '9',
'и' => '0',
'й' => '#',
'н' => '!',
'п' => '№',
'с' => '%',
'р' => '?',
'л' => '*',
'я' => '(',
'к' => ')',
'о' => '+',
);
$text = 'нас предали. явка провалена.';
$cipher = strtr($text, $code);
echo "Оригинал: {$text}\nШифровка: {$cipher}\n";
$decode = strtr($cipher, $code); echo "Расшифровка : {$decode}";
PD9waHAKCmVycm9yX3JlcG9ydGluZygtMSk7CgovKiDQmtC+0LTRiyDQtNC70Y8g0LfQsNC80LXQvdGLINCx0YPQutCyICovCiRjb2RlID0gYXJyYXkoCiAgICAn0LAnCT0+CScxJywKICAgICfQsScJPT4JJzInLAogICAgJ9CyJwk9PgknMycsCiAgICAn0LMnCT0+CSc0JywKICAgICfQtCcJPT4JJzUnLAogICAgJ9C1Jwk9PgknNicsCiAgICAn0ZEnCT0+CSc3JywKICAgICfQticJPT4JJzgnLAogICAgJ9C3Jwk9PgknOScsCiAgICAn0LgnCT0+CScwJywKICAgICfQuScJPT4JJyMnLAogICAgJ9C9Jwk9PgknIScsCiAgICAn0L8nCT0+CSfihJYnLAogICAgJ9GBJwk9PgknJScsCiAgICAn0YAnCT0+CSc/JywKICAgICfQuycJPT4JJyonLAogICAgJ9GPJwk9PgknKCcsCiAgICAn0LonCT0+CScpJywKICAgICfQvicJPT4JJysnLAopOwoKJHRleHQgPSAn0L3QsNGBINC/0YDQtdC00LDQu9C4LiDRj9Cy0LrQsCDQv9GA0L7QstCw0LvQtdC90LAuJzsKJGNpcGhlciA9IHN0cnRyKCR0ZXh0LCAkY29kZSk7CgplY2hvICLQntGA0LjQs9C40L3QsNC7OiB7JHRleHR9XG7QqNC40YTRgNC+0LLQutCwOiB7JGNpcGhlcn1cbiI7CgokY29kZSA9IGFycmF5X2ZsaXAgKCRjb2RlKTsKJGRlY29kZSA9IHN0cnRyKCRjaXBoZXIsICRjb2RlKTsKZWNobyAi0KDQsNGB0YjQuNGE0YDQvtCy0LrQsCA6IHskZGVjb2RlfSI7