Submit Search
introduce RSA
Download as PPTX, PDF
0 likes
350 views
AI-enhanced description
S
SoL ymx
文档介绍RSA非对称式/公开金钥加密法的基本原理,包括模数运算、欧拉函数、加密和解密过程以及潜在风险。详细描述了如何生成公钥和私钥,以及常用工具和算法。还提供了一些相关的练习链接用于加深理解。
Technology
Read more
1 of 18
Download now
Download to read offline
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
More Related Content
PPTX
RSA and Elliptic Curve Cryptography
Kevin Zhuang
PPT
Digital Signature
nayakslideshare
DOC
11.第十一章用Matlab计算多元函数的积分
Xin Zheng
DOC
06.第六章用Matlab计算二重积分
Xin Zheng
DOC
12.第十二章用Matlab计算第二类积分
Xin Zheng
DOC
05.第五章用Matlab计算积分
Xin Zheng
PDF
Ch1
Alisha Smile
PDF
Processing 03
信嘉 陳
RSA and Elliptic Curve Cryptography
Kevin Zhuang
Digital Signature
nayakslideshare
11.第十一章用Matlab计算多元函数的积分
Xin Zheng
06.第六章用Matlab计算二重积分
Xin Zheng
12.第十二章用Matlab计算第二类积分
Xin Zheng
05.第五章用Matlab计算积分
Xin Zheng
Ch1
Alisha Smile
Processing 03
信嘉 陳
What's hot
(20)
PPTX
C++基礎程式設計 Zero judge介紹
requiemformemories
PDF
Part 6 2010
guestc217c202
PDF
Python differential equation
hungchiayang1
PDF
Processing 04
信嘉 陳
DOC
01.第一章用Matlab求极限
Xin Zheng
DOC
09.第九章用Matlab求二元泰勒展开式
Xin Zheng
DOC
02.第二章用Matlab求导
Xin Zheng
PDF
Ch11 範例
hungchiayang1
PDF
Ppt 167-173
hungchiayang1
DOC
07.第七章用Matlab解常微分方程
Xin Zheng
PPT
香港六合彩
deygsi
PPT
香港六合彩
香港六合彩 香港六合彩
PPT
Fux8923
香港六合彩 香港六合彩
PDF
Ch9 範例
hungchiayang1
PDF
Pairing for beginneer
National Chengchi University
PDF
Processing 09
信嘉 陳
PDF
Ch3 教學
hungchiayang1
PDF
Func diff cal_exercise2-3
Alisha Smile
PPT
P127 135 new
hungchiayang1
PDF
Ch4 習題
hungchiayang1
C++基礎程式設計 Zero judge介紹
requiemformemories
Part 6 2010
guestc217c202
Python differential equation
hungchiayang1
Processing 04
信嘉 陳
01.第一章用Matlab求极限
Xin Zheng
09.第九章用Matlab求二元泰勒展开式
Xin Zheng
02.第二章用Matlab求导
Xin Zheng
Ch11 範例
hungchiayang1
Ppt 167-173
hungchiayang1
07.第七章用Matlab解常微分方程
Xin Zheng
香港六合彩
deygsi
香港六合彩
香港六合彩 香港六合彩
Fux8923
香港六合彩 香港六合彩
Ch9 範例
hungchiayang1
Pairing for beginneer
National Chengchi University
Processing 09
信嘉 陳
Ch3 教學
hungchiayang1
Func diff cal_exercise2-3
Alisha Smile
P127 135 new
hungchiayang1
Ch4 習題
hungchiayang1
Ad
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
#2:
https://goo.gl/8UaNUy
#10:
7^484 mod 10 = ?
#14:
from Crypto.Util.number import *print long_to_bytes(pow(c,d,N))
#16:
交大腳本 https://goo.gl/cnmEE4
Download