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. Javascript 严格模式 strict mode(转)

    一.概述 除了正常运行模式,ECMAscript 5添加了第二种运行模式:"严格模式"(strict mode).顾名思义,这种模式使得Javascript在更严格的条件下运行. ...

  2. react新手入门(序)

    之前在软件园使用的是react,当时为了做个集光推送,自己去搭过react,这次项目中继续使用react,于是又重新操作了遍,恰巧公司买了本react的书籍,这本书写的非常好,看着并不觉得拗口,很容易 ...

  3. JavaStuNote 5

    接口 (interface) 一个抽象类,全部的方法都是抽象的,全部方法的public, 我们把这种类叫做极度抽象类,是最干瘪的类. public abstract class A { public  ...

  4. 2.1 C语言下的位运算

    位运算符: 注:运算量仅仅能为整型和字符型数据,不能是实数型的数据. 当进行&运算时:0&1=0.1&0=0:1&1=1:0&0=0: 当进行|运算时:0|1= ...

  5. mybatis由浅入深day02_7.4mybatis整合ehcache_7.5二级缓存应用场景_7.6二级缓存局限性

    7.4 mybatis整合ehcache EhCache 是一个纯Java的进程内缓存框架,是一种广泛使用的开源Java分布式缓存,具有快速.精干等特点,是Hibernate中默认的CacheProv ...

  6. swift - UIDatePicker 的用法

    1.初始化button,datepicker,label等控件,初始化时间格式化器     var datePicker = UIDatePicker()    var btnShows = UIBu ...

  7. RIDE指定log和report的输出目录

    在命令行中,输入 pybot --help就可以看到他支持的所以命令和相关的介绍 我们可以看到outputdir这个命令,就是来知道report和log的输出目录的 如果你是在命令行中,那么直接后面跟 ...

  8. unable to execute dex:GC overhead limit exceeded unable to execute dex:java heap space 解决方案

    最近做厂商适配,厂商提供了一部分Framework的jar包,把jar包通过Add Jar放到Build Path中, 在生成APK过程中,Eclipse长时间停留在100%那个进度. 最后Eclip ...

  9. nutch爬取时Exception in thread “main” java.io.IOException: Job failed!

    用cygwin运行nutch 1.2爬取提示IOException: $ bin/nutch crawl urls -dir crawl -depth 3 -topN 10 crawl started ...

  10. js里面声明变量时候的注意事项

    变量名可以是中文,只能有下划线,$,数字和字母组成,开头只能以下划线(不建议使用)和字母开头.