Back to Student Worksheet
CS Grade 9-12 Answer Key

CS: Cryptography: Ciphers and Encryption

Practice with classic ciphers, keys, encryption, and security ideas

Answer Key
Name:
Date:
Score: / 12

CS: Cryptography: Ciphers and Encryption

Practice with classic ciphers, keys, encryption, and security ideas

CS - Grade 9-12

Instructions: Read each problem carefully. Show your work in the space provided. Use A = 0, B = 1, C = 2, and so on when a problem asks for modular arithmetic with letters.
  1. 1

    Use a Caesar cipher with a shift of 3 to encrypt the message CAT. Shift each letter 3 places forward in the alphabet.

    Count forward 3 letters from each original letter.

    The encrypted message is FDW. C shifts to F, A shifts to D, and T shifts to W.
  2. 2

    A message was encrypted with a Caesar cipher using a shift of 5. The ciphertext is MJQQT. Decrypt the message.

    The decrypted message is HELLO. Each ciphertext letter is shifted 5 places backward in the alphabet.
  3. 3

    Using A = 0 through Z = 25, encrypt the letter R with a Caesar shift of 9. Show the modular arithmetic.

    If the result is 26 or more, wrap around using modulo 26.

    R is 17. Adding the shift gives 17 + 9 = 26. Since 26 mod 26 = 0, the encrypted letter is A.
  4. 4

    A substitution cipher maps plaintext letters to ciphertext letters using a secret shuffled alphabet. Explain one reason a simple substitution cipher is usually not secure against a determined attacker.

    A simple substitution cipher is not very secure because it preserves letter patterns and letter frequencies. An attacker can use frequency analysis to guess common letters, words, and repeated patterns.
  5. 5

    In English text, the letter E often appears more than any other letter. In a long ciphertext made with a simple substitution cipher, the symbol X appears most often. What might an attacker reasonably guess, and why?

    Frequency analysis looks for patterns that survive encryption.

    An attacker might guess that X represents E. This is reasonable because frequency analysis compares common ciphertext symbols with common letters in the language.
  6. 6

    Use the Vigenere cipher to encrypt the plaintext HI using the key NO. Use A = 0, B = 1, and so on. Add the plaintext value and key value modulo 26 for each letter.

    H is 7 and N is 13, so 7 + 13 = 20, which is U. I is 8 and O is 14, so 8 + 14 = 22, which is W. The ciphertext is UW.
  7. 7

    Use the Vigenere cipher to decrypt the ciphertext UW using the key NO. Use A = 0, B = 1, and so on. Subtract the key value from the ciphertext value modulo 26.

    For decryption, subtract the key shift instead of adding it.

    U is 20 and N is 13, so 20 - 13 = 7, which is H. W is 22 and O is 14, so 22 - 14 = 8, which is I. The plaintext is HI.
  8. 8

    A one-time pad can provide perfect secrecy when used correctly. List two conditions that must be true for a one-time pad to be secure.

    The key must be truly random and at least as long as the message. The key must also be used only once and kept secret from attackers.
  9. 9

    Encrypt the 4-bit plaintext 1010 using XOR with the 4-bit key 1100. Show the result bit by bit.

    XOR gives 1 when the two bits are different and 0 when they are the same.

    The ciphertext is 0110. The XOR steps are 1 XOR 1 = 0, 0 XOR 1 = 1, 1 XOR 0 = 1, and 0 XOR 0 = 0.
  10. 10

    Explain the difference between symmetric encryption and asymmetric encryption. Include what kind of keys are used in each system.

    Symmetric encryption uses the same secret key for encryption and decryption. Asymmetric encryption uses a public key and a private key, where one key can encrypt and the matching key can decrypt.
  11. 11

    A website uses HTTPS. Explain how encryption helps protect a user's password when it is sent from the browser to the website.

    Think about what an eavesdropper would see while data is in transit.

    Encryption changes the password into unreadable ciphertext while it travels across the network. Even if someone intercepts the data, they should not be able to read the password without the correct key.
  12. 12

    A classmate says, "Hashing is the same as encryption because both hide data." Explain why this statement is not correct.

    Ask whether the original message is meant to be recovered.

    Hashing is not the same as encryption. Encryption is designed to be reversible with the correct key, while a cryptographic hash is designed to be one-way and produce a fixed-size digest that cannot practically be turned back into the original data.
LivePhysics™.com CS - Grade 9-12 - Answer Key