BIT303 ยท 2081 ยท 10 marks
RSA Cryptosystem with p=11 and q=7 Consider p=11 and q=7 in a RSA cryptosystem. **i. What is a public key pair (e, n)?** **ii. What is a private key pair (d, n)?** **iii. What is ciphertext for M=6?**
RSA Cryptosystem with p=11 and q=7
Consider p=11 and q=7 in a RSA cryptosystem.
i. What is a public key pair (e, n)?
ii. What is a private key pair (d, n)?
iii. What is ciphertext for M=6? [10]
RSA Cryptosystem: p = 11, q = 7
Given Data
- $p = 11$ (prime)
- $q = 7$ (prime)
- Message $M = 6$
Step A: Compute n and ฯ(n)
$$n = p \times q = 11 \times 7 = 77$$
$$\phi(n) = (p-1)(q-1) = 10 \times 6 = 60$$
Part (i): Public Key Pair (e, n)
Choose $e$ with $1 < e < \phi(n)$ and $\gcd(e, \phi(n)) = 1$.
Try $e = 7$: $$\gcd(7, 60) = 1 \quad \checkmark$$
$$\boxed{\text{Public Key} = (e, n) = (7, 77)}$$
Note: $e$ is not unique; other valid choices include 11, 13 and 17. We use $e = 7$ here.
Part (ii): Private Key Pair (d, n)
Find $d$ such that $d \times 7 \equiv 1 \pmod{60}$.
Extended Euclidean Algorithm:
$$60 = 8 \times 7 + 4$$ $$7 = 1 \times 4 + 3$$ $$4 = 1 \times 3 + 1$$ $$3 = 3 \times 1 + 0$$
Back substitution:
$$1 = 4 - 1 \times 3$$ $$1 = 4 - 1 \times (7 - 1 \times 4) = 2 \times 4 - 1 \times 7$$ $$1 = 2 \times (60 - 8 \times 7) - 1 \times 7 = 2 \times 60 - 17 \times 7$$
So $d = -17 \equiv 60 - 17 = 43 \pmod{60}$.
Verification: $43 \times 7 = 301 = 5 \times 60 + 1 \equiv 1 \pmod{60}$ โ
$$\boxed{\text{Private Key} = (d, n) = (43, 77)}$$
Part (iii): Ciphertext for M = 6
$$C = M^e \bmod n = 6^7 \bmod 77$$
Using repeated squaring:
$$6^1 = 6$$ $$6^2 = 36$$ $$6^4 = 36^2 = 1296 = 16 \times 77 + 64 \equiv 64 \pmod{77}$$
$$6^7 = 6^4 \times 6^2 \times 6^1 = 64 \times 36 \times 6$$
$$64 \times 36 = 2304 = 29 \times 77 + 71 \equiv 71 \pmod{77}$$ $$71 \times 6 = 426 = 5 \times 77 + 41 \equiv 41 \pmod{77}$$
$$\boxed{C = 41}$$
Summary Table
| Parameter | Value |
|---|---|
| $n$ | 77 |
| $\phi(n)$ | 60 |
| Public Key $(e, n)$ | (7, 77) |
| Private Key $(d, n)$ | (43, 77) |
| Plaintext $M$ | 6 |
| Ciphertext $C$ | 41 |
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.