CSS 220 Module 4 Homework
Think about how many messages are sent electronically today. What are most common? Email, text messages, in-app messaging? And what kind of data gets sent? Is it secure? For it to be secure during transmission, it needs to be encrypted. Do you know if your messages are encrypted? It is not hard to do. Let’s work through some classic encryption techniques.
Then when it arrives and the receiver wants to look at your message, they can perform a decryption. All forms of encryption rely on two basic forms of ciphers: substitution-based and transposition-based. Good encryption algorithms actually use multiple layers of both cipher forms. Let’s look at each form in more detail.
Substitution-based Ciphers
Have you ever seen the cryptoquote puzzles in the newspaper? You can try to solve one here: https://api.razzlepuzzles.com/cryptogram.
Despite its daunting name, the substitution-based cipher is actually a fairly simple encryption technique. A substitution-based cipher replaces a character or group of characters with a different character or group of characters. Consider the following simple example. Each letter in the plaintext row maps onto the letter below it in the ciphertext row.
Plaintext: abcdefghijklmnopqrstuvwxyz
Ciphertext: POIUYTREWQLKJHGFDSAMNZVCXB
This ciphertext simply corresponds to the letters on a keyboard, scanning right to left, top to bottom. To send a message using this encoding scheme, each plaintext letter of the message is replaced with the ciphertext character directly below it. Thus, the message
what are you doing after class?
would encode to
VEPMP STXGN UGWHR PTMYS IKPAA
A space has been placed after every five ciphertext characters to help disguise obvious patterns.
1. Using the above plaintext and corresponding ciphertext, encode the message “i will encrypt everything”.
A famous substitution cipher is the Caesar Cipher, created and used by Julius Caesar. This cipher uses what is called a shift technique. Similar to above, you will make substitutions, but is a bit easier to code and decode. The transformation can be represented by aligning two alphabets; the cipher alphabet is the plain alphabet shifted left or right by some number of positions (the key).
For instance: Key = left shift 7 spaces
Plaintext: abcdefghijklmnopqrstuvwxyz
Ciphertext: TUVWXYZABCDEFGHIJKLMNOP
2. Create your own message and encode it using the Caesar Cipher method. Provide your key to decode the message.
Transposition-based Ciphers
A transposition-based cipher is different from a substitution-based cipher in that the order of the plaintext is not preserved. Rearranging the order of the plaintext characters makes common patterns unclear and the code much more difficult to break. Let us consider a simple example of a transposition cipher. Choose a keyword that contains no duplicate letters, such as COMPUTER. Over each letter in the keyword, write the number that corresponds to the order in which that letter appears in ...