Submit Search
Upload
introduce RSA
•
Download as PPTX, PDF
•
0 likes
•
335 views
S
SoL ymx
Follow
2017/03/23 - 台科大資安社-密碼學第一次社課
Read less
Read more
Technology
Report
Share
Report
Share
1 of 18
Download now
Recommended
RSA and Elliptic Curve Cryptography
RSA and Elliptic Curve Cryptography
Kevin Zhuang
Digital Signature
Digital Signature
nayakslideshare
11.第十一章用Matlab计算多元函数的积分
11.第十一章用Matlab计算多元函数的积分
Xin Zheng
06.第六章用Matlab计算二重积分
06.第六章用Matlab计算二重积分
Xin Zheng
12.第十二章用Matlab计算第二类积分
12.第十二章用Matlab计算第二类积分
Xin Zheng
05.第五章用Matlab计算积分
05.第五章用Matlab计算积分
Xin Zheng
Ch1
Ch1
Alisha Smile
Processing 03
Processing 03
信嘉 陳
Recommended
RSA and Elliptic Curve Cryptography
RSA and Elliptic Curve Cryptography
Kevin Zhuang
Digital Signature
Digital Signature
nayakslideshare
11.第十一章用Matlab计算多元函数的积分
11.第十一章用Matlab计算多元函数的积分
Xin Zheng
06.第六章用Matlab计算二重积分
06.第六章用Matlab计算二重积分
Xin Zheng
12.第十二章用Matlab计算第二类积分
12.第十二章用Matlab计算第二类积分
Xin Zheng
05.第五章用Matlab计算积分
05.第五章用Matlab计算积分
Xin Zheng
Ch1
Ch1
Alisha Smile
Processing 03
Processing 03
信嘉 陳
C++基礎程式設計 Zero judge介紹
C++基礎程式設計 Zero judge介紹
requiemformemories
Part 6 2010
Part 6 2010
guestc217c202
Python differential equation
Python differential equation
hungchiayang1
Processing 04
Processing 04
信嘉 陳
01.第一章用Matlab求极限
01.第一章用Matlab求极限
Xin Zheng
09.第九章用Matlab求二元泰勒展开式
09.第九章用Matlab求二元泰勒展开式
Xin Zheng
02.第二章用Matlab求导
02.第二章用Matlab求导
Xin Zheng
Ch11 範例
Ch11 範例
hungchiayang1
Ppt 167-173
Ppt 167-173
hungchiayang1
07.第七章用Matlab解常微分方程
07.第七章用Matlab解常微分方程
Xin Zheng
香港六合彩
香港六合彩
deygsi
香港六合彩
香港六合彩
香港六合彩 香港六合彩
Fux8923
Fux8923
香港六合彩 香港六合彩
Ch9 範例
Ch9 範例
hungchiayang1
Pairing for beginneer
Pairing for beginneer
National Chengchi University
Processing 09
Processing 09
信嘉 陳
Ch3 教學
Ch3 教學
hungchiayang1
Func diff cal_exercise2-3
Func diff cal_exercise2-3
Alisha Smile
P127 135 new
P127 135 new
hungchiayang1
Ch4 習題
Ch4 習題
hungchiayang1
More Related Content
What's hot
C++基礎程式設計 Zero judge介紹
C++基礎程式設計 Zero judge介紹
requiemformemories
Part 6 2010
Part 6 2010
guestc217c202
Python differential equation
Python differential equation
hungchiayang1
Processing 04
Processing 04
信嘉 陳
01.第一章用Matlab求极限
01.第一章用Matlab求极限
Xin Zheng
09.第九章用Matlab求二元泰勒展开式
09.第九章用Matlab求二元泰勒展开式
Xin Zheng
02.第二章用Matlab求导
02.第二章用Matlab求导
Xin Zheng
Ch11 範例
Ch11 範例
hungchiayang1
Ppt 167-173
Ppt 167-173
hungchiayang1
07.第七章用Matlab解常微分方程
07.第七章用Matlab解常微分方程
Xin Zheng
香港六合彩
香港六合彩
deygsi
香港六合彩
香港六合彩
香港六合彩 香港六合彩
Fux8923
Fux8923
香港六合彩 香港六合彩
Ch9 範例
Ch9 範例
hungchiayang1
Pairing for beginneer
Pairing for beginneer
National Chengchi University
Processing 09
Processing 09
信嘉 陳
Ch3 教學
Ch3 教學
hungchiayang1
Func diff cal_exercise2-3
Func diff cal_exercise2-3
Alisha Smile
P127 135 new
P127 135 new
hungchiayang1
Ch4 習題
Ch4 習題
hungchiayang1
What's hot
(20)
C++基礎程式設計 Zero judge介紹
C++基礎程式設計 Zero judge介紹
Part 6 2010
Part 6 2010
Python differential equation
Python differential equation
Processing 04
Processing 04
01.第一章用Matlab求极限
01.第一章用Matlab求极限
09.第九章用Matlab求二元泰勒展开式
09.第九章用Matlab求二元泰勒展开式
02.第二章用Matlab求导
02.第二章用Matlab求导
Ch11 範例
Ch11 範例
Ppt 167-173
Ppt 167-173
07.第七章用Matlab解常微分方程
07.第七章用Matlab解常微分方程
香港六合彩
香港六合彩
香港六合彩
香港六合彩
Fux8923
Fux8923
Ch9 範例
Ch9 範例
Pairing for beginneer
Pairing for beginneer
Processing 09
Processing 09
Ch3 教學
Ch3 教學
Func diff cal_exercise2-3
Func diff cal_exercise2-3
P127 135 new
P127 135 new
Ch4 習題
Ch4 習題
introduce RSA
1.
RSA 台科大資安研究社_楊明軒
2.
題外話時間…
3.
string integer •NTUST •336422327124 •0x4e54555354
4.
mod / 模數 •7
/ 4 = 1 … 3 •7 mod 4 = 3 •11 / 3 = 3 .. 2 •11 mod 3 = 2
5.
同餘 ≡ •≡ 表示同餘相等 •37
≡ 13 (mod24) •37 mod 24 = 13 •41 ≡ 17 (mod24) •41 mod 24 = 17
6.
回來看 RSA …
7.
RSA • 非對稱式/公開金鑰加密法 • 使用最廣的公開金鑰加密法 •
大數分解很難 • 量子電腦 / shor algorithm
8.
Euler φ function •若n為自然數 定義φ(n)為不大於n且與n互質的自然數的個數 •φ(5)
= |{1 , 2 , 3 , 4}| = 4 •φ(6) = |{1,5}| = 2 •if p is prime , φ(p) = p-1 •gcd(p,q) = 1 , φ(pq) = φ(p) * φ(q)
9.
Euler's theorem •如果 a
& m 是整數且 gcd(a,m) = 1 a^φ(m) ≡ 1 (mod m)
10.
模逆/mod inverse • Find
x that a*x ≡ 1 (mod n) • n 小可以直接求 • 費碼小定理/Fermat's little theorem • 𝑎 𝑛−1 ≡ 1 (mod n) • 𝑎−1 ≡ 𝑎 𝑛−2 (mod n) • 擴展歐幾里得算法/輾轉相除法/Extended Euclidean algorithm • 算 gcd : • GCD(A,B) = GCD(B,A mod B) • ax + ny = 1 , find x and y
11.
模逆 in python •
RSA 中,用來求 d
12.
RSA 產生 KEY
過程 1. 選 p , q (prime) 2. 算 n , n = p*q 3. 算 ∅(n) = (p - 1)*( q - 1) << p 不等於 q 4. 選e , 1 < e < ∅(n) , 滿足 gcd(∅(n) , e) = 1 5. 算 d , d 是 e 在 mod ∅(n) 下的乘法反元素 d ≡ ⅇ−1 ( mod ∅(n) ) public key: ( e , n ) private key: ( d )
13.
RSA 加解密 明文需小於 n •加密:
E(m) = m^e mod n •解密: D(c) = c^d mod n
14.
Crack RSA !?(in
CTF) • 可否分解 N ? • 無法分解 N ,那可否直接算出 ∅(n) ? • 無法分解 N 也無法直接算出 ∅(n) ,那可否直接求 d ? • 都無法怎辦 ?...
15.
Tool • Website • Factordb.com •
Tool • Sage • http://www.sagemath.org/ • Yafu • General Number Field Sieve , GNFS • http://sourceforge.net/projects/yafu/files/latest/download • rsatool • rsatool.py -p xxx -q xxx -o private.key • https://goo.gl/h9fGki
16.
Tool • Python Library •
sympy • gmpy2 • libnum • https://github.com/hellman/libnum
17.
RSA 潛在風險 RSA 潛在風險 分解因數 選擇密文 加密指數 廣播 相關訊息 short pad 解密指數 洩漏 低指數 明文 模數
共模攻擊 實作 p、q reuse
18.
RSA 入門練習 •練習: ice
ctf 2016 RSA https://goo.gl/dMRXQj •練習: ice ctf 2016 RSA? https://goo.gl/Vph7le •練習: ice ctf 2016 RSA2 https://goo.gl/BcHJSD
Editor's Notes
https://goo.gl/8UaNUy
7^484 mod 10 = ?
from Crypto.Util.number import *print long_to_bytes(pow(c,d,N))
交大腳本 https://goo.gl/cnmEE4
Download now