Ciphers
Atbash
Mirror the alphabet. A becomes Z, B becomes Y. Hebrew in origin, one key, self-inverse.
- create
- create("atbash")
- family
- Reflection
- options
- none
- self-inverse
- yes
- keyspace
- 0 (single deterministic mapping)
- try it
- ciphers atbash "ATTACK AT DAWN"
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.