Atbash

Atbash is a symmetric substitution cypher that relies on the symmetry of the Hebrew alphabet. It substitutes each letter with it's symmetrically opposed letter from the middle of the alphabet. It can also be applied to a Latin alphabet by taking the letter $m$ as the pivot.

Given a plain-text letter $l_{p}$ and its index $l_{p_{i}}$ in the alphabet $\mathbb{A}$, in order to obtain the cypher letter $l_{c}$ we subtract its position in the alphabet $\mathbb{A}$ from the size of the alphabet $|\mathbb{A}|$.

\begin{eqnarray*}
l_{c} &=& \{ l_{i}|i=|\mathbb{A}|-l_{p_{i}} \mod{|\mathbb{A}|} \}
\end{eqnarray*}

In order to obtain the plaintext, we perform the same operation.

Implementations