The Vigenère cipher
The Vigenère cipher is a symmetric cryptosystem, which means it uses the same key for encryption and decryption. The Vigenère cipher closely resembles the Caesar cipher, with the exception that it uses a longer key to offset the major problem of the Caesar cipher: the fact that a letter can be encoded in only one way. To solve this problem, a keyword is used instead of a single character.
Each letter is firstly associated with a corresponding cipher.
A text is encoded with a word by adding the letters of another word, called the keyword, to each of its letters. The keyword is indefinitely added accross from the text to be encrypted, then the ASCII code of each of the keyword's letters is added to the text to be encrypted. For example, the text "rendezvousamidi" with the keyword "bonjour" will be encoded as follows:
|114 + 98||101 + 111||110 + 110||100 + 106||101 + 111||122 + 117||118 + 114||111 + 98||117 + 111||115 + 110||97 + 106||109 + 111||105 + 117||100 + 114||105 + 98|
To decrypt this message, the secret key is needed and reverse decryption is performed, using subtraction.
Although this cipher is much more solid than the Caesar cipher, it can still be easily broken. When messages are much longer than the keyword, it is possible to identify the length of the keyword and use, for each keyword sequence, the method that involves calculating how often the letters appear, which makes it possible to determine the keyword's characters one at a time...
To avoid this problem, one solution is to use a keyword that is almost the same length as that of the text so as to prevent a statistical study of the encrypted text. This type of encryption system is called a one-time pad system. The problem with this type of method is the length of the encryption key (the longer the text to be encrypted, the larger the key needs to be), which prevents its memorization and implies a much larger probability of an error existing in the key (just one error makes the text unbreakable...).