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