The Kam-sala Cipher

This was once a fairly common way of concealing the meaning of text in Persian. I first came across discussion of it in Safavid-era sources, but it is also mentioned, in a slightly different form, in the Subh al-a‘sha of al-Qalqashandi (d. 1418 CE). So it’s clear that the history of this cipher goes back at least six centuries, and that it also saw some use in Arabic.

A concise description of the kam-sala system is given in the Hindustani dictionary of John Shakespear (d. 1858). The rules are also explained below. But enough of this rambling! I put together a simple utility that will apply the cipher to any Persian or Arabic text that you enter. It runs in client-side JavaScript. The source files are available on GitHub. Hopefully this will be an amusement to someone!


Plaintext

Ciphertext


Rules

The cipher is applied according to the following mnemonic (a line of poetry in the khafif meter):

کم صلا او حط له در سع
حرف منقوط را به جایش دع

The first hemistich lists the letters that should be swapped: kaf for mim (and vice versa); sad for lam alif (this is a unique case where one letter is exchanged for two, and vice versa); alif for waw (and vice versa); etc.

The second hemistich specifies that letters with dots should be left as-is.

For example, the word سلامت would become عصکت in ciphertext.

To decrypt a message, simply run it through the cipher again. It should go without saying that a system this simple will offer little security, except perhaps through obscurity.


Further reading


Made with coffee and pedantry by Theo Beers
Last updated 27 Feb. 2020