# How to recover the original text/find decryption function?

This is from Discrete Mathematics and its Applications

Here's my book section on shift ciphers.

I understand the idea behind this. If you were trying to encrypt say a single letter 'b' with a shift cipher of key 8, you would do it by first representing 'b' as an integer, 1 because it is 1 away from 'a', and then applying the encryption formula(shift cipher)
f(p) = (p + 8) mod 26 $\quad$= (1 + 8) mod 26 = 9.
Once you have the number 9, you revert that back to letter form, which in this case is 9 away from 'a' or 'j'.
In this problem you aren't given the key cipher though. How would you go about finding the shift cipher key?

## 1 Answer

There are lots of clues from English. One is the letter frequencies. In normal English text, the most common letters are ETAIONS, so count the frequencies of the encrypted letters and try to fit it to this. For a short piece of text like this, the deviations can be large. Another is short words. A single letter word is likely A or I. In three letter words, THE is very common. In your text JVVU is very interesting. Most words of this pattern have EE in the middle. Also note that V ends three other words. It is a very good bet that V encrypts E, so the shift is 17. Seeing KYRK and KYV makes me think THAT and THE and a shift of 17 makes H to to Y.

Of course, with a shift cypher there are only 26 keys, so you could brute force it.