A classical, mono-alphabetic cipher. Each letter maps to one fixed letter, so plaintext letter frequencies are preserved in the ciphertext.
Originally devised for the Hebrew alphabet, then applied to Latin and other alphabets.
You can find an implementation of the Atbash cipher in sahithyandev/ciphers.
Encryption
Each letter in the alphabet is replaced with the letter at its mirrored position, counting from the opposite end.
Here:
- : plaintext letter, encoded as an integer 0 (a) to 25 (z)
- : ciphertext letter, same encoding
Atbash has no key. a always maps to z, b to y, and so on.
Decryption
The mirror map is its own inverse, so decryption applies the same operation.
Attacking
There is no key to search. Recovering the plaintext is a single substitution away once Atbash is suspected.
Worked Example
Plaintext nothingistrue, with to .
Each letter maps to its mirror .
Ciphertext is mlgsrmtrhgifv.
Decryption applies the same map again.
Plaintext is nothingistrue.
No key exists, so testing the single Atbash substitution against the ciphertext confirms it in one step.