Ciphers
Atbash
Mirror the alphabet. A becomes Z, B becomes Y. Hebrew in origin, one key, self-inverse.
Cipher / Reflection
Atbash
Mirror the alphabet, A becomes Z.
- Keyspace
- 0
- Decode
- self-inverse
- Works on
- A-Z, the rest passes
- Family
- 1 in reflection
no options
Access
- Create
create("atbash") - CLI
ciphers encode atbash 'ATTACK AT DAWN' - Tryplayground with the sample above
Each letter maps to its mirror: A to Z, B to Y, M to N. Twice is the identity, so encode and decode are one operation. Case survives, everything else passes through.
const atbash = create("atbash");
atbash.encode("HELLO").text; // "SVOOL"
atbash.encode("Hello, World!").text; // "Svool, Dliow!"
atbash.decode("ZGGZXP ZG WZDM").text; // "ATTACK AT DAWN"
Atbash is the Affine cipher with a = 25 and b = 25. Check it if you don't believe me, the playground is right there.