How to use this tool
- Enter base, nonnegative exponent, positive modulus.
- Select Calculate to view the result.
- Check the method and assumptions below before using the result.
The method, explained
Repeated squaring reduces each product modulo m while processing exponent bits. This computes a^e mod m with bounded intermediate integer values.
Using base = 7, nonnegative exponent = 128, positive modulus = 13, the result is 3. Change these example inputs to match your task; use the method above to check each step.
Understanding your result
No. Reducing after every multiplication gives the same remainder while avoiding the memory cost of representing the full integer power.
What to keep in mind
At most 200 digits per input. Educational arithmetic; not a constant-time cryptographic implementation. Finite-precision arithmetic is used. Check the domain and the stated convention before using an approximation.
Common questions
Does it calculate the enormous power first?
No. Reducing after every multiplication gives the same remainder while avoiding the memory cost of representing the full integer power.
How can I check the result?
Repeated squaring reduces each product modulo m while processing exponent bits. This computes a^e mod m with bounded intermediate integer values. The worked example uses editable inputs. Calculations run on your device; no external API or account is required.
Methodology maintained by ClarityKit. How these tools are built and checked.