Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have no idea even after wikipedia's language frequency on how to solve this question. Been stuck at this for about 2 hours...really despise this question and could use some help..I just recently learned RSA and Modular cipher and a few others and now this question which doesnt even seem related to what I am doing confuses me.

enter image description here

share|cite|improve this question
Count the number of times each letter appears. The most common letter probably codes for e, the second for a or s, the third for n or i, etc. – Alex Becker Feb 26 '12 at 8:41
up vote 1 down vote accepted

In the sense that RSA and other more-complicated ciphers don't really apply here, you're correct. But this is the bread and butter of ciphers! Substitution ciphers are always good.

You start simply - tally up the letter frequencies in the passage. If you're lucky, they won't be randomly distributed (some ciphers do such things; of course, we've been told this is a substitution cipher, so it won't unless the message is really, really specially crafted and... weird). While you might hope that you can just plug in the most common letters (which you can remember because they're the letters in SENORITA, but in a different order) for the highest frequencies, in order, that might not always be the case.

But you should definitely try ESAN in for the top 4 frequencies. It's not cut and dry - you'll do a bit of guesswork here, a bit of guesswork there, backtrack a little. Get you hands dirty.

So, to be short: find the letter frequencies in the passage. See what happens if you assume the most common letter is E, the most common letter in a general passage, and so on. Maybe flip a few around. As a general rule, the longer the passage, the closer the actual letter frequencies will be to the expected frequency.

share|cite|improve this answer

I will try to answer as clearly as I can.

If you know in advance that this message is using a Caesar cipher (i.e.; every letter is replaced by another single letter) and that the message is written in English you can use the frequency table given in the problem to solve it.

The idea is to obtain the most frequent letter on the text and replace it by "E" (most frequent letter in English with 13.06% frequency). then obtain the second most frequent letter on the text and replace it by "A" or "S" (try and error). Eventually you will have some completed parts of the text and the remaining letters should be easier to replace.

share|cite|improve this answer
Not all substitution ciphers are Caesar ciphers. – Aryabhata Feb 26 '12 at 8:50
Yes I know, that's why I said that it works only if you know in advance that this is a Caesar cipher. To decipher with Vigenère substitution one should look for patterns in the text, same idea but little more complicated. – FKaria Feb 26 '12 at 10:52
Why mention Caesar cipher at all? What you said is equally applicable to any substitution cipher. In fact, by specifically mentioning Caesar, there might be the implication that frequency analysis might not work for other types of substitution ciphers. And Caesar cipher substitutes by shifting by a fixed amount, so perhaps we are talking about different things. – Aryabhata Feb 26 '12 at 10:56

Cryptography is all about this kind of is not a topic you just read a book about and expect to become good at!

RSA itself is a high-tech substitution cipher. The thing about basic substitution ciphers like this one is that they replace individual letters for symbols (here the symbols are also letters).

Now the way to break such ciphers is to use the fact that really the letters have only been relabelled so the distribution of the letters in the text hasn't actually changed.

If E was the most common letter in your message to begin with then whatever you swapped E for will be the most common letter in your ciphertext.

The table you are given is telling you roughly the frequencies of letters in everyday english, so you may use this with a bit of guesswork to find out what the message says. Count up how often the letters appear in your ciphertext and compare with the table.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.