- 2072 Kartik · 6 marks
RSA encrypt/decrypt OVEL
Short answer
Using p=5, q=11, n=55, phi=40, e=3, d=27, convert letters A=1 to Z=26 and compute C=M^3 mod 55. OVEL encrypts to 20, 33, 15, 23; decrypting with d=27 recovers 15, 22, 5, 12, i.e. OVEL.
Encrypt and decrypt the "OVEL" message using the RSA algorithm.
Method: convert letters to numbers (A = 1, B = 2, ... Z = 26), encrypt each number M with C = Mᵉ mod n and decrypt with M = Cᵈ mod n.
Key generation
| Step | Calculation | Value |
|---|---|---|
| Primes | choose p = 5, q = 11 | |
| n | 5 × 11 | 55 |
| φ(n) | (5 − 1)(11 − 1) = 4 × 10 | 40 |
| e | choose e = 3, gcd(3, 40) = 1 | 3 |
| d | 3 × d ≡ 1 mod 40; 3 × 27 = 81 = 2 × 40 + 1 | 27 |
Public key = (3, 55); private key = (27, 55). Every letter value is less than n = 55.
Encryption and decryption
| Letter | M | Encryption C = M³ mod 55 | Decryption M = C²⁷ mod 55 |
|---|---|---|---|
| O | 15 | 15³ mod 55 = 20 | 20²⁷ mod 55 = 15 |
| V | 22 | 22³ mod 55 = 33 | 33²⁷ mod 55 = 22 |
| E | 5 | 5³ mod 55 = 15 | 15²⁷ mod 55 = 5 |
| L | 12 | 12³ mod 55 = 23 | 23²⁷ mod 55 = 12 |
Working for each letter
- O: encrypt: 15^1 = 15, 15^2 = 5 (all mod 55); 3 = 1 + 2, so 15^3 = 15 × 5 mod 55 = 20. Decrypt: 20^1 = 20, 20^2 = 15, 20^4 = 5, 20^8 = 25, 20^16 = 20 (all mod 55); 27 = 1 + 2 + 8 + 16, so 20^27 = 20 × 15 × 25 × 20 mod 55 = 15.
- V: encrypt: 22^1 = 22, 22^2 = 44 (all mod 55); 3 = 1 + 2, so 22^3 = 22 × 44 mod 55 = 33. Decrypt: 33^1 = 33, 33^2 = 44, 33^4 = 11, 33^8 = 11, 33^16 = 11 (all mod 55); 27 = 1 + 2 + 8 + 16, so 33^27 = 33 × 44 × 11 × 11 mod 55 = 22.
- E: encrypt: 5^1 = 5, 5^2 = 25 (all mod 55); 3 = 1 + 2, so 5^3 = 5 × 25 mod 55 = 15. Decrypt: 15^1 = 15, 15^2 = 5, 15^4 = 25, 15^8 = 20, 15^16 = 15 (all mod 55); 27 = 1 + 2 + 8 + 16, so 15^27 = 15 × 5 × 20 × 15 mod 55 = 5.
- L: encrypt: 12^1 = 12, 12^2 = 34 (all mod 55); 3 = 1 + 2, so 12^3 = 12 × 34 mod 55 = 23. Decrypt: 23^1 = 23, 23^2 = 34, 23^4 = 1, 23^8 = 1, 23^16 = 1 (all mod 55); 27 = 1 + 2 + 8 + 16, so 23^27 = 23 × 34 × 1 × 1 mod 55 = 12.
Ciphertext numbers: 20, 33, 15, 23. Decrypted numbers: 15, 22, 5, 12 = OVEL.
Answer: with p = 5, q = 11, e = 3, d = 27, OVEL is encrypted to 20, 33, 15, 23 and decrypts back to OVEL.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- RSA steps; encrypt word CAT · Computer Networks and Security, chapter 8
- RSA algorithm with example · Computer Networks and Security, chapter 8 · asked 4×