# Modular exponentiation facts for kids

**Modular exponentiation** is about finding the value of the equation c = b^{e} mod m. This is the remainder when dividing b^{e} by m. It is the inverse function of the discrete logarithm. Because modular exponentiation is easy and fast, and finding the discrete logarithm is difficult, both are used in fields such as public-key cryptography.

## Right-to-left binary method

When dealing with very large whole numbers, directly finding the result can be very resource intensive. We can make some optimisations to save computation power with principles like exponention by squaring.

Let's solve c = b^{e} mod m:

- If m is 1, then we know that c must be 0 because every whole number is divisible by 1.
- Pull the number 1 aside and name it r.
- Find b mod m and replace b with the result.
- While e is larger then 0 do the following:
- If e is an odd number:
- Find and replace r with the result.

- Halve e and round it down to the nearest whole number. Then replace e with the result.
- Find and replace b with the result.

- If e is an odd number:
- Your answer will now be r.

All content from Kiddle encyclopedia articles (including the article images and facts) can be freely used under Attribution-ShareAlike license, unless stated otherwise. Cite this article:

Modular exponentiation Facts for Kids. *Kiddle Encyclopedia.*