Tuesday, October 15, 2013

Code 23 : Vatsyayana Cipher or Kama Sutra Cipher

The Vatsyayana cipher or Kama Sutra cipher is a classical substitution cipher described in the 45th chapter of the Indian erotic manual Kama Sutra authored by Mallanaga Vatsyayana who is believed to have lived in the fourth century AD. The cipher involves randomly pairing letters, so that each plaintext letter gets substituted for its paired letter in the ciphertext, and vice versa.

No evidence, within the SCA archives or elswhere supports the use of this cipher, by either party, 
during the years of the Civil War (1860-1865). It is included here, only as an exercise 
and example of the evolution of the cipher and text encryption by substitution.
One of the earliest descriptions of text encryption by substitution appears in the "Kama-sutra", a text written in the 4th century AD by the Brahmin scholar Vatsyayana, but based on manuscripts dating back to the 4th century BC. The Kama-sutra recommends that women should study 64 arts, including cooking, dressing, massage and the preparation of perfumes. The list also includes some less obvious arts, including conjuring, chess, bookbinding and carpentry. Number 45 on the list is mlecchita-vikalpa, the art of secret writing, advocated in order to help women conceal the details of their liaisons. One of the recommended techniques involves randomly pairing letters of the alphabet, and then substituting each letter in the original message with its partner.
Type your message into the box labelled 'Plain Text', then click on the 'Encipher Plain Text' button to encrypt your message.
Use FAST ENCRIPTION to cipher entire message
Use SLOW ENCRIPTION for letter by letter ciphering.
 Frequency Analysis and the Kama Sutra
 Substitution Cipher
In the 4th century BC, the Indian text "Kama Sutra" proposed a method of encrypting text.
Each letter of the alphabet was paired with one other letter.
A ciphertext was formed by replacing each letter in the plaintext with its paired letter.
When this scheme is used in the English language, the number of possible keys is surprisingly
 high: around 7.9 * 10^12. An exhaustive attack on such a scheme would be unwieldly using
 a modern computer, and it was certainly infeasible at the time this scheme was suggested.
 The art of cryptanalysis (systematic techniques used to break ciphers) traces back to
Arab Islamic society, from 750-900 AD. al Kindi proposed the technique of
frequency analysis to break substitution ciphers like that proposed in the Kama Sutra text.
Frequency analysis recognizes that in long blocks of text, certain letters tend to occur much
more frequently than others. When a big enough sample text is used in a particular language,
 certain patterns occur predictably, for example in English text, the most common letters are
 E, T and N while Q and Z are used infrequently. Different languages have different typical
 frequency patterns. In this worksheet, letters of the English alphabet will be paired at
random according to the Kama Sutra scheme. A block of text will be encrypted by
swapping letters according to this pairing. The user can refer to the frequency patterns
 for the English language and the letter frequencies in the ciphertext to try to determine
 the letter pairings and hence receover the original plaintext. The Maplet uses the user's
pairing of letters to guess at the plaintext, and tracks how many guesses have been made.


Post a Comment

Note: Only a member of this blog may post a comment.