https://en.wikipedia.org/wiki/Modular_exponentiation

蒙哥马利(Montgomery)幂模运算是快速计算a^b%k的一种算法,是RSA加密算法的核心之一。

蒙哥马利模乘的优点在于减少了取模的次数(在大数的条件下)以及简化了除法的复杂度(在2的k次幂的进制下除法仅需要进行左移操作)。模幂运算是RSA 的核心算法,最直接地决定了RSA 算法的性能。
针对快速模幂运算这一课题,西方现代数学家提出了大量的解决方案,通常都是先将幂模运算转化为乘模运算。
 

Modular exponentiation is a type of exponentiation取幂,求幂;乘方 performed over a modulus模数,系数.

It is useful in computer science, especially in the field of public-key cryptography.

The operation of modular exponentiation calculates the remainder when an integer b 底数(the base) raised to the eth power (the exponent指数), be, is divided by a positive integer m (the modulus).

In symbols, given base b, exponent e, and modulus m, the modular exponentiation c is: c ≡ be (mod m).        //c=b的e次方 %m

For example, given b = 5, e = 3 and m = 13, the solution c = 8 is the remainder of dividing 53 = 125 by 13.      //c=5^3%13=125%13   因为125=13*9+8 ,所以125对13求余,结果是8

Given integers b and e, and a positive integer m, a unique solution c exists with the property 0 ≤ c < m.

Modular exponentiation can be performed with a negative exponent e by finding the modular multiplicative inverse d of b modulo m using the extended Euclidean algorithm. That is:

c ≡ be ≡ de mod m where e < 0 and b ⋅ d ≡ 1 mod m.

Modular exponentiation similar to the one described above are considered easy to compute, even when the numbers involved are enormous巨大的.

On the other hand, computing the discrete logarithm离散对数 – that is, the task of finding the exponente when given bc, and m – is believed to be difficult.

This one-way function behavior makes modular exponentiation a candidate for use in cryptographic algorithms.

Modular_exponentiation模幂运算的更多相关文章

  1. RSA简介(二)——模幂算法

    RSA最终加密.解密都要用到模乘的幂运算,简称模幂运算. 回忆一下RSA,从明文A到B B=Ae1%N 对B解密,就是 A=Be2%N 其中,一般来说,加密公钥中的e1一般会比较小,取65537居多, ...

  2. 快速幂模n运算

    模运算里的求幂运算,比如 5^596 mod 1234, 当然,直接使用暴力循环也未尝不可,在书上看到一个快速模幂算法 大概思路是,a^b mod n ,先将b转换成二进制,然后从最高位开始(最高位一 ...

  3. [ACM] hdu 3923 Invoker (Poyla计数,高速幂运算,扩展欧几里得或费马小定理)

    Invoker Problem Description On of Vance's favourite hero is Invoker, Kael. As many people knows Kael ...

  4. POJ1026 Cipher(置换的幂运算)

    链接:http://poj.org/problem?id=1026 Cipher Time Limit: 1000MS   Memory Limit: 10000K Total Submissions ...

  5. 组合数学 - 置换群的幂运算 --- poj CARDS (洗牌机)

    CARDS Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 1448   Accepted: 773 Description ...

  6. 迭代加深搜索 codevs 2541 幂运算

    codevs 2541 幂运算  时间限制: 1 s  空间限制: 128000 KB  题目等级 : 钻石 Diamond 题目描述 Description 从m开始,我们只需要6次运算就可以计算出 ...

  7. poj 3128 Leonardo's Notebook (置换群的整幂运算)

    题意:给你一个置换P,问是否存在一个置换M,使M^2=P 思路:资料参考 <置换群快速幂运算研究与探讨> https://wenku.baidu.com/view/0bff6b1c6bd9 ...

  8. RSA算法的C++string实现(模幂算法和欧几里得算法的使用)后附思路

    void resetNumA(string numAStr); //使用string重置numB void resetNumB(string numBStr); //将数组转换为字符串,用于输出 st ...

  9. 算数运算符: + - * / //(地板除) %(取余) **(幂运算) / 比较运算符 > < >= <= == !=

    # ### python运算符 #(1) 算数运算符: + - * / //(地板除) %(取余) **(幂运算) var1 = 5 var2 = 8 # +res = var1 + var2 pri ...

随机推荐

  1. arx 插入图片

    #include <ShLwApi.h> #pragma comment(lib, "ShLwApi.lib") //插入影像图 Acad::ErrorStatus i ...

  2. CAD得到布局名

    js代码如下: var database = mxOcx.GetDatabase(); var sRet = null; //返回数据库中的布局字典 var spLayoutDictionary = ...

  3. 反转链表_JAVA

    package algorithms; /* * * * 输入一个链表,反转链表后,输出新链表的表头. * public class ListNode { int val; ListNode next ...

  4. JSON字符串的生成

    public class Corporation { public string remark { get; set; } public string version { get; set; } pu ...

  5. 02JavaScript基础语法及数据类型

    JavaScript基础语法及数据类型 2.1数据类型 2.1.1字符串(String) 用单引号或双引号括起来的零个或多个单一的字符所组成. 2.1.2数值(Number) 包含整数或浮点数. 2. ...

  6. <SpringMvc>入门四 响应结果

    1.响应String类型 根据试图解析器,去找相对应的jsp Model将对象存在request中 2.响应void类型 可以看出,此时void方法执行了,系统默认会去找testVoid.jsp 意思 ...

  7. JAVA实现创建Excel表并导出(转发)

    <span style="font-family:Verdana, Arial, Helvetica, sans-serif;line-height:25.2px;background ...

  8. radis入门

    redis介绍 是远程的,有客户端.服务端 存内存,吃内存 应用场景 缓存 队列 list操作 push pop 数据存储[根据redis硬盘持久化的机制,这里不展开] 5种数据类型 string 字 ...

  9. 【00】angular学习网站

    [00]   学习资料:   http://angularjs.cn/   英文API:http://docs.angularjs.cn/api     中文API;http://www.apjs.n ...

  10. Uva10305 Ordering Tasks

    John有n个任务,但是有些任务需要在做完另外一些任务后才能做. 输入 输入有多组数据,每组数据第一行有两个整数1 <= n <= 100 和 m.n是任务个数(标记为1到n),m两个任务 ...