Lecture 4: Non-Mathematical Ciphers

The Keyword Cipher

`PARTY`

as the keyword:
MAKE SURE JOE IS GONE BY SEVEN. ALICE.Now, we create our ciphertext alphabet and compare to our plaintext alphabet

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 A R T Y B C D E F G H I J K L M N O Q S U V W X ZSo our encrypted message reads:

IPGY OSNY FKY EO CKJY AX OYWYJ. PHERY.To decrypt this message, Bob needs to know that the keyword is party. Once he knows that, he swaps the position of the alphabets:

ciphertext: P A R T Y B C D E F G H I J K L M N O Q S U V W X Z 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 Zand reads the message.

The Square Cipher

I AM READY TO PARTY! HOW ABOUT YOU? CAROL.Notice that without punctuation, there are 31 characters in Carol's message. Adding a dummy

`X`

at the end makes 32. Now draw two
four by four square, and write the message out, one letter in each box
going all the way across both boxes, one row at a time:

Now, to get her encrypted message, Carol writes the last
*column*, top to bottom. Then she writes the second to last
column, and so forth. Her encrypted message looks like:

YHYX DYTL ATUO EROR RABA MPAC AOWU ITOOAlice could have arranged the columns in any order she wanted to. Of course, to decrypt the message, Bob needs to know both what size square Alice used and what order in which she wrote the columns.

The Date Cipher

PARTY TIME!!!First, she writes the numerical date (8/30/2008) over her message, repeating as often as necessary:

83020 0883020 PARTY TIME!!!Next, she shifts each character to a number and then adds to that the number written directly above, reducing each modulo 41 gives the ciphertext:

2404182225 20172108384038So long as the recipients know the date that was used to encrypt the message, it is as easy to decrypt as the shift cipher!

Exercises

- Suppose you have a message and that you want to encrypt using the keyword cipher. What should you do if your keyword uses a certain letter more than once?
- Find a partner. Write a long message to your partner and use the
square cipher to encrypt it. Keep in mind that you do not need to use
four by four squares. Any size square will work, but it you should
choose your squares depending on the length of your message. Trade
messages and decrypt.
Now write a short reply message and encode it using the date cipher. Trade and decrypt.

- Think back on all the ciphers we have worked with. Which one was the fastest to encrypt and decrypt? Which one was the slowest? Can you think of a real world example of when you would want a cipher which was fast to encrypt and decrypt? How about an example where you would want a cipher that had a slow encryption and decryption time?

This work was made possible through a grant from the National Science Foundation.