Compute the index of coincidence-related data for XOR ciphers, using
the pseudocode:
for i is 1 to length(cyphertext) do
cyphertext2 = shift(cyphertext,i)
for j is 1 to length(cyphertext) do
if (cyphertext[i] = cyphertext2[j]) then do
counter = counter +1
index = (counter / length(cyphertext))
if index > .4 then do return i
(Note: you might have to change .4 to something else depending on your
character set.)
as described on http://md2600.net/newsletter/issue2/122.html