• Coding
  • [Exercise] Solving Cryptograms

So a post has inspired me to think if it is possible to solve cryptograms with a code; if so, how long does it take the processor to come up with the solution and what programming language is the best to choose for this purpose? Is the human brain the only powerful processor capable of cracking such codes?

A cryptogram is a series of coded words that make up a message. There is no key to decipher the message, so one has to use common sense and knowledge of the English language to decipher it.

For example, if the encrypted message is:
Dell Crossword Puzzles and More! wrotePBG XIYRR FYK UQQN XIGGWGI QW PBG QPBGI RAMG QO PBG OGWHG - SJP AR'R IGYUUK EJRP YSQJP YR BYIM PQ HJP.
Usually one would start with some of the simplest concepts to crack the code. The coded word "AR'R" has an apostrophe, a sign used to simplify (is) to ('s). So R -> s.

Next there's the repeated word "PBG": it is known that some words are very frequent to use in the English language such as "a", "an", and "the". In this case, it is "the". So, P -> t, B ->h, and G ->e. Also, the "Q" comes in doubles, and at the beginning of the 2-letter words "QW", "QO", and "PQ". And since P -> t, then the word "PQ" can only be "to" => Q -> o.

With more analysis and head scratching, the message is found to be:

"the grass bay look greener on the other side of the fence - but it's really just about as hard to cut."

So the task is to come up with a code that can solve the aforementioned cryptogram. Have fun ;)
I'm not sure you realize how difficult this exercise really is ...
rahmu wroteI'm not sure you realize how difficult this exercise really is ...
I do, but I want to see how far our members can go with it. The solution doesn't have to be fully automated (at first), it can be a guided process that can simplify solving the cryptogram for the user. I know it's going to be very challenging, but hey what's life if we don't live on the edge and venture a bit?
Coming up with the rules that nake common sense actually common are enough to take years of study
This falls under the category of challenge rather than exercise. It's like a trip to Paraguay, without money, on a limb rather than a trip to the local storage store :)
But why be pessimistic, it's actually "easy" as far as cryptography is concerned.
I'll sure be giving it a try, and you guys shouldn't be too hesitant to do.

In all cases, such crypts are considered extremely insecure. Let's figure out why.
arithma wroteIn all cases, such crypts are considered extremely insecure. Let's figure out why.
Because you can decrypt them without the need of a tool, and the bigger the paragraph is, the more your chances become to decrypt it. The smaller the sentence is, the smaller your chance to decrypt it.

This is of course, assuming that the person is using proper English, if the person uses chat like English, as in you = u, wait = w8, leet = l33t. Your chances of figuring it our even becomes dimmer to maybe impossible?
Badieh wrote[...] the bigger the paragraph is, the more your chances become to decrypt it. [...]
I don't know anything about cryptography so I must ask: isn't this true of any crypt? the bigger it is, the larger the sample to find a pattern?
The reason why this method is widely considered insecure is because of the symmetry between letters ("P" will always be "t", "B" will always be "h"). This makes it easier to match patterns against a dictionary. (You can almost deduce the symmetry from the lack of encryption key).

On the other hand, I know that arithma is not asking for opinions on why this algorithm is insecure, he's asking to prove it. With code.

I have a small idea, maybe I'll work on it tonight.
There is an encryption key. It is the table mapping characters to other characters. (A permutation).
I am suggesting that finding both the encryption key (the permutation) and the plain text is easy. It is well documented in the literature that it is. How "easy" is easy, I don't really know. Let's figure out.
I really like this exercise ( I don't know much about programming so It's a no for me) it does seem quite hard, though using a dictionary and comparing patterns like the guys said above seems to be the way to go
One thing that could help you out is the fact that in any given paragraphs some letters are more likely to be used than others. For example, in English, the most used character is 't' (if I'm not mistaken). Accordingly, you have a good chance figuring out what the character with the most repetitions in the crypt is likely going to be (which is 't').

You can find a table with those statistics online. From there, you can apply this to the crypt. Then match the resultants against a dictionary and see if it makes sense.

Anyway, this is definitely an interesting exercise. Might give it a shot if I had enough time.