Things Have History
The Kama Sutra cipher, or why secret writing was the forty-fourth art

cryptography

The Kama Sutra cipher, or why secret writing was the forty-fourth art

Listen · 4:13

Near the middle of a list of sixty-four accomplishments that every educated person of fourth-century India was expected to command — a curriculum running from singing and dancing through cooking, chess, carpentry, and the care of parrots — Vatsyayana placed one entry that tends to surprise anyone who assumes this was a text purely about pleasure: mlecchita-vikalpa, the art of understanding writing in cipher and writing words in a peculiar way. Item forty-four.

Vatsyayana compiled his Kama Sutra sometime around 400 CE, drawing on manuscripts that reached back several centuries. He was a Brahmin scholar, not a military strategist, and his text was a handbook for cultivated life — which, in his reckoning, required a command of precisely sixty-four arts. The kala covered practical skills, artistic refinements, and intellectual games in roughly equal measure. The inclusion of secret writing among them, unremarkably, between the domestic and the witty, is itself a statement about who in ancient India was expected to hold keys.

The cipher Vatsyayana recommends is a substitution method built on random letter-pairings. Simon Singh, drawing on David Kahn’s The Codebreakers, describes the technique plainly: take the Sanskrit alphabet, randomly match each letter to a partner, and substitute when writing. A becomes T, T becomes A — the pairings are arbitrary, chosen fresh each time, memorised or destroyed before the message travels. The plaintext scrambles; only the person who holds the same matching can recover it.

The stated purpose, given in the text itself, is disarmingly candid: to help women conceal the details of their liaisons. State secrets this is not. But the underlying cryptographic principle is identical to any military cipher — a shared key, a transformed message, security through the secrecy of the mapping rather than the method. What Vatsyayana recommended for protecting correspondence about private affairs is what modern cryptographers call a monoalphabetic substitution cipher. The application changed; the mathematics did not.

The Kama Sutra itself names the art without detailing the mechanics. The full technical picture comes from Yasodhara’s later commentary, the Jayamangala, written somewhere between the tenth and thirteenth centuries CE. Yasodhara describes at least three variations: the Kautiliya, which substitutes vowels for consonants by a fixed scheme; the Muladeviya, which uses reciprocal character mappings and was apparently common among spies, traders, and — the text mentions this without embarrassment — thieves; and the Gudhayojya, an elementary padding method that commentators note was popular with children. Cryptography, in fourth-century India, was a ladder with several rungs.

The significance David Kahn identified in The Codebreakers (1967) is contextual rather than technical. Caesar’s cipher was a tool of the imperial administration. The scytale was a battlefield instrument. Mlecchita-vikalpa is the first surviving record of cryptography imagined as a personal skill — something any educated person might carry, use in private life, and teach without state sanction. Once secrecy becomes a private technology rather than a government monopoly, the question of who can send a message no one else can read becomes a question about individuals, not armies.

The argument between the person who wants to write without being read and the person who wants to read without permission has been running since before Vatsyayana reached for his stylus. He listed one side of it between chess and cooking.

Sources

Spot a mistake?

Wrong date, broken citation, a fact that doesn't hold? Tell us. It lands in an inbox a human reads and the post can be pulled or corrected.