# Atbash

Atbash (Hebrew: אתבש‎; also transliterated Atbaš) is a monoalphabetic substitution cipher originally used to encrypt the Hebrew alphabet. It can be modified for use with any known writing system with a standard collating order.

## Encryption

The Atbash cipher is a particular type of monoalphabetic cipher formed by taking the alphabet (or abjad, syllabary, etc.) and mapping it to its reverse, so that the first letter becomes the last letter, the second letter becomes the second to last letter, and so on. For example, the Latin alphabet would work like this:

 Plain Cipher A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Z Y X W V U T S R Q P O N M L K J I H G F E D C B A

Due to the fact that there is only one way to perform this, the Atbash cipher provides no communications security, as it lacks any sort of key. If multiple collating orders are available, which one was used in encryption can be used as a key, but this does not provide significantly more security, considering only a few letters can give away which one was used.

## History

The name derives from the first, last, second, and second to last Hebrew letters (AlephTawBetShin).

The Atbash cipher for the modern Hebrew alphabet would be:

   Plain   Cipher Aleph Bet Gimel Daleth Heh Vav Zayin Het Tet Yodh Kaph Lamed Mem Nun Samech Ayin Peh Tzady Koof Reish Shin Taw א ב ג ד ה ו ז ח ט י כ ל מ נ ס ע פ צ ק ר ש ת Taw Shin Reish Koof Tzady Peh Ayin Samech Nun Mem Lamed Kaph Yodh Tet Het Zayin Vav Heh Daleth Gimel Bet Aleph ת ש ר ק צ פ ע ס נ מ ל כ י ט ח ז ו ה ד ג ב א

### In the Bible

Several biblical verses are described by commentators[n 1] as being examples of Atbash:[1]

• Jeremiah 25:26 – "The king of Sheshach shall drink after them" – Sheshach meaning Babylon in Atbash (בבל bblששך ššk)
• Jeremiah 51:1 – "Behold, I will raise up against Babylon, and against the inhabitants of Lev-kamai, a destroying wind." – Lev-kamai meaning Chaldeans (כשדים kšdymלבקמי lbqmy)
• Jeremiah 51:41 – "How has Sheshach been captured! and the praise of the whole earth taken! How has Babylon become a curse among the nations!" - Sheshach meaning Babylon (בבל bblששך ššk)

## Relationship to the affine cipher

The Atbash cipher can be seen as a special case of the affine cipher.

Under the standard affine convention, an alphabet of m letters is mapped to the numbers 0, 1, ... , m − 1. (The Hebrew alphabet has m = 22, and the standard Latin alphabet has m = 26). The Atbash cipher may then be enciphered and deciphered using the encryption function for an affine cipher, by setting a = b = (m − 1):

${\displaystyle {\mbox{E}}(x)={\mbox{D}}({E}(x))=((m-1)x+(m-1)){\bmod {m}}}$

This may be simplified to:

{\displaystyle {\begin{aligned}{\mbox{E}}(x)&=(m-1)(x+1){\bmod {m}}\\&=-(x+1){\bmod {m}}\\\end{aligned}}}

If, instead, the m letters of the alphabet are mapped to 1, 2, ... , m, then the encryption and decryption function for the Atbash cipher becomes:

${\displaystyle {\mbox{E}}(x)=(-x{\bmod {m}})+1}$