How can I calculate Index of Coincidence of Vigenère cipher?

1.5k Views Asked by At

I have computed the letter frequency of the cipher text. However, I don't know how to apply Friedman Test to Vigenère cipher. I couldn't calculate the Index of Coincidence. Does anyone can help to me ?

Letters' frequencies :

$f_{0} = 0.059 \qquad f_{14} = 0.031 \\ f_{1} =0.055 \qquad f_{15} = 0.064 \\ f_{2} = 0.030 \qquad f_{16} = 0.029 \\ f_{3} = 0.018 \qquad f_{17} = 0.026 \\ f_{4} = 0.029 \qquad f_{18} = 0.027 \\ f_{5} = 0.040 \qquad f_{19} = 0.042 \\ f_{6} = 0.070 \qquad f_{20} = 0.046 \\ f_{7} = 0.030 \qquad f_{21} = 0.046 \\ f_{8} = 0.032 \qquad f_{22} = 0.017 \\ f_{9} = 0.023 \qquad f_{23} = 0.027 \\ f_{10} = 0.046 \qquad f_{24} = 0.036 \\ f_{11} = 0.059 \qquad f_{25} = 0.032 \\ f_{12} = 0.046 \\ f_{13} = 0.039 $

By using these frequencies, how can I calculate Index of Coincidence ?

1

There are 1 best solutions below

1
On BEST ANSWER

In addition to these relative frequencies, you need the actual numerical frequencies of the individual letters. If $n_k$ is the actual number of instances of letter $k$, and $n$ is the total number of letters, for each letter you need the quantity

$$\frac{n_k}n\cdot\frac{n_k-1}{n-1}=f_k\cdot\frac{n_k-1}{n-1}\;.$$

The index of coincidence is then

$$\begin{align*} \mathbf{IC}&=26\left(f_k\cdot\frac{n_1-1}{n-1}+f_2\cdot\frac{n_k-1}{n-1}+\ldots+f_k\cdot\frac{n_{26}-1}{n-1}\right)\\ &=\frac{26}{n(n-1)}\Big(n_1(n_1-1)+n_2(n_2-1)+\ldots+n_{26}(n_{26}-1)\Big)\;. \end{align*}$$

The Wikipedia description of it is short but fairly readable.

Note that the factor of $26$ (which is actually the number of different letters, so it could be different for different languages) is often omitted, as it is at this more detailed explanation.