This was one of the most exciting projects I have ever worked on. Was at the subject
"Códigos y Criptografía" (Codes and Cryptography), and the challenge that our teacher proposed us was the development of an application able to break the
Vigènere cipher.
For those who do not know how does
Vigènere cipher works, I will try to shortly explain:
Simple ciphers like the
Caesar cipher shifts the letters a determined number of positions
(n), that means that replaces every single letter with the one that have
n positions more in the alphabet.
For example, if we use the
Caesar cipher to encrypt the word
"ITBLOG" with a shift of 1, we get
"JUCMPH".
As you have probably find out, there is a very small number of possibilies for this kind of cipher, in fact, the number of possibilities is exactly the number of different symbols that have the alphabet used.
Otherwise, more complex algorithms use a
password in order to encrypt the message. In
Vigènere the letters of the message are added to the letters of the
password (repeated cyclically), getting the letters of the encrypted message.
For example, encrypting the message
"ITBLOG" with the
password "ABCD", we have to do this operation:
ITBLOG
+
ABCDAB
-----------
IUDÑOH
Notice that I am using the Spanish alphabet (for your knowledge, the letter 'ñ' is between 'n' and 'o').
So now, trying to break the cipher is a little bit more complicated, every letter is encrypted with it corresponding in the password, then the same letter could be encrypted in several different ways depending on which is the current used letter of the password. For example, T + B = U = S + C.
And that is enough for today, in the next entries I will explain how does the cracker algorithm works.