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