Fast Modular Exponentiation
   Step-by-Step Animation   Animation Speed 
Elaboration:
?
Fast Modular Exponentiation (be % n): This algorithm is commonly used in public key cryptography. In cryptography, base b and power e are both large numbers. Multiplying b by itself (e - 1) times is not practical.
Algorithm Details: The last equation shows the pattern of repeatedly squaring b
e = ei · 2i + ei - 1 · 2i - 1 + ei - 2 · 2i - 2 + ··· + e1 · 21 + e0 · 20  where ei is the ith bit of e
b e % n = ( b ei · 2i + ei - 1 · 2i - 1 + ei - 2 · 2i - 2 + ··· + e1 · 21 + e0 · 20 ) % n
b e % n = ( bei · 2i · bei - 1 · 2i - 1 · bei - 2 · 2i - 2 · ··· · be1 · 21 · be0 · 20 ) % n
快速模块化求幂定义:快速模块化求幂实现的最基本的理论的引理就是积的取余等于取余的积的取余。在在这条引理的基础之上,对指数型数据进行拆分以及合并,从而得到我们用的快速幂算法。
按键说明:
Compute be % n 在三个文本框中分别输入b,e,n三个数值,并点击此按钮计算得到b的e次方并对n进行取余。