Cabinet Noir>Learn / Atbash cipher

Not sure which cipher? Identify it
The mirror cipher: the alphabet is flipped over, so A becomes Z and B becomes Y. No key at all.
Typesubstitution cipher
Breaking ittrivial to break
Erac. 586 BC
NameHebrew scribes; attested in the Book of Jeremiah.
Modesencrypt · decrypt

Learn

Atbash cipher

How the Atbash cipher works

The idea in one sentence

Atbash is the simplest Substitution that exists: flip the Alphabet over and swap every letter with its mirror — A becomes Z, B becomes Y, and the last letter becomes the first.

The recipe

  1. Write the alphabet out.

  2. Underneath it, write the same alphabet backwards.

  3. Encrypt each letter by the letter standing under it. There is nothing else: no key, no choices, one single fixed mapping.

  4. Decryption is the same operation — the mapping is its own inverse, because mirroring twice lands you back where you started.

A worked example

Step 1 of 9
Plaintext letter
Index (x ↔ 25 − x)
Result
R
17 ↔ 8
I

The index column is the whole story: a letter at position x always travels to position 25 − x. R (17) becomes H (7), because 17 + 7 = 25. Every row is a mirrored pair, and the middle of the alphabet (M ↔ N) maps onto itself's neighbourhood.

The formula

Atbash is the special case of the Affine cipher with a = b = 25: y = (25·x + 25) mod 26, which collapses to y = 25 − x. That is why encrypting and decrypting are the same act — the formula is its own inverse.

No key at all

Every cipher on this site asks "what is the key?" Atbash is the counter-example that defines the question: there is exactly one way to flip an alphabet, so the mapping is public knowledge. The tool's alphabet selector lets you play the same trick on German, French, Russian or Ukrainian alphabets — the mirror idea works on any ordered writing system, and picking the alphabet is the only "choice" left.

Try it in the tool

Step-by-step guides

Encrypt your first message

  1. Type your message into the message input.

  2. That is the whole setup — Atbash has no key. The the alphabet selector only chooses which alphabet gets mirrored (Latin by default; the mirror works on German, French, Russian and Ukrainian too).

  3. Read the mirrored text in the output field.

Decrypt a message you received

  1. Paste the cryptogram into the message input and press the swap button the swap button — although here even that is a formality: Atbash encrypting and decrypting are the very same operation.

  2. Make sure the same the alphabet selector is selected as the sender used.

  3. Read the original message in the output field.

Recognise an Atbash message

There is no key to find, so "breaking" Atbash is really recognising it:

  1. Read the gibberish backwards — mirror text read in reverse often shows letter shapes that feel suspiciously like words.

  2. Or test the fixed mapping directly: switch to decrypt mode, paste the text, and see if sense appears. One attempt settles it.

  3. Remember the giveaway: a message where E does not cluster near the common ciphertext letters but the letter distribution still looks like ordinary language — just permuted — points to a fixed mapping with no key.

Breaking the Atbash cipher

Atbash is the fastest cipher on this site to break — not because cryptanalysts are clever, but because the cipher never had a secret to protect. This page shows why, and what that teaches.

The flaw: no key, no security

A cipher is only as strong as its key space. Atbash's key space is exactly one: there is precisely one way to mirror an alphabet. The attacker does not search — they simply know the mapping, the way everyone knows the alphabet. Trying it once is a Brute force attack with a workload of one.

Attack — apply the mirror, once

  1. Switch the tool to decrypt mode and paste the Ciphertext. The mapping is public, so "decrypting" is a single click.

  2. If the text does not yield, the message was not Atbash — try the neighbouring ideas: a Caesar shift, a general Substitution.

  3. Note that Frequency analysis is unnecessary here, though it would work: Atbash is monoalphabetic. With no key to recover, even the classic statistics are more work than needed.

A cipher that hides itself

The one protection Atbash offers is obscurity: a reader who does not suspect a cipher at all sees only nonsense. That is the same protection as ROT13 on the internet — enough to hide a spoiler, never enough to hide a secret from anyone who looks twice.

The family resemblance

Atbash is the Affine cipher with a = b = 25 — the mirrored mapping is y = (25·x + 25) mod 26, which simplifies to y = 25 − x. Compare the family: Caesar shifts the alphabet, Affine reshapes it with a chosen multiplier, Atbash flips it completely. All three are monoalphabetic; all three fall to the same statistics; only the key space differs — 312 keys, then 1.

Why it still gets taught

Because it is the boundary case. Every question about cipher strength — how large is the key space? can the mapping be inverted? does the same plaintext letter always encrypt the same way? — has an instant, visible answer on Atbash. When a student can explain why Atbash is worthless, they can explain what any substitution cipher needs to be worth something.

Glossary

Plaintext — The original readable message before encryption.
Ciphertext — The scrambled message produced by encryption.
Alphabet — The set of letters the cipher works with.
Substitution — Replacing each letter with another one.