In: Computer Science
Consider the plain text 'Mom please don't tell dad I crashed the car I'll get it fixed before he even knows'. Using the Vigenere cipher I get the following cipher text: ''PFUKPJAKXGFVJXYEDEGRLDGWAKAHUBCIHAJBZZTGKJTAMIZFZHGEXHUVPZIAEFDQFEN'. What key did I use?
Plaintext:
Mom please don't tell dad I crashed the car I'll get it fixed before he even knows
Cipher text:
PFUKPJAKXGFVJXYEDEGRLDGWAKAHUBCIHAJBZZTGKJTAMIZFZHGEXHUVPZIAEFDQFE
Now search in the Vignere table as below:
First char of text is M, first char of ciphertext is P. Look for row M, see in which column value is P. That column is D.
Key: D
2nd char of text is o. 2nd char of cipher text is F. Look for row o, search in which column value is F. That column is R.
Key: DR
3rd char is m, 3rd char of cipher text is U. Look for row m, search in which column value is U. That column is I.
Key: DRI
Similarly, take one char from text, corresponding char from ciphertext and search in vignere table, in which row (plaintext char) the value is char from ciphertext as shown above. That column is the next key character.
Row - p, value - K, Column = V
Key: DRIV
Row - L, value - P, column = E
Key: DRIVE
Row - e, value - J, column = F
Key: DRIVEF
Row - a, value - a, column = a
Key: DRIVEFA
Row - s, value - K, column = S
Key: DRIVEFAS
Row - e, value - X, column = T
Key: DRIVEFAST
Row -d, value - G, column = D
Key: DRIVEFASTD
Row- o, column - F, value = R
Key: DRIVEFASTDR
Row -n, column - V, value = I
Key: DRIVEFASTDRI
We can see that key "DRIVEFAST" is now getting repeated. Hence, the key used for encryption is DRIVEFAST.