cryptographyvigenere

Find length of key in vigenere cipher


I am new to cryptography kindly help to solve the following vigenere cipher problem with well defined steps

Assume you are given a 300 character encrypted message, encrypted in Vigenere cryptosystem, in which you know the plaintext word CRYPTOGRAPHY occurs exactly two times, and we know that the ciphertext sequence TICRMQUIRTJR is the encryption of CRYPTOGRAPHY. The first occurrence starts at character position 10 and second at character position 241 (we start counting from 1). What is the length of the key used for encryption


Solution

  • Answer is 7 Solution To estimate the period we use the Kasiski test. The distance between the two occurrences given is 241 − 10 = 231 = 3 · 7 · 11 positions. Possible periods are thus 3, 7 and 11. If the guess is correct, we can immediately find the corresponding shifts: at position 10 the shift is T − c = 19 − 2 = 17 = r . Similar computations for the other positions gives the shift keys rrectcorrect We now see that this is not periodic with periods 3 or 11, while period 7 is possible. The keyword of length 7 starts at position 15; hence the keyword is correct.