Modular Exponentiation - Straightforward Method

Straightforward Method

The most straightforward method of calculating a modular exponent is to calculate be directly, then to take this number modulo m. Consider trying to compute c, given b = 4, e = 13, and m = 497:

One could use a calculator to compute 413; this comes out to 67,108,864. Taking this value modulo 497, the answer c is determined to be 445.

Note that b is only one digit in length and that e is only two digits in length, but the value be is 8 digits in length.

In strong cryptography, b is often at least 256 binary digits (77 decimal digits). Consider b = 5 × 1076 and e = 17, both of which are perfectly reasonable values. In this example, b is 77 digits in length and e is 2 digits in length, but the value be is 1309 decimal digits in length. Such calculations are possible on modern computers, but the sheer magnitude of such numbers causes the speed of calculations to slow considerably. As b and e increase even further to provide better security, the value be becomes unwieldy.

The time required to perform the exponentiation depends on the operating environment and the processor. The method described above requires O(e) multiplications to complete.

Read more about this topic:  Modular Exponentiation

Famous quotes containing the word method:

    ... the one lesson in the ultimate triumph of any great actress has been to enforce the fact that a method all technique or a method all throes, is either one or the other inadequate, and often likely to work out in close proximity to the ludicrous.
    Mrs. Leslie Carter (1862–1937)