Simple Substitution


The Simple Substitution Cipher is one of the most generalized substitution ciphers. In essence, each letter of the alphabet is to be replaced by something - a picture, an symbol, a number, or for our cases, another letter. These letters can be replaced at random, or possibly have a "key" that creates a specially randomized alphabet. The Caesar cipher and Atbash cipher are both special cases of how one can scramble an alphabet in a simple substitution. An example of an simple substitution cipher is in one of Arthur Conan Doyle's Sherlock Holmes' stories, The Adventures of the Dancing Men.


Encoding Simple Substitution

Encoding for the simple substitution is just like the Caesar and Atbash ciphers - use your plaintext alphabet to find the letter you want to encrypt. Look below to its corresponding letter in the ciphertext akphabet. Write the ciphertext letter down.

Decoding Simple Substitution

Decoding Simple Subsition works in entirely the same way, except backwards. Insread of checking the plaintext alphabet first, a decryptor will look for their letter within the ciphertext alphabet, and then write down its corresponding plaintext letter above.

Breaking Simple Substitution

Breaking Simple Subsition, unlike Caesar and Atbash, is not as easy. One of the reasons for this increased difficulty is the amount of possible combinations for the alphabet to be organized in. However, that does not mean the the Simple Substitution cipher is infalliable. Frequency Analysis is often the term used to describe how simple substitution cipher are broken. When you think about it, if we only replace the letters of the alphabet with one unique character, then the frequency of letters that show up on the ciphertext should correspond to some percentage of letters that occur in English. For instance, given a large enough paragraph, the most common letter could be inferred to be an E, due to the similar occurrences. Given even longer passages in simple substitution, patterns will begin to appear with groups of letters.

Tips For Breaking Simple Substitution

  • Frequency Analysis is your best friend. The longer the passage, the more effective it can be.
  • ...but it's not infalliable. Frequency Analysis doen't work as well with shorter passages, and can often give wrong or misleading results. Use common sense and judgement to help you.
  • Think about how English works, grammatically and syntatically - aka think about how words are put together and how they're spelled. For instance:
    • If the word is only one letter: It's probably safe to say that letter is "A" or "I", the only common one-letter words.
    • If the word is two letters: Here are a list of common two-letter words in English: of, to, in, it, is, be, as, at, so, we, he, by, or, on, do, if, me, my, up, an, go, no, us, am
    • If the word is three words: The word is most likely "the" or "and". If not, it's probably another conjunction.
    • If the word is longer: Try to get some of the letters in the word decrypted. Then use common sense and logic to complete it. For instance, if the fragment is _eb_ite, "website" could be a safe guess.
  • Understand that you're going to get some things wrong, and will have to retry. Don't lose hope! It just means that you're even closer to breaking the cipher.

Simple Substitution Table

Plaintext:  a b c d e f g h i j k l m n o p q r s t u v w x y z
Ciphertext: P H Q G I U M E A Y L N O F D X J K R C V S T Z W B (random)
Ciphertext: C I P H E R A B D F G J K L M N O Q S T U V W X Y Z (key)

Simple Substitution Example

Plaintext:  CRYPTOLOGY IS COOL
Ciphertext: QKWXCDNDMW AR QDDN (random)
Ciphertext: PQYNTMJMAY DS PMMJ (key)

English Frequencies


English Frequencies

Practice with Simple Substitution

Example 1: Decipher SN AE, NQ KNS SN AE--SCHS DR SCE PUERSDNK:
WCESCEQ 'SDR KNAIEQ DK SCE JDKL SN RUTTEQ
SCE RIDKBR HKL HQQNWR NT NUSQHBENUR TNQSUKE
NQ SN SHGE HQJR HBHDKRS H REH NT SQNUAIER
HKL AY NOONRDKB EKL SCEJ. Example 2: Decipher VJPFJ EUTVU JNJXS JEFHT UTFJZ HBNHZ BCCCB AJBDB DRTXV FHJQD
BFJUP FTFJP KRTXJ EBNTZ TPPQU UJDCV TDUUJ CBSJE TFJCV TFFTN
OJUSV DTATC TDUTB ERKEN JPKRF HJJXW BEJKR MTWTD
Example 1: TO BE, OR NOT TO BE--THAT IS THE QUESTION:

WHETHER 'TIS NOBLER IN THE MIND TO SUFFER
THE SLINGS AND ARROWS OF OUTRAGEOUS FORTUNE
OR TO TAKE ARMS AGAINST A SEA OF TROUBLES
AND BY OPPOSING END THEM.
- William Shakespeare, Hamlet

Example 2: YESTERDAY DECEMBER A DATE WHICH WILL LIVE IN INFAMY THE UNITED STATES OF AMERICA WAS SUDDENLY AND DELIBERATELY ATTACKED BY NAVAL AND AIR FORCES OF THE EMPIRE OF JAPAN.
- FDR's Pearl Harbor Speech to Congress

Extras

Simple Substitution cipher often have a way of finding themselves into popular media. They have often been used as a treat for fans of Futurama and Gravity Falls, for instance. But two of the most popular simple substitution ciphers are found in Edgar Allen Poe's short story, The Gold-Bug, and one of Sir Arthur Conan Doyle's "Sherlock Holmes" stories, The Adventure of the Dancing Men.

Below are the two ciphers used in them. I won't give the answers or context, you'll just have to read the stories for yourself to find out.


The Gold-Bug Cipher, by Edgar Allen Poe

53‡‡†305))6*;4826)4‡.)4‡);806*;48†8
¶60))85;;]8*;:‡*8†83(88)5*†;46(;88*96
*?;8)*‡(;485);5*†2:*‡(;4956*2(5*—4)8
¶8*;4069285);)6†8)4‡‡;1(‡9;48081;8:8‡
1;48†85;4)485†528806*81(‡9;48;(88;4
(‡?34;48)4‡;161;:188;‡?;

The Dancing Men Cipher, by Sir Arthur Conan Doyle

Dancing Men Cipher

The Pigpen Cipher

Perhaps, as a young child, many of you encountered the Pigpen Cipher, picured below. The Pigpen Cipher is another form of simple subsitution cipher, only it uses a letter's location in a grid as the subsitution element.

Pigpen Cipher Pigpen Message

Python Application of Simple Substitution

This application to come soon