模反元素 RSA Euler's totient function
https://baike.baidu.com/item/模反元素/20417595
如果两个正整数a和n互质,那么一定可以找到整数b,使得 ab-1 被n整除,或者说ab被n除的余数是1。这时,b就叫做a的“模反元素”
中文名 模反元素 外文名modulo multiplicative inverse 同义词 模逆元素


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 theory, Euler'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(n, k) 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的更多相关文章
- RSA算法原理与加密解密 求私钥等价求求模反元素 等价于分解出2个质数 (r*X+1)%[(p-1)(q-1)]=0
Rsapaper.pdf http://people.csail.mit.edu/rivest/Rsapaper.pdf [概述Abstract 1.将字符串按照双方约定的规则转化为小于n的正整数m, ...
- Euler's totient function
https://en.wikipedia.org/wiki/Euler's_totient_function counts the positive integers up to a given in ...
- 密码学之RSA基础
预备数论知识 互质关系 如果两个正整数,除了1以外,没有其他公因子,那么就称这两个数是互质关系 比如:4和7,13和61 欧拉函数 思考:任意给定整数n,在小于等于n的正整数中,有多少个数与n构成互质 ...
- RSA-演变过程、原理、特点(加解密及签名)及公钥私钥的生成
本篇是iOS逆向开发总结的第一篇文章,是关于iOS密码学的相关技术分析和总结,希望对大家有所帮助,如果有错误地方欢迎指正. 一.前言 密码学的历史追溯到2000年前,相传古罗马凯撒大帝为了防止敌方截获 ...
- [CTF] RSA共模攻击
from gmpy2 import * import libnum n = 0x00b0bee5e3e9e5a7e8d00b493355c618fc8c7d7d03b82e409951c182f398 ...
- URAL 1141. RSA Attack(欧拉定理+扩展欧几里得+快速幂模)
题目链接 题意 : 给你n,e,c,并且知道me ≡ c (mod n),而且n = p*q,pq都为素数. 思路 : 这道题的确与题目名字很相符,是个RSA算法,目前地球上最重要的加密算法.RSA算 ...
- RSA进阶之共模攻击
适用场景: 同一个n,对相同的m进行了加密,e取值不一样. e1和e2互质,gcd(e1,e2)=1 如果满足上述条件,那么就可以在不分解n的情况下求解m 原理 复杂的东西简单说: 如果gcd(e1, ...
- RSA的共模攻击
实验吧题目:http://www.shiyanbar.com/ctf/1834 参考:http://hebin.me/2017/09/07/%e8%a5%bf%e6%99%aectf-strength ...
- RSA共模攻击
在安恒月赛中碰到一道密码学方向的ctf题 附上源码 from flag import flag from Crypto.Util.number import * p=getPrime(1024) q= ...
随机推荐
- CommonJS初识
CommonJS是什么 CommonJS是一个标准库,或者说是一组规范.因为官方并没有给出真正的代码实现,而是给出一些代码组织规范.常用模块的api.包(Package)的命名规范和具体格式. Com ...
- 深入new/delete:Operator new的全局重载
Operator new 的全局重载 原文地址:http://blog.csdn.net/zhenjing/article/details/4354880 我们经常看到这么一句话: operator ...
- SQL Server 备份和还原数据库
备份: --完整备份 ) set @db_name = 'WSS_Content_Test'; ) set @db_location = 'D:\spbr0002\0000000B.bak'; --保 ...
- 基于JS实现发送短信验证码后的倒计时功能(无视页面刷新,页面关闭不进行倒计时功能)
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- ubuntu-12.04.5-desktop-amd64.iso:ubuntu-12.04.5-desktop-amd64:安装Oracle11gR2
ubuntu 桌面版的安装不介绍. 如何安装oracle:核心步骤和关键点. ln -sf /bin/bash /bin/sh ln -sf /usr/bin/basename /bin/basena ...
- OpenCV学习:改变图像的对比度和亮度
本实例演示简单地改变图像的对比度和亮度,使用了如下线性变换来实现像素值的遍历操作: The parameters α > 0 and β often called the gain and bi ...
- supervisorctl unix:///var/run/supervisor.sock refused connection
运行supervisorct 报如下错误 supervisorctl unix:///var/run/supervisor.sock refused connection 查看supervisord. ...
- Ext3.4--Gridpanel
Ext.onReady(function () { var sm = new Ext.grid.RowSelectionModel({singleSelect:true})//设置单选 //var s ...
- python2.0_s12_day9_事件驱动编程&异步IO
论事件驱动与异步IO 事件驱动编程是一种编程范式,这里程序的执行流由外部事件来决定.它的特点是包含一个事件循环,当外部事件发生时使用回调机制来触发相应的处理.另外两种常见的编程范式是(单线程)同步以及 ...
- Linux alias 命令
alias命令用于查看或设置命令别名,但仅作用于该次登陆的会话,若要永久使用别名,可在 ~/.bashrc 中设定别名 [root@localhost ~]$ alias // 查看别名 [root@ ...