And so what you can do is you can then try your guess B for the next byte of the key,
pluck out ever end character from your decipher text, everything by B
to get a candidate value for every nth character of plain text.
And then look and tabulate the observed frequencies for
each of the lowercase letters, say.
And we'll call these values qa through qv, so they just correspond,
those are the observed frequencies for the letter A among all lowercase letters,
the letter B among all lowercase letters,
up to the letter z over all lowercase letters.
And again when you guess B is correct, then you should find that
the summation of q i p i where PI are the known letter frequencies of the lower
case English letters should be equal to the sum of the PI squared.
And this is because you expect in this case QI to in fact be equal to PI right?
QI here is observed frequencies in a candid of plain text not in
the cipher text itself.
And that value is a known value you can calculate it for yourself or
you can take my word for it and use the value display here.
So again, what you expect is that when you hit upon the correct guess B for
the next byte of the key and then decrypt the Ith ciphertext
stream using that byte B, you should get a plain text stream, a sequence of bytes,
where first of all every byte in the stream is between 32 and 127.
Furthermore, the calculated frequencies of lower case letters in that stream
should give you some values, q a through q z,
such that the sum of q i p i is about .065.
In practice, you're not going to get exactly .065 and what you can do is simply
take the value of b that maximizes the value of summation q a p i.
Subject to this caveat of everything lying between 32 and 127 and
possibly others as well, other restrictions I mean as well.
So for example, if you happen to fee a huge amount of commas, that would be
a sign that you probably that you're guess for B is probably not correct.
And then you would try another one.