Jump to content

Playfair decrypter?


Followers 0

Recommended Posts

Yeah, definitely a Rat kind of question. I don't know of any general tools that will do it. Sounds like something that you'll need to code, and then run for some time. A hill climbing approach or a dictionary attack is probably the way to go, unless there are weaknesses in Playfair that I'm not aware of (not surprising, since I'm NOT experienced with cryptanalysis, or even Playfair).

Link to comment

I've got one I wrote that works pretty well; other people in the Bay Area have better ones. Playfair is one of the harder ciphers to write a solver for, because you need to account for keyspace symmetries. Mine typically solves them in tens of minutes. I think Team Ottlet has one that will solve them somewhat faster.

 

But it is customary (at least in my area) to only use autosolvers you have written yourself. Using someone else's tool for cryptanalysis is fine, but it just seems a little cheesy to use somebody else's autosolver.

 

My opinion only, of course!

Link to comment

A few weeks agon I needed this very tool. I didn't find a pre-made program but I did find the source wirtten in C (or C+/#, not sure). I don't have the knowledge but if someone here knows how to compile it, they could make into a program.

 

Can you send me the link to it? I wrote a decryption program in Java and also found some code online that's supposed to decrypt Playfairs. Unfortunately, neither are giving me results.

 

If I ever get my program to work, I'll be happy to share.

Edited by The_Incredibles_
Link to comment

I've got one I wrote that works pretty well; other people in the Bay Area have better ones. Playfair is one of the harder ciphers to write a solver for, because you need to account for keyspace symmetries. Mine typically solves them in tens of minutes. I think Team Ottlet has one that will solve them somewhat faster.

 

But it is customary (at least in my area) to only use autosolvers you have written yourself. Using someone else's tool for cryptanalysis is fine, but it just seems a little cheesy to use somebody else's autosolver.

 

You're killing me here! If you can't share you code, maybe you can give me some tips on how to make mine work? I"m not sure what you mean by keyspace symmetries?

 

Basically what mine does is

 

#1 generate a random 5x5 table

#2 decrypt the message

#3 do a frequency analysis of the message (I"ve got it so it can analyze both single letter frequencies and letter-pair frequencies)

#4 compare the frequencies generated to the general english language

#5 make a small change to the table (I have 15 permutations so far)

#6 decrypt the message again and analyze the frequencies again

#7 compare and see if the frequency analysis has improved or not

#8 if improved, keep the new table

#9 keep making small changes to the table

 

So far, it does work, in so far as the frequency analysis of the decrypted messages do get closer and closer to those for the english language.

 

However, it always hits a wall and never gets to the solution.

 

:rolleyes:

Edited by The_Incredibles_
Link to comment
You're killing me here! If you can't share you code, maybe you can give me some tips on how to make mine work? I"m not sure what you mean by keyspace symmetries?

 

Basically what mine does is

 

#1 generate a random 5x5 table

#2 decrypt the message

#3 do a frequency analysis of the message (I"ve got it so it can analyze both single letter frequencies and letter-pair frequencies)

#4 compare the frequencies generated to the general english language

#5 make a small change to the table (I have 15 permutations so far)

#6 decrypt the message again and analyze the frequencies again

#7 compare and see if the frequency analysis has improved or not

#8 if improved, keep the new table

#9 keep making small changes to the table

 

So far, it does work, in so far as the frequency analysis of the decrypted messages do get closer and closer to those for the english language.

 

Heh. I am happy to discuss the algorithm! (BTW, is this a cache you are working on? Which one?)

 

Your algorithm is basically doing the right thing, I think, but using digram (two letters) will probably never converge.

 

Generally speaking, an autosolver uses some "objective function" that scores better the closer the decrypted text is to English, and some way of modifying the key. Both can be very tricky; if the objective function is too peaked at the right solution, you will never know that you are close, but if it is not peaked enough you will wander all over and never reach the solution. The modifications to the key are important; you need to be able to reach all of the keyspace that is in some sense "near" a given key in a small number of steps to be able to find a maximum. For Playfair, mirror images, column and row rotations, and so on are all "close" to each other. There is no rule, for example, that the Playfair keyword goes left-to-right in the top part of the key. Some people make go vertically, some spiral it, etc. That is what I meant by "keyspace symmetries." Simply swapping the positions of two letters will never get you there!

 

For my algorithm I use tetragrams (sequences of 4 letters) to score the candidate decrypts and I use an algorithm called "simulated annealing" to move in the direction of the best solution. There are other algorithms that also work but are less efficient, including hill-climbing with restart and something called the "churn" method.

 

I've found that tetragrams are more or less the sweet spot for English autosolvers. Use sequences of fewer than 4 letters and the solution peak is not unique enough; lots of decrypts have more or less the same score. Use sequences of more than 4 letters and the solution peak is too sharp; nothing scores well until you stumble upon almost the right solution.

 

I am happy to share with you my geocaching-weighted tetragram frequencies. The text corpus I used to create them includes a lot of spelled-out numbers and spelled-out coordinates, which makes those solutions score higher.

 

If you are getting the impression that making autosolvers is complicated, you would be correct!

Link to comment

Thanks very much, this is giving me the direction I need. I will try the 4 letter sequences. I'm going to work on generating my own geocaching-weighted 4-letter frequencies. I would be interested in seeing yours as well. :) I tried something similar for 2-letter combinations. The decrypted text did seem to improve, but not enough. I was using a hill climbing method, but I will look up your algorithm as well. One thing I worry about is the message is not long enough; it's 82 characters.

 

Yes, this is for a cache. I think it's OK to mention in this case: the cache. I'm hoping to get my solver working because there's at least a couple more Playfair caches in our area.

 

Hopefully I will have some success soon with my program and thanks everybody for all your suggestions.

Link to comment

Hopefully I will have some success soon with my program and thanks everybody for all your suggestions.

 

Very curious about that too. I have used Cryptool for years and has not let me down so far, but an automatic decryption of playfair would be nice. Though I have more then half of the key already and a nearly complete coordinate (only the last three digits of west are missing). Took me less then 5 minutes, after I found out that the hint gives most of it away :) Am not going to crack it fully now, since I am at work now and won't log the cache probably ;) Just love old cryptographic challenges :)

Link to comment

I did ask The Rat as suggested. Unfortunately the tool he has couldn't crack it. He concurs with others that for a message this short, hill climbing is not sufficient. So I am working on the simulated annealing angle, with the 4 letter sequences. It's taking a while especially trying to understand what simulated annealing is, but I think I've finally got the idea. You need a pHd in rocket science for some of this stuff, I swear.

 

Still going at, hopefully will get some results soon. :blink:

Link to comment

I did ask The Rat as suggested. Unfortunately the tool he has couldn't crack it. He concurs with others that for a message this short, hill climbing is not sufficient. So I am working on the simulated annealing angle, with the 4 letter sequences. It's taking a while especially trying to understand what simulated annealing is, but I think I've finally got the idea. You need a pHd in rocket science for some of this stuff, I swear.

 

Still going at, hopefully will get some results soon. :blink:

Hmm, rocket science? Naw, just a PhD in mathematics.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Followers 0
×
×
  • Create New...