Reply To: !
A Tale of 2 Secrets › Forums › T.E.M.P.E.S.T. › ! › Reply To: !
The index of coincidence (IoC) is the probability that a random pair of letters from a ciphertext are the same. Or at least, that’s one use for that statistic: there’s no reason you can’t use it on blocks of 2, 3, 4, 5, … letters. Then it becomes even more useful!
Perhaps you know already that most English plaintexts of reasonable length will have an IoC around 0.067.
The IoC is unchanged by substitution (with a single alphabet) or transposition. This means you can fiddle around with a ciphertext until you see the magic value of around 0.067 (3B was ~0.0648), then you know that that section is a simple substitution (and/or transposition). For example:
A Baconian (5-bit binary) substitution will exhibit an English-like IoC when you take blocks of 5 letters.
A Vigenère cipher (each column of the plaintext encrypted with a separate Caesar shift) exhibits an English-like IoC when you take the letters in each column; when you get the right number of columns the average of the IoC values of each column will be around 0.067 too. You can use this fact to work out the number of columns used from a Vigenère ciphertext.
It’s also useful for the later ciphers, which might include multiple stages of obfuscation: sometimes you know when you’ve got past the first stage because the IoC of the resulting letters (or pairs, triples, etc.) is around 0.067. For instance, 9B from 2019 gives you an IoC of ~0.0662 once you figure out the initial obfuscation.
So IoC is an excellent statistic to get to grips with. Other than that, I’d recommend doing some programming in a spreadsheet or Python, and looking at the library resources on the 2×2 hill cipher, which comes up quite frequently (2021, 2022, 2023 and others). Hill ciphers are probably the most complicated maths that will be used as a cipher in the challenge.
Sorry if this is too much information at once: Madness’ book & the other resources provides a more gradual introduction.