In the 16th century, Mary, Queen of Scots, was plotting against Queen Elizabeth. She was planning to assassinate the queen. Mary communicated with her lackeys through a basic cipher – she simply replaced the letters of the alphabet with new symbols. Using this cipher, Mary communicated her treasonous wishes. Queen Elizabeth’s spymaster, Francis Walsingham, suspected Mary’s treacherous intentions and intercepted some of her messages. To decipher the messages, Francis had to use a technique known as frequency analysis. Basically, alphabetic languages tend to have a certain distribution of letters. For example, here is the frequency table for all of the letters in this paragraph:
Using this technique, Francis noticed that one of Mary’s symbols occurred far more often than the others, so he figured that symbol must be representing “e”. Using frequency analysis, Francis was able to decipher Mary’s messages and prove her murderous plans. Mary was sentenced to death because she used a crappy cipher. Luckily, in the 21st century, we have more complex ciphers and forms of encryption. Unfortunately, these security measures aren’t used as often as they should be, and even when they are used, there’s a decent chance they’re not being used properly.