
Ciphers, cryptography and communications I
20/06/2025
Kabbalah, Temurah
Now you may want to ask - why is Jewish mysticism even mentioned here?
Let’s start step by step.
Kabbalah forms the foundation of mystical religious interpretations within Judaism.
That’s it — nothing about ciphers and cryptography.
Temurah is a part of Kabbalah focused on finding new meanings in sentences and words by changing letters or words in one way or another.
Okay, now it may have something to do with ciphers. At least it mentions letter transpositions. In general, we’re mostly interested in three parts of Temurah. These are Atbash, Avgad, and Albam. All three of them may be treated as ciphers, despite the fact that Kabbalah treats them as a way to find new meanings.
Notation
Notation I'm going to use:
- - Plain text message
- - Ciphertext
- - Encryption of plain text
- - Decryption of ciphertext
Also, I expect that:
Hebrew
There are a couple of things I need to clarify since we are going to touch ancient mystical practices... Just kidding, I will throw at you a little bit of context on how Hebrew works.
Hebrew is written from right to left. RTL
Hebrew uses an abjad writing system. This means that during regular writing, vowels in words are not marked. So it’s up to you to infer vowels and read words correctly. Good luck. When you need to explicitly mark vowels, you can use nikud. If you come from a language with rich diacritics, you can think of them like circumflexes, umlauts, cedillas, and háčeks. If you come from something based on pure Latin or Cyrillic scripts — good luck.
The Hebrew alphabet has 22 graphemes to represent consonant sounds. While some of these graphemes represent more than one consonant sound, we don’t need that for the next parts.
Letters have no case. To be honest, that’s kinda useful for ciphers.
Atbash (אתבש a-t-b-sh)
Let’s start with the name, because it will shine a light on how this cipher works. The name of this cipher consists of 4 letters, and the closest representation in the Latin alphabet is A-Z-B-Y. So you may already have some idea how this cipher works.
It is a substitution cipher - that means you have a table of substitutions, and this table determines how each letter in the plain text should be replaced to get the ciphertext. Also, this cipher is monoalphabetic - it means we use the same substitution table for encrypting each letter.
Here are examples of substitution tables for Hebrew, Latin, and Cyrillic scripts:
As you may infer from this table, when you encode or decode a message, you replace a letter with the letter that has the same distance from the end of the alphabet as the original letter has from the beginning.
These tables are not the only way to explain how the cipher works. Since all these ciphers are affine, you can describe each of them as a small math function:
Where is the index of a letter in the alphabet, and is the number of letters in the alphabet. This function assumes you index letters starting from zero.
operation itself is pretty simple. Imagine a clock face with an hour hand. When you add or subtract any number of hours, the result wraps around 0 to 12. That means all operations happen under .
This information is enough for now. You can find more on wiki or here.
Fun part about Atbash that its encode and decode functions are the same.
Avgad (אבגד a-v-g-d) or Caesar
First - don’t ask me why the same ב (bet) is pronounced vet here. For the Latin script, the closest analog is A-B-C-D. It’s also a substitution cipher.
This cipher has a variable offset . But you should know that vanilla version of Avgad expects that So you see that to encode letter you should add to number of letter in alphabet and to decode you need to substract it. This family of ciphers is often called rotational ciphers.
When this rotational cipher called Caesar's cipher.
Affine form:
You may also imagine this cipher as a vignette of two disks with all letters of the alphabet. Rotating the disks relative to each other by offset gives you the substitution. So, for the Latin alphabet, you get up to 26 different ciphers in one family. To communicate successfully, you just need to share one number. Of course, this also makes it easy for someone to capture the so-called key - or even brute-force it.
Albam (אלבמ a-l-b-m)
For Latin script, the closest analog is A-N-B-O. It's literally ROT13 for Hebrew. So you can think about it as about Avgad where .
Affine form:
Spoon of history and reasoning
Despite being part of a mystical system, all these ciphers have been used as real ciphers in the wild. And since they predate the first known cryptanalysis work made by Al-Khalil (~1200 years earlier), they might have actually been pretty safe. By modern standards, they are weak, of course. They don’t introduce entropy in the ciphertext, so you can perform frequency analysis with pen and paper.
They basically have no key, so all secrecy relies on the assumption that the person who intercepted the message doesn’t know which cipher is used. Even Avgad, which can have a key, is easy to brute-force - you can try all values in your notebook in a reasonable amount of time.
Disclaimer: I'm not a historian or an occultist, so take the following with a grain of salt. Feel free to check things yourself or contact me if you think corrections are needed.
The history of these ciphers is also kind of interesting. The Kabbalists believed that words carry power — not just meaning. So, writing a word releases that power into the world. Jewish history has many dark pages where these people were harassed or oppressed, so I can understand why a Kabbalist might not want to write a word like “Babylon” or, in more modern times, “Auschwitz.”
Also, due to the nature of Hebrew, this technique can be used on single letters as well.
Playground
Here is a small chat. Send a couple of messages, and you will see ciphertexts. You can also pick the desired cipher. When you hover over a message in the chat, you'll see the original.
PS
Thanks to Grigory Shepelev and Federico Biccheddu for reporting problem with dark theme.