Skip to content

Instantly share code, notes, and snippets.

@dianevinson
Last active May 8, 2020 19:59
Show Gist options
  • Save dianevinson/a957f80ff9a3ab7157702c7b9addf25e to your computer and use it in GitHub Desktop.
Save dianevinson/a957f80ff9a3ab7157702c7b9addf25e to your computer and use it in GitHub Desktop.
The hints for the bathroom ciphers problem

Caesar Cipher Hints

A Caesar cipher is a simple type of cipher where each letter in the alphabet is shifted over a uniform amount of letters. To create a Caesar cipher, first assign a number to each letter in the alphabet in order.

A = 1, B = 2, C =3, and so forth. This is our plaintext alphabet

Next, choose an amount to add to each number. For this example, we'll add 3 to each number. Since there are only 26 letters in the English alphabet, once the sum of the original number plus the number we're adding to it is greater than 26, we'll start our count over again at 1. So in this example of adding 3 to each of our numbers, we get

A = 4, B =5, C = 6, ... , V = 25, W = 26, X = 1, Y = 2, Z = 3. This is our ciphertext alphabet

Once you have the plaintext alphabet and your ciphertext alphabet, replace each ciphertext letter with the plaintext letter that has the same number. So if you want to encrypt the word "CAT", you would find in your ciphertext alphabet that C=6, A=4, and T=23. Checking those values in your plaintext alphabet, you find that

6 corresponds to F, 4 corresponds to D, and 23 corresponds to W, so "CAT" in ciphertext is FDW

To decode ciphertext, you would apply the same process backwords. It can be tricky to figure out how much the alphabet was shifted by, but check out these resources for some tips!

(http://practicalcryptography.com/ciphers/caesar-cipher/)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment