Why These Four Operations Matter
| Operation | Where It Shows Up in Cryptography |
|---|---|
| Modular reduction | The basic building block underlying every other operation here — everything in modular arithmetic "wraps around" at the modulus |
| Modular exponentiation | The core operation of RSA encryption/decryption and Diffie-Hellman key exchange — computing ab mod n efficiently is what makes these algorithms practical at all |
| Euclidean algorithm (GCD) | Used to verify two numbers are coprime — a requirement when choosing RSA's public exponent e |
| Modular inverse | Computing RSA's private exponent d requires finding the modular inverse of e — this is literally how RSA key generation works |
Fast Modular Exponentiation, Briefly
Computing ab mod n by literally multiplying a by itself b times would be impossibly slow for the huge numbers real cryptography uses. The trick — square-and-multiply — is exactly why RSA is computationally practical: repeatedly square the base and reduce mod n at every single step, using the binary representation of the exponent to decide when to multiply the running result. This turns an operation that would take billions of steps into one that takes only a few hundred, and it's the same technique this trainer uses internally to check your answers.
Once these operations feel natural, try applying them directly: the Dilithium and Kyber tools use post-quantum math instead of RSA's modular exponentiation, which is exactly why they resist Shor's algorithm where RSA doesn't — see the Quantum Threat Simulator for that comparison directly.
