# Tag Info

## Hot answers tagged index-of-coincidence

10

Kasiki's test and the index of coincidence are used to attack a Vigenère cipher (or other polyalphabetic ciphers with small alphabet and small key size) - they both try to get the length of the keyword. Kasiki's test gets probable prime factors of the keyword length, while the coincidence index test gets us an estimation of the absolute length of the ...

3

I suspect, when the IC was invented, it was typically used together with human judgement, so there might not be any standard rules to address this issue. Anyway, it seems like there are two plausible solutions: It might be easy to add a special case for this situation: choose the keylength with the highest IC, except that if it has a divisor whose IC is ...

2

The Hamming distance is more effective when you suspect that the plaintext has been XORed with some repeating keystream. That's because XOR works at a bit level, as does the Hamming distance. The Index of Coincidence is more effective when you suspect that the plaintext has been combined with some repeating keystream, where the combiner works character-by-...

2

Expected Index of Coincidence usually refers to a language's expected index of coincidence (1.73 for English, or 0.067 if you're not normalising). The formula in question is usually used to determine the length of the key ($t$) given the (measured) $IC$ of received cipher-text. $IC$ is the probability that two randomly-selected letters from the cipher text ...

2

Here $f_i$ is simply the number of times the character $i$ appears in the ciphertext of length $N$ and where $Z$ is the alphabet size. If you had ciphertext ADCXU ZMDYZ DXZUM and which was derived from English plaintext then $N=15$ and $f_A=1,f_B=0,f_C=1, f_D=3,\ldots, f_Z=2.$

1

Just for simplicity lets assume that your short period "password" was just XORed with plaintext. So we have encryption procedure like: for(int i = 0; i < plaintext_len; i++){ ciphertext[i] = plaintext[i] ^ password[i % password_len]; } When you shift your ciphertext by password_len and XOR it with original ciphertext, you'll cancel out your ...

1

As explained on the link you posted, the Vigenere cipher with a key on length $n$ encrypts every $n$-th symbol with the same key under the Caesar cipher. So to calculate the IC you should take all the $n$ sub-sequences separately: $\{1, 1+n, \dots, 1+kn, \dots\}$, $\{2, 2+n, \dots, 2+kn, \dots\}$ and so on and compute the IC for every sub-sequence.

Only top voted, non community-wiki answers of a minimum length are eligible