Modular Exponentiation

Context: FIT1058_MOC · computing fast · square-and-multiply via binary exponent · exponent reduced by Euler’s theorem

Quick Revision

  • 🎯 Objective: compute efficiently ➔ square-and-multiply, multiplications.
  • 📦 Core Components: binary exponent ➔ reduce mod each step ➔ reduce exponent mod .
  • ⚡ Key Constraint: easy forward, discrete-log inverse is hard — the One-Way Function basis.

📝 Core

1. Fast Exponentiation

  • Naïve multiplications.
  • Square-and-multiply ➔ write in binary, repeatedly square ⟹ .
  • Bound ➔ at most multiplications.

2. Three Savings

3. One-Wayness

Key identities:

⚖️ Core Decision Matrix

TrickEffectCost
square-and-multiply multsbinary exponent
reduce mod keep factors per step
reduce exp mod shrink needs

When It Flips: three independent savings — fewer multiplications, smaller products, smaller exponent. Modular exponentiation is the workhorse of public-key cryptography precisely because it is easy forward but hard to invert (discrete log).

📊 Exam Execution Trace

Manual Execution Trace

, :

Step / StatePowerValue mod 11
0 (Init)7
15
23
39

⚠️ Common Mistakes

  • 💡 Exponent reduction needs coprimality requires ; without it the shortcut can fail. Reduce mod at every step to keep numbers small.

🧠 Active Recall