Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Modular exponentiation
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Direct method == The most direct method of calculating a modular exponent is to calculate {{math|''b''<sup>''e''</sup>}} directly, then to take this number modulo {{math|''m''}}. Consider trying to compute {{math|''c''}}, given {{math|''b'' {{=}} 4}}, {{math|''e'' {{=}} 13}}, and {{math|''m'' {{=}} 497}}: : {{math|''c'' ≡ 4{{sup|13}} (mod 497)}} One could use a calculator to compute 4<sup>13</sup>; this comes out to 67,108,864. Taking this value modulo 497, the answer {{math|''c''}} is determined to be 445. Note that {{math|''b''}} is only one digit in length and that {{math|''e''}} is only two digits in length, but the value {{math|''b''<sup>''e''</sup>}} is 8 digits in length. In strong cryptography, {{math|''b''}} is often at least 1024 [[bit]]s.<ref>{{Cite web|url=https://weakdh.org/|title=Weak Diffie–Hellman and the Logjam Attack|website=weakdh.org|access-date=2019-05-03}}</ref> Consider {{math|''b'' {{=}} 5 × 10<sup>76</sup>}} and {{math|''e'' {{=}} 17}}, both of which are perfectly reasonable values. In this example, {{math|''b''}} is 77 digits in length and {{math|''e''}} is 2 digits in length, but the value {{math|''b''<sup>''e''</sup>}} is 1,304 decimal digits in length. Such calculations are possible on modern computers, but the sheer magnitude of such numbers causes the speed of calculations to drop considerably. As {{math|''b''}} and {{math|''e''}} increase even further to provide better security, the value {{math|''b''<sup>''e''</sup>}} becomes unwieldy. The time required to perform the exponentiation depends on the operating environment and the processor. The method described above requires {{math|[[Big O notation|Θ]](''e'')}} multiplications to complete.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)