Classical substitution ciphers appeared long before computers—they were used by Julius Caesar, Freemasons, and diplomats. Today, they are not used to protect data, but they remain an excellent introduction to cryptography and appear in CTF challenges, riddles, and puzzles.
History of substitution ciphers
Substitution ciphers are one of the oldest methods of protecting information. The principle is simple: each letter in the original text is replaced with another according to a specific rule. Knowing the rule (the key) makes it possible to decrypt the message.
Their main weakness is letter frequency analysis. In any language, some letters occur more often than others (in Russian, «о», «е», and «а»). By comparing the frequencies in the encrypted text with the typical frequencies of the language, the cipher can be broken without the key.
Caesar cipher
Named after Julius Caesar, who used a shift of 3 positions. The principle: each letter is shifted by a fixed number of positions in the alphabet.
Ключ (сдвиг): 3
Открытый: А Б В Г Д Е Ж З И К
Шифртекст: Г Д Е Ж З И К Л М НExample: «ПРИВЕТ» with a shift of 3 → «ТУЛЗИШ»
The alphabet wraps around: the letter «Я» shifted by 1 becomes «А».
There are 32 possible keys for the Russian alphabet (and 25 for the Latin alphabet)—it is easy enough to try them all by hand if desired.
ROT13
ROT13 is a special case of the Caesar cipher with a shift of 13 for the Latin alphabet. It has a special property: encryption and decryption use the same operation.
A → N, B → O, C → P ... N → A, O → BROT13 is used not for protection, but to hide spoilers on forums and in discussions—just «hide» the text so you do not read it by accident.
Vigenère cipher
A more complex version of the Caesar cipher that uses a multi-letter key. Each letter in the text is encrypted with a different shift, determined by the corresponding letter of the key.
Открытый: П Р И В Е Т
Ключ: К Л Ю Ч К Л
Сдвиги: 11 12 30 25 11 12
Шифртекст: Э Д Э Э П ЕThe key repeats cyclically across the entire text. This makes frequency analysis significantly more difficult, although with a text of sufficient length, the cipher can still be broken using the Kasiski method.
Atbash cipher
An ancient Hebrew cipher in which the alphabet is «mirrored»: the first letter is replaced with the last, the second with the second-to-last.
Латиница: A↔Z, B↔Y, C↔X, D↔W ...
Русский: А↔Я, Б↔Ю, В↔Э, Г↔Ь ...Like ROT13, Atbash is its own inverse: applying the cipher twice returns the original text. It appears in The Da Vinci Code and other works of fiction.
Base64: encoding, not encryption
Base64 is often confused with encryption, but it is an encoding—a reversible representation of binary data as printable ASCII characters. There is no key; anyone can decode it.
«Привет» → 0J/RgNC40LLQtdGC (Base64)Base64 is used to transmit data in JSON, email attachments, and image data URIs. To work with Base64, use the Base64 encoder.
Why classical ciphers do not protect data
All the ciphers described above are not suitable for protecting real information:
- Small key space (brute-forcing takes seconds)
- Vulnerability to frequency analysis
- No cryptographic strength by modern standards
AES, RSA, and ChaCha20 are used to protect data in practice. SHA-256 and bcrypt hash functions are used to check the integrity of files and passwords. See the hash generator.
Where classical ciphers are used today
- CTF competitions (Capture The Flag)—challenges involving breaking Caesar and Vigenère ciphers
- Riddles and quests—encrypted messages in games and detective stories
- Cryptography education—understanding classical attacks helps explain modern principles
- Spoilers—ROT13 on forums such as Reddit and Hacker News
Tool on reChecker
The text cipher tool on reChecker supports Caesar ciphers (any shift), ROT13, Vigenère, Atbash, and Base64. Enter text, select an algorithm and key, and get the encrypted or decrypted result instantly.