# Finding Vigenère cipher key(s) [closed]

How can we find the key used with a Vigenère cipher in small number of steps?

If we have text like:

Peit Wokm! Mhfa fepatgb ets bvvrvxmea ebte bae twkd qiqi


and we have key information like Key = ‘ ? a ? i ’, then how I can understand this and solve this to make the complete key?

You've been given the key length, plus half the characters in the key text. By the look of things, the ciphertext even contains word spaces and punctuation, which will help a lot.

Start by decrypting the text using the characters you already know:

> Peit Wokm! Mhfa fepatgb ets bvvrvxmea ebte bae twkd qiqi
.a.i .a.i  .a.i .a.i.a. i.a .i.a.i.a. i.a. i.a .i.a .i.a
< .e.l .o.e! .h.s .e.s.g. w.s .n.r.p.e. w.t. t.e .o.d .a.i


Assuming the plaintext is English, it seems likely that the first character of the key is t, since this would decrypt the 5th and 8th words to was and the. Let's see how that changes things:

> Peit Wokm! Mhfa fepatgb ets bvvrvxmea ebte bae twkd qiqi
ta.i ta.i  ta.i ta.ita. ita .ita.ita. ita. ita .ita .ita
< We.l Do.e! Th.s me.sag. was .ncr.pte. wit. the .ord .axi


Actually, you can stop here. It's already obvious what the message says.

• Thank you for your answer but still do we need to make idea like first letter is t or there is any logic or procedure behind it ?
– ARG
Apr 16, 2015 at 20:56
• @ARG If you don't have any information about the key or its length, then the standard attack on Vigenère ciphers is as follows: (1) use Kasiski's method to determine the key length, then (2) split the ciphertext into sets of characters that are all shifted by the same key character (in this example, the first set would be P, W, M, f, t, t, v, m, b, a, k, q), and finally (3) use frequency analysis to figure out the Caesar shift of each set (thus discovering each letter of the key). Apr 16, 2015 at 22:16
• How P, W, M, f, t, t, v, m, b, a, k, q ? isn't it like 'P,W,M,F,E,B,E,B,T,Q' or its not the first letters of the words ? you are doing some other thing to make key character
– ARG
Apr 16, 2015 at 22:30
• @ARG No, no. Ignore all the spaces and punctuation when encrypting and decrypting. The second set is e, o, h, e, g, s, r, e, t, e, d, q — these are the letters that have an a underneath them in the example above. Apr 16, 2015 at 22:42