11.07.2014 Views

Cryptanalysis of RSA Factorization - Library(ISI Kolkata) - Indian ...

Cryptanalysis of RSA Factorization - Library(ISI Kolkata) - Indian ...

Cryptanalysis of RSA Factorization - Library(ISI Kolkata) - Indian ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

17 2.2 <strong>RSA</strong> Cryptosystem<br />

istic primality test called the AKS algorithm. The time complexity <strong>of</strong> AKS was<br />

<strong>of</strong> O(lp<br />

12+ǫ ), and in 2005, Pomerance and Lenstra [101] improved the time complexity<br />

up to O(lp 6+ǫ ). However, Miller-Rabin algorithm is much faster than AKS<br />

in practice and hence it is the one used in the implementation <strong>of</strong> <strong>RSA</strong>. A formal<br />

description <strong>of</strong> the Miller-Rabin test is presented in Algorithm 2.<br />

1<br />

2<br />

3<br />

4<br />

5<br />

6<br />

7<br />

8<br />

9<br />

10<br />

11<br />

Input: n > 3, an odd integer to be tested for primality<br />

Output: ‘composite’ if n is composite, otherwise ‘probably prime’<br />

Write n−1 = 2 s ·d with d odd;<br />

Pick random a ∈ [1,n−1];<br />

Set x ← a d mod n;<br />

if x = 1 then<br />

Return (‘probably prime’);<br />

end<br />

for i = 0 to s−1 do<br />

if x ≡ −1 (mod n) then<br />

Return (‘probably prime’);<br />

end<br />

else<br />

x ← x 2 mod n;<br />

end<br />

end<br />

Return (‘composite’);<br />

Algorithm 2: Miller-Rabin Primality Test [126].<br />

Product <strong>of</strong> Two Integers<br />

Multiplication is fast. Even if one uses a trivial schoolbook multiplication algorithm<br />

to find N and φ(N) in Step 2 <strong>of</strong> Algorithm 1, it can be done in polynomial<br />

number (l p ×l q = O(l 2 p), as l p ≈ l q ) <strong>of</strong> single digit multiplications. However, with<br />

large sized integers like p and q, it may be useful to try the Karatsuba multiplication<br />

algorithm [87], which reduces the complexity to 3·l log 2<br />

p 3 ≈ 3·lp<br />

1.585 number <strong>of</strong><br />

single digit multiplications.<br />

Extended Euclidean Algorithm (EEA)<br />

In Step 3 <strong>of</strong> Algorithm 1, we choose random integers e and test if gcd(e,φ(N)) = 1.<br />

To find the GCD, one can use the Euclidean algorithm as follows.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!