Re: How do I apply the index of coincidence?
- From: caj@xxxxxxxxxxxxxxxxx (Xcott Craver)
- Date: Sun, 12 Mar 2006 22:33:59 GMT
T <t1x.arnold@xxxxxxxxx> wrote:
Hmmm. Ok. So what is the first step in determining the plaintext from
the ciphertext "OPKWWECIYOPKWIRG"? If I understand the process
correctly, the key length must be determined.
For text this small, the IC might not be useful to you.
With a computer, you can instead compute the likelihood ratio test.
So here's the algorithm:
1. guess the key length L
2. Partition the ciphertext into L pieces (like you already did.)
3. For each piece, decrypt using every possible shift.
Let trial[] be the message decrypted for a given shift. Now
Choose the shift that maximizes the expression
LLR = [sum over k] log P[trial[k]]
Where P[c] is the frequency of that character in normal English.
4. Add up the LLRs for each piece, to get the overall LLR for
that key length.
This algorithm not only tells you the most likely key length, but
gives you a good guess for the key as well. It still might not
work with a small ciphertext sample, but it will work much better
than the IC.
Generally, if you have a piece of shifted English and you need to
determine the shift, the LLR is probably the best 1-st order
formula to use.
--
"Old country music stars don't die -- they just get put in a coffin and buried
in the ground and then no one sees them ever again."
--Cat and Girl
.
- References:
- How do I apply the index of coincidence?
- From: T
- Re: How do I apply the index of coincidence?
- From: Xcott Craver
- Re: How do I apply the index of coincidence?
- From: T
- How do I apply the index of coincidence?
- Prev by Date: Re: Keys without signatures
- Next by Date: Re: First Attempt at a Proof of Provably Trapdoor-free Encryption
- Previous by thread: Re: How do I apply the index of coincidence?
- Next by thread: Re: How do I apply the index of coincidence?
- Index(es):
Loading