c ≡ me mod N, m ≡ cd mod N
N = pq (p, q are prime numbers) / d ≡ e−1 (mod λ(n))
e, N: Public Key, d: Private Key
1-1. Improper Selection of p, q - Large
1-2. Improper Selection of p, q - Small (Fermat Factorization)
2. Pollard's p-1 Algorithm
다음과 같은 수
1. Smoothness bound
2.
3.
4-1.
4-2.
4-3.
3. Williams' p+1 Algorithm
Pollard's p-1 Algorithm의 변형 알고리즘이며,
1. 2보다 큰 자연수 A로 아래와 같은 Lucas sequence를 정의한다.
2.
t로 구성되는 수열의
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
from sage.all import *
p = random_prime(512, proof=False)
q = random_prime(512, proof=False)
N = p*q
A = 5
x = A
y = (A^2-2)%N
M = factorial(7)
for b in M.bits()[-2::-1] :
if b == 1 :
x = (x*y-A)%N
y = (y^2-2)%N
else :
y = (x*y-A)%N
x = (x^2-2)%N
V = x
|
4. Common Factors in Public Keys
여러 개의 공개키가 주어질 때, 공개키들 사이에 1이 아닌 공약수가 있다면
5. Miller-Rabin Primality Test
이 알고리즘은 어떤 수가 소수인지 판별하기 위한 알고리즘이지만,
어떤 수
이 때
6. Common Modulus Attack
Modulus 값이 같은 두 공개키로 두 평문을 암호화하면 원문을 복구할 수도 있다.
한 평문
7. Small e (e=3 Representatively)
8. Wiener's Attack
증명과 알고리즘은 나중에 추가예정
9.
Reference
ctf-wiki
https://ctf-wiki.github.io/ctf-wiki/crypto/asymmetric/rsa/rsa_module_attack-zh/
https://ctf-wiki.github.io/ctf-wiki/crypto/asymmetric/rsa/rsa_e_attack-zh/
https://ctf-wiki.github.io/ctf-wiki/crypto/asymmetric/rsa/rsa_d_attack-zh/
Wikipedia
https://en.wikipedia.org/wiki/Pollard%27s_p_%E2%88%92_1_algorithm
https://en.wikipedia.org/wiki/Williams%27s_p_%2B_1_algorithm
https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test