https://baike.baidu.com/item/模反元素/20417595

如果两个正整数a和n互质,那么一定可以找到整数b,使得 ab-1 被n整除,或者说ab被n除的余数是1。这时,b就叫做a的“模反元素”

中文名 模反元素 外文名modulo multiplicative inverse 同义词 模逆元素

如果两个正整数a和n互质,那么一定可以找到整数b,使得 ab-1 被n整除,或者说ab被n除的余数是1。
这时,b就叫做a对模数n的“模反元素”。比如,3和11互质,那么3的模反元素就是4,因为 (3 × 4)-1 可以被11整除。显然,模反元素不止一个, 4加减11的整数倍都是3的模反元素 {…,-18,-7,4,15,26,…},即如果b是a的模反元素,则 b+kn 都是a的模反元素。
欧拉定理可以用来证明模反元素必然存在。
可以看到,a的 φ(n)-1 次方,就是a对模数n的模反元素。
 
 RSA (cryptosystem) - Wikipedia https://en.wikipedia.org/wiki/RSA_(cryptosystem)
 
算法4步骤

The RSA algorithm involves four steps: key generation, key distribution, encryption and decryption.

Euler's totient function - Wikipedia https://en.wikipedia.org/wiki/Euler%27s_totient_function

 

The first thousand values of φ(n). The points on the top line represent φ(p) when p is a prime number, which is p − 1.[1]

In number theoryEuler's totient function counts the positive integers up to a given integer n that are relatively prime to n. It is written using the Greek letter phi as φ(n) or ϕ(n), and may also be called Euler's phi function. It can be defined more formally as the number of integers k in the range 1 ≤ k ≤ n for which the greatest common divisor gcd(nk) is equal to 1.[2][3] The integers k of this form are sometimes referred to as totatives of n.

For example, the totatives of n = 9 are the six numbers 1, 2, 4, 5, 7 and 8. They are all relatively prime to 9, but the other three numbers in this range, 3, 6, and 9 are not, because gcd(9, 3) = gcd(9, 6) = 3 and gcd(9, 9) = 9. Therefore, φ(9) = 6. As another example, φ(1) = 1 since for n = 1 the only integer in the range from 1 to n is 1 itself, and gcd(1, 1) = 1.

Euler's totient function is a multiplicative function, meaning that if two numbers m and n are relatively prime, then φ(mn) = φ(m)φ(n).[4][5] This function gives the order of the multiplicative group of integers modulo n (the group of units of the ring /n).[6] It also plays a key role in the definition of the RSA encryption system.

1>
phi函数
phi(N)为小于正整数N的与N互质的正整数的个数
phi(10)=4
2>
欧拉定理
m(a^phi(n),n)=1
3>
应用
m(7^phi(10),10)=1
==>m(7^4,10)=1
7^222=(7^4)^55*7^2
==>m(7^222,10)=m(1^55,10)*m(7^2,10)=9

Carmichael number - Wikipedia https://en.wikipedia.org/wiki/Carmichael_number

In number theory, a Carmichael number is a composite number   which satisfies the modular arithmetic congruence relation:

561=3*11*17
m(561-1,3-1)=m(561-1,11-1)=m(561-1,17-1)
1105=5*13*17
m(1105-1,5-1)=m(1105-1,13-1)=m(1105-1,17-1)

In number theory, the Carmichael function associates to every positive integer n a positive integer , defined as the smallest positive integer m such that

  for every integer a between 1 and n that is coprime to n.

https://baike.baidu.com/item/欧拉函数/1944850?fr=aladdin

欧拉函数

数论,对正整数n,欧拉函数是小于n的正整数中与n互质的数的数目(φ(1)=1)。此函数以其首名研究者欧拉命名(Euler's totient function),它又称为Euler's totient function、φ函数、欧拉商数等。 例如φ(8)=4,因为1,3,5,7均和8互质。 从欧拉函数引伸出来在环论方面的事实和拉格朗日定理构成了欧拉定理的证明。

 

模反元素 RSA Euler's totient function的更多相关文章

  1. RSA算法原理与加密解密 求私钥等价求求模反元素 等价于分解出2个质数 (r*X+1)%[(p-1)(q-1)]=0

    Rsapaper.pdf http://people.csail.mit.edu/rivest/Rsapaper.pdf [概述Abstract 1.将字符串按照双方约定的规则转化为小于n的正整数m, ...

  2. Euler's totient function

    https://en.wikipedia.org/wiki/Euler's_totient_function counts the positive integers up to a given in ...

  3. 密码学之RSA基础

    预备数论知识 互质关系 如果两个正整数,除了1以外,没有其他公因子,那么就称这两个数是互质关系 比如:4和7,13和61 欧拉函数 思考:任意给定整数n,在小于等于n的正整数中,有多少个数与n构成互质 ...

  4. RSA-演变过程、原理、特点(加解密及签名)及公钥私钥的生成

    本篇是iOS逆向开发总结的第一篇文章,是关于iOS密码学的相关技术分析和总结,希望对大家有所帮助,如果有错误地方欢迎指正. 一.前言 密码学的历史追溯到2000年前,相传古罗马凯撒大帝为了防止敌方截获 ...

  5. [CTF] RSA共模攻击

    from gmpy2 import * import libnum n = 0x00b0bee5e3e9e5a7e8d00b493355c618fc8c7d7d03b82e409951c182f398 ...

  6. URAL 1141. RSA Attack(欧拉定理+扩展欧几里得+快速幂模)

    题目链接 题意 : 给你n,e,c,并且知道me ≡ c (mod n),而且n = p*q,pq都为素数. 思路 : 这道题的确与题目名字很相符,是个RSA算法,目前地球上最重要的加密算法.RSA算 ...

  7. RSA进阶之共模攻击

    适用场景: 同一个n,对相同的m进行了加密,e取值不一样. e1和e2互质,gcd(e1,e2)=1 如果满足上述条件,那么就可以在不分解n的情况下求解m 原理 复杂的东西简单说: 如果gcd(e1, ...

  8. RSA的共模攻击

    实验吧题目:http://www.shiyanbar.com/ctf/1834 参考:http://hebin.me/2017/09/07/%e8%a5%bf%e6%99%aectf-strength ...

  9. RSA共模攻击

    在安恒月赛中碰到一道密码学方向的ctf题 附上源码 from flag import flag from Crypto.Util.number import * p=getPrime(1024) q= ...

随机推荐

  1. bootstrap -- css -- 文字、列表

    文字 <small></small>:呈现小号字体效果. <big></big>:程序大号字体效果 <abbr></abbr>: ...

  2. websocke前世今生

    注:以下内容来自网上.本人经过加工整理. 1.问什么要用websocke? Browser已经支持http协议,为什么还要开发一种新的WebSocket协议呢?我们知道http协议是一种单向的网络协议 ...

  3. 【Java面试题】9 abstract class和interface有什么区别?

    含有abstract修饰符的class即为抽象类,abstract 类不能创建的实例对象.含有abstract方法的类必须定义为abstract class,abstract class类中的方法不必 ...

  4. VS2008 Output窗口自动滚动

    Output窗口默认是自动滚动的,活动光标始终处于最后一行. 但是有时候因为某些操作可能导致Output窗口的自动滚动停止. 如何恢复自动滚动呢? 使用快捷键操作即可:Ctrl + End

  5. mysql的引擎myisam和innodb的区别

    1. MYISAM和INNODB的不同?答:主要有以下几点区别:   a)构造上的区别     MyISAM在磁盘上存储成三个文件,其中.frm文件存储表定义:.MYD (MYData)为数据文件:. ...

  6. web.xml 中的listener、filter、servlet 加载顺序及其【配置详解】

    在项目中总会遇到一些关于加载的优先级问题,近期也同样遇到过类似的,所以自己查找资料总结了下,下面有些是转载其他人的,毕竟人家写的不错,自己也就不重复造轮子了,只是略加点了自己的修饰. 首先可以肯定的是 ...

  7. Java精选笔记_Java编程基础

    Java的基本语法 Java代码的基本格式 修饰符 class 类名 {   程序代码 } 一个Java源文件只定义一个类,不同的类使用不同的源文件定义:将每个源文件中单独定义的类都定义成public ...

  8. Python 数据类型:列表

    一.列表介绍 1. 列表可以存储一系列的值,使用中括号来定义,每个元素之间用逗号隔开,形如 ['a', 'b', 'c', 'd']2. 列表与元组的区别是:列表中的元素是可变的,元组中的元素是不可变 ...

  9. C++11新特性之九——function、bind以及lamda表达式总结

    本文是C++0x系列的第四篇,主要是内容是C++0x中新增的lambda表达式, function对象和bind机制.之所以把这三块放在一起讲,是因为这三块之间有着非常密切的关系,通过对比学习,加深对 ...

  10. Spring AOP教程及实例

    1.教程转载==>>:http://blog.csdn.net/wangpeng047/article/details/8556800 2.实例转载==>>:http://bl ...