Public-key math your exam tests
Purpose: Key agreement over an insecure channel.
Public: q, α. Private: X. Never send X.
Purpose: Encrypt/decrypt (and sign).
Public: {e, n}. Private: {d, n}.
Canonical course example: q=353, α=3, X_A=97, X_B=233. Values below are computed live.
MITM weakness: Without authentication, an attacker can substitute their own Y values. DH alone does not prove identity.
Example p=11, q=17 — encrypt/decrypt math in RSA Modular Math (computed tables).
| Step | Formula |
|---|---|
| 1 | n = p × q |
| 2 | φ(n) = (p−1)(q−1) |
| 3 | Choose e: gcd(e, φ)=1 |
| 4 | d = e⁻¹ mod φ (Extended Euclidean) |
Message M = 21, e = 19, n = 187 → C = 2119 mod 187. Use RSA Modular Math successive-squaring calculator for C and d.
Which statement is true about Diffie-Hellman?
For RSA with p=11, q=17, what is φ(n)?