Breaking the Shift Cipher
Use the PART III provided in the simulation page to solve the following problems. The tool includes a Shift Cipher calculator and a workspace for your analysis.
1. Encrypt the following plaintext using key k = 7.
Given:
- Plaintext:
Lord Rama was a good king. - Key: k = 7
2. Given a plaintext and its corresponding ciphertext, determine the key used for encryption.
Given:
- Plaintext:
abcdefghijklmnopqrstuvwxyz - Ciphertext:
tuvwxyzabcdefghijklmnopqrs
Hint: Compare the first few letters: a→t, b→u, c→v...
3. How many different keys are possible with an n-letter alphabet?
4. For the English alphabet (n = 26), how many distinct keys exist?
5. Decrypt the following ciphertext using a brute-force attack.
Given: HAAHJR HA KHDU
6. Why is the Shift Cipher vulnerable to brute-force attacks even though a secret key is used?
7. Explain how frequency analysis can be used to recover the plaintext of a Shift Cipher. Under what conditions is frequency analysis more effective?
8. Suppose the alphabet contains n symbols. Explain how increasing the alphabet size affects the key space. Is increasing the key space alone sufficient to make the Shift Cipher secure? Justify your answer.
9. Compare brute-force attack and frequency analysis for breaking the Shift Cipher. Which technique guarantees recovery of the plaintext? Explain your reasoning.
10. If an attacker knows one plaintext character and its corresponding ciphertext character, explain how the encryption key can be determined.
11. Write an algorithm or program in a programming language of your choice to:
- Encrypt a plaintext using the Shift Cipher.
- Decrypt a ciphertext using a given key.
- Perform a brute-force attack by testing all possible keys.
12. Modern encryption algorithms such as AES also use secret keys. State two reasons why AES is significantly more secure than the Shift Cipher.