Patterns, continued

Having struck out using patterns for solving transposition ciphers, I had better luck using them for cipher type identification. I tested several Patristocrat ciphers (simple substitution without spaces) in my Analyzer program and in most cases Patristocrat came up in second or third position, rather than first. The types that usually came up in first were Quagmire, Gromark or Bazeries.

I added the Pat8 test to my Patristocrat test algorithm and saw an immediate improvement, two of the tests moved Patristocrat from second to first and two of the third place ratings changed to second. Still, I wanted the Analyzer to reliably identify Patristocrats as first. I looked at my algorithms and realized I hadn’t used the differing index of coincidence stats of Quagmire, Gromark, and Patristocrats to their full extent. I tweaked those IC statistics in my tests associated with those three types and the Analyzer worked much better, putting Patristocrat in first every time without harming the ability of the program to identify the other two types, at least not for the ten or so ciphers I tested. It is probable that I could have achieved the same improvement without the Pat8 test, but it did help move Patristocrat up in the analytical rankings.

The Bazeries was a little tougher. The Bazeries is essentially a Patristocrat with some segments reversed. For any given plaintext the index of coincidence will always be the same for a Patristocrat and a Bazeries encipherment. Thus that statistic is useless in distinguishing those two types. However, the reversal does interrupt patterns to some extent and I found that the Bazeries statistics showed a higher average Pat8 score. The difference was small, largely because most of the low-scoring patterns are still low-scoring when reversed. Thus, the Pat8 test didn’t help much. Fortunately, the Bazeries has other characteristics that usually make it identifiable. Most notably, the missing J in the ciphertext identifies it as a Polybius square cipher, and the frequencies of certain letters that substitute for the I, O, T, and E will be elevated. See my article in the MA2004 The Cryptogram.

The initial failure of my program to identify Patristocrats is probably due mostly to the fact that I never bothered to focus on that type since in the ACA  Patristocrat unknowns are virtually unknown (ha ha). They do, however, appear in disguised form in the cover ornamentals sometimes. Once you have converted the graphics to letters you are likely to have a Patristocrat. Thus it is helpful that my exercise improved my program. So far my Pat8 test has proved of some use, although small. I feel like the general approach of using patterns has more potential that I haven’t uncovered. I encourage anyone interested to follow with more experimentation. There are certainly many variables that can be adjusted, such as the length of the N-gram and the number of patterns used in the test. I originally tried using the 500 most common patterns but the variation in scores was so great for plaintext that I found it wasn’t usable. If you would like my list of patterns, contact me using the link in the top menu.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.