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