Chapter 1 – Exercise Solutions
Exercise 1.1 — Caesar Cipher
Encrypt the message 'HELLO' using Caesar Cipher with key = 3.
Encryption: C = (P + 3) mod 26
Result: HELLO → KHOOR
Decryption: P = (C - 3) mod 26 → HELLO
Answer: Ciphertext = KHOOR, Plaintext = HELLO
Exercise 1.2 — Frequency Attack
Caesar Cipher is insecure because it has only 25 possible keys and predictable letter frequencies.
Answer: Easy to break using brute-force or frequency analysis.
Exercise 1.3 — Affine Cipher Encryption
Encrypt 'CAT' using a = 5, b = 8.
C = (a×P + b) mod 26 → Ciphertext = SIZ
Exercise 1.4 — Affine Cipher Decryption
Decrypt 'SIZ' with a = 5, b = 8.
Inverse of 5 mod 26 = 21.
P = 21 × (C − 8) mod 26 → Plaintext = CAT
Exercise 1.5 — Modular Arithmetic Practice
a) 17 mod 5 = 2
b) (7 + 9) mod 5 = 1
c) (7 × 9) mod 5 = 3
d) (7 − 9) mod 5 = 3
Exercise 1.6 — Security of Key Length
Increasing key length makes brute-force attacks infeasible.
Example: DES (56-bit) is weak, AES (128-bit) is secure.
Exercise 1.7 — Kerckhoffs’ Principle
A cryptosystem should remain secure even if everything is public except the key.
Answer: Security must depend on the key, not algorithm secrecy.
Exercise 1.8 — Compare Cryptography Types
Symmetric: same key for encryption & decryption (AES).
Asymmetric: two keys (public & private) e.g., RSA.