Vigenere Cipher Decription

What is a Viginere Cipher?

Vigenere Cipher is a method of encrypting alphabetic text. It uses a simple form of polyalphabetic substitution. A polyalphabetic cipher is any cipher based on substitution, using multiple substitution alphabets. The encryption of the original text is done using the Vigenère square or Vigenère table.

In more simple terms, a viginere cipher is a numeric shift based on the specified "key". With the letter "A" representing 0 and the letter "Z" representing 25. The key is duplicated so it's length matches the length of the plain text. Then each letter of the plain text is shifted by the corresponding numeric value of the indexed key letter.

For example, if the Plain Text is "Attack at Dawn" and the key was "safe", the extended key would be "safesafesafe". This would give an ouput cipher text of "styeuk fx vabr"

How to Decipher?

In order to figure out the key of a vigenere cipher, we need to take advantage of something known as "letter frequency analysis". Without going into too much detail, this utilizes the fact that in any given stretch of written language, certain letters and combinations of letters occur with varying frequencies. By comparing known letter frequencies to those in the cipher text, we can work backwards in order to figure out the key.

Decription

What I have created is a python program that takes in the input Cipher Text via standard input and will then print the key of that text.

Go ahead and try for yourself! You can download the code from my github by clicking the icon below. Since the algorithm utilizes letter frequency analysis, the input cipher text needs to be quite long. I would recomend anything between 1000 and 10000 letters.