A classical, mono-alphabetic, keyless cipher. 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.
Key Space
Atbash has no secret key. Its key space contains 1 fixed alphabet reversal, so exhaustive search is unnecessary.
Encryption
Each letter in the alphabet is replaced with the letter at its mirrored position, counting from the opposite end.
- plaintext letter, encoded as an integer 0 (a) to 25 (z)
- ciphertext letter, same encoding
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 .
Solution Reveal Hide
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.