Understanding the Vigenère Cipher
The Vigenère cipher is a method of encrypting alphabetic text by using a series of different Caesar ciphers based on the letters of a keyword. It is a simple form of polyalphabetic substitution. The method was originally described by Giovan Battista Bellaso in his 1553 book La cifra del. Sig. Giovan Battista Bellaso; however, the scheme was later misattributed to Blaise de Vigenère in the 19th century, and is now widely known as the "Vigenère cipher" (wikipedia).
This cipher is is easy to understand and implement, it often appears to beginners to be unbreakable. For example suppose we wish to encrypt the word "PUPPY" with the keyword "CAT". In the chart on the left encrypt the first letter "P" with the letter "C" by finding the intersection between the P-row and C-column. The result is the letter "R". Now use the keyword letter "A" to encrypt "U" and the keyword letter "T" to encrypt "P". When the letters in the keyword are exhausted, continue the encryption by using the letter at the beginning of the keyword. Hence "PUPPY" becomes "RUIRY".
In the example below, the 94 printable characters of the ASCII code are used, i.e.:
!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
To execute the code, enter the plain text, a keyword, and click the ENCRYPT button. To reverse the process, copy the result in the encrypted text box, paste it into the plain text box, enter the password, and click the DECRYPT button.