![]() |
[Java] Cryptanalysis - Coincidence Counting - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Java, JVM, & JRE (https://sinister.ly/Forum-Java-JVM-JRE) +--- Thread: [Java] Cryptanalysis - Coincidence Counting (/Thread-Java-Cryptanalysis-Coincidence-Counting) |
[Java] Cryptanalysis - Coincidence Counting - Deque - 02-26-2013 Coincidence Counting This is another method to determine the length of a key used in Vigenère cipher. Actually it is a modified Kasiski examination but easier to implement. Just take your message and make a second message that is the same but shifted one character. Lay the messages one upon the other and count each position where the characters are the same. Shift the message again and repeat this several times. The result will show peaks when the message is shifted by a multiple of the key length. That is why you need Friedman Test in addition. The result is not precise, but gives you a hint to the real key length. Both methods work well together. I used JFreeChart to show you a sample result. The peaks are marked blue. The given message was encoded with a key that is five characters long. (Screenshot) Spoiler: Code: import javax.swing.JFrame; Deque RE: [Java] Cryptanalysis - Coincidence Counting - Psycho_Coder - 04-10-2013 Now this is something that I need a lot. But I was hoping to see the Kasiski method's explanation however in short you explained index coinciding very well and thanks for the code. |