# Calculating Maximum Index of Coincidence

I'm trying to understand how the maximum Index of Coincidence (IC) is found. This is the only description I have for it:

"For a given period $$P$$ you can divide a cipher into $$P$$ groups, calculate the IC for each group, then take the average of these $$P$$ values. Doing this for all periods from 1 to 15 and selecting the maximum of these 15 values gives a MIC statistic"

Just to make sure I understand it correctly if I have a text with a length of 100 characters I should calculate the IC for: ... 100 characters ... two sets of 50 characters ... three sets of 33 characters (or 34?) ... four sets of 25 characters

and so on until I have my 15 groups of $$P$$

Then I take the maximum IC from each of the groups of $$P$$ and

sum = sum + count * (count - 1);


Then

sum / totcount * totcount - 1


Sorry if I don't understand I'm new to cryptoanalysis

• could you provide the definition where you found? Wikipedia is good for starters. – kelalaka Sep 18 at 18:10
• yes here it is; bionsgadgets.appspot.com/gadget_forms/acarefstats.html – mr c r Sep 18 at 18:22
• Hint: Kasiski Test – kelalaka Sep 18 at 18:35
• @kelalaka: The Kasiski test is rather poorly suited for computer-assisted cryptanalysis, not to mention unreliable: it works great if you can find a couple of nice repeats, but badly or not at all if you don't. – Ilmari Karonen Sep 18 at 21:12
• @IlmariKaronen it is not exactly same, but similar idea. – kelalaka Sep 18 at 21:13