Example of Decryption of a Substitution Cipher.
by fortenforge, Jul 20, 2009, 11:56 PM
lnbd qnbh egpvskbm qnb vbdqbm so qnb cdgkbmpb, f asq so jbsjab lgaa ib egpfjjsgdqbe qs egpvskbm qnbh fmb dsq gq.
- ibmdfme ifgabh
Let us say that this is our ciphertext that we need to decrypt. We can tell that this is a quote by the "-" at the end. Ciphertext letters will be in lowercase and plaintext letters will be in uppercase.
'b' appears 17 times in the ciphertext. This is way more than any other letter so 'b' is likely to be 'E'. Let's replace all 'b's with 'E's.
lnEd qnEh egpvskEm qnE vEdqEm so qnE cdgkEmpE, f asq so jEsjaE lgaa iE egpfjjsgdqEe qs egpvskEm qnEh fmE dsq gq. - iEmdfme ifgaEh
The digraph 'qn' appears 4 times at the beginning of words, in all times it is followed by 'E'. The most common word in the English language is 'THE'. There are other words that begin with 'THE' such as 'THERE', 'THEY', and 'THEM'. This means that 'qn' is likely to be the digraph 'TH'. So 'q' = 'T' and 'n' = 'H'. Let's replace these letters:
lHEd THEh egpvskEm THE vEdTEm so THE cdgkEmpE, f asT so jEsjaE lgaa iE egpfjjsgdTEe Ts egpvskEm THEh fmE dsT gT. - iEmdfme ifgaEh
The 16th word is 'Ts'. The only 2 letter word that begins with 'T' is 'TO'. This means 's' = 'O'. Let's replace this:
lHEd THEh egpvOkEm THE vEdTEm Oo THE cdgkEmpE, f aOT Oo jEOjaE lgaa iE egpfjjOgdTEe TO egpvOkEm THEh fmE dOT gT. - iEmdfme ifgaEh
Now things become a little more complicated. The 9th word is a single letter word: 'f'. This means it can be only 'A' or 'I'. The 21st word is 'gT'. The only possible words are 'AT' or 'IT'. This means either 'f' or 'g' is 'A' or 'I'. To figure out which is which we can look at the 19th word 'fmE'. There is no 3 letter word that begins with 'I' and ends in 'E'. There is however a very common 3 letter word that begins in 'A' and ends in 'E'. The word 'ARE'. This is the more likely word. This gives us that 'f' = 'A', 'g' = 'I', and 'm' = 'R'. Now we should replace these in:
lHEd THEh eIpvOkER THE vEdTER Oo THE cdIkERpE, A aOT Oo jEOjaE lIaa iE eIpAjjOIdTEe TO eIpvOkER THEh ARE dOT IT. - iERdARe iAIaEh
The 9th and 10th words are "A aOT". 3 letter words that end in 'OT' are 'NOT', 'LOT', and 'ROT'. 'A LOT', is a much more common phrase than 'A NOT' or 'A ROT'. This tells us that 'a' = 'L'. Now we replace this:
lHEd THEh eIpvOkER THE vEdTER Oo THE cdIkERpE, A LOT Oo jEOjLE lILL iE eIpAjjOIdTEe TO eIpvOkER THEh ARE dOT IT. - iERdARe iAILEh
Now we can notice 2 things. Look at the twelfth word 'jEOjLE'. The only thing that it can be is the word 'PEOPLE'. This means 'j' = 'P'. Also we can notice that the 4th to last word, 'dOT' must be the word 'NOT' because of the words before and after it. This means 'd' = 'N'. Now we replace this:
lHEN THEh eIpvOkER THE vENTER Oo THE cNIkERpE, A LOT Oo PEOPLE lILL iE eIpAPPOINTEe TO eIpvOkER THEh ARE NOT IT. - iERNARe iAILEh
The only 12 letter word that has 'APPOINTE' in it is 'DISAPPOINTED'. So, 'e' = 'D', 'p' = 'S', and 'e' = 'D'.
The first word, 'lHEN' must be the word 'WHEN' because there is no other word that fits. So, 'l' = 'W'. The 5th word, 'vENTER' must be 'CENTER' for the same reason. So, 'v' = 'C'.
Replace these:
WHEN THEh DISCOkER THE CENTER Oo THE cNIkERSE, A LOT Oo PEOPLE WILL iE DISAPPOINTED TO DISCOkER THEh ARE NOT IT. - iERNARD iAILEh
Now it is trivial to find the actual plaintext:
WHEN THEY DISCOVER THE CENTER OF THE UNIVERSE, A LOT OF PEOPLE WILL BE DISAPPOINTED TO DISCOVER THEY ARE NOT IT. - BERNARD BAILEY.
Notice that we did not just use letter frequency analysis, we also used digraph analysis, and word analysis. We also built upon our previous discoveries. Just from guessing that 'b' was 'E', we were able to decrypt the whole ciphertext. This algorithm for decryption is very hard to computer program so most ciphers like these are better to be decrypted by hand using this same method.
- ibmdfme ifgabh
Let us say that this is our ciphertext that we need to decrypt. We can tell that this is a quote by the "-" at the end. Ciphertext letters will be in lowercase and plaintext letters will be in uppercase.
'b' appears 17 times in the ciphertext. This is way more than any other letter so 'b' is likely to be 'E'. Let's replace all 'b's with 'E's.
lnEd qnEh egpvskEm qnE vEdqEm so qnE cdgkEmpE, f asq so jEsjaE lgaa iE egpfjjsgdqEe qs egpvskEm qnEh fmE dsq gq. - iEmdfme ifgaEh
The digraph 'qn' appears 4 times at the beginning of words, in all times it is followed by 'E'. The most common word in the English language is 'THE'. There are other words that begin with 'THE' such as 'THERE', 'THEY', and 'THEM'. This means that 'qn' is likely to be the digraph 'TH'. So 'q' = 'T' and 'n' = 'H'. Let's replace these letters:
lHEd THEh egpvskEm THE vEdTEm so THE cdgkEmpE, f asT so jEsjaE lgaa iE egpfjjsgdTEe Ts egpvskEm THEh fmE dsT gT. - iEmdfme ifgaEh
The 16th word is 'Ts'. The only 2 letter word that begins with 'T' is 'TO'. This means 's' = 'O'. Let's replace this:
lHEd THEh egpvOkEm THE vEdTEm Oo THE cdgkEmpE, f aOT Oo jEOjaE lgaa iE egpfjjOgdTEe TO egpvOkEm THEh fmE dOT gT. - iEmdfme ifgaEh
Now things become a little more complicated. The 9th word is a single letter word: 'f'. This means it can be only 'A' or 'I'. The 21st word is 'gT'. The only possible words are 'AT' or 'IT'. This means either 'f' or 'g' is 'A' or 'I'. To figure out which is which we can look at the 19th word 'fmE'. There is no 3 letter word that begins with 'I' and ends in 'E'. There is however a very common 3 letter word that begins in 'A' and ends in 'E'. The word 'ARE'. This is the more likely word. This gives us that 'f' = 'A', 'g' = 'I', and 'm' = 'R'. Now we should replace these in:
lHEd THEh eIpvOkER THE vEdTER Oo THE cdIkERpE, A aOT Oo jEOjaE lIaa iE eIpAjjOIdTEe TO eIpvOkER THEh ARE dOT IT. - iERdARe iAIaEh
The 9th and 10th words are "A aOT". 3 letter words that end in 'OT' are 'NOT', 'LOT', and 'ROT'. 'A LOT', is a much more common phrase than 'A NOT' or 'A ROT'. This tells us that 'a' = 'L'. Now we replace this:
lHEd THEh eIpvOkER THE vEdTER Oo THE cdIkERpE, A LOT Oo jEOjLE lILL iE eIpAjjOIdTEe TO eIpvOkER THEh ARE dOT IT. - iERdARe iAILEh
Now we can notice 2 things. Look at the twelfth word 'jEOjLE'. The only thing that it can be is the word 'PEOPLE'. This means 'j' = 'P'. Also we can notice that the 4th to last word, 'dOT' must be the word 'NOT' because of the words before and after it. This means 'd' = 'N'. Now we replace this:
lHEN THEh eIpvOkER THE vENTER Oo THE cNIkERpE, A LOT Oo PEOPLE lILL iE eIpAPPOINTEe TO eIpvOkER THEh ARE NOT IT. - iERNARe iAILEh
The only 12 letter word that has 'APPOINTE' in it is 'DISAPPOINTED'. So, 'e' = 'D', 'p' = 'S', and 'e' = 'D'.
The first word, 'lHEN' must be the word 'WHEN' because there is no other word that fits. So, 'l' = 'W'. The 5th word, 'vENTER' must be 'CENTER' for the same reason. So, 'v' = 'C'.
Replace these:
WHEN THEh DISCOkER THE CENTER Oo THE cNIkERSE, A LOT Oo PEOPLE WILL iE DISAPPOINTED TO DISCOkER THEh ARE NOT IT. - iERNARD iAILEh
Now it is trivial to find the actual plaintext:
WHEN THEY DISCOVER THE CENTER OF THE UNIVERSE, A LOT OF PEOPLE WILL BE DISAPPOINTED TO DISCOVER THEY ARE NOT IT. - BERNARD BAILEY.

Notice that we did not just use letter frequency analysis, we also used digraph analysis, and word analysis. We also built upon our previous discoveries. Just from guessing that 'b' was 'E', we were able to decrypt the whole ciphertext. This algorithm for decryption is very hard to computer program so most ciphers like these are better to be decrypted by hand using this same method.