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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

Afterfindinganewhichisrelativelyprimetoφ(N), oneneedst<strong>of</strong>inditsinverse<br />

modulo φ(N) in Step 4 <strong>of</strong> the algorithm. That is, one needs to find an integer<br />

d such that ed ≡ 1 (mod φ(N)). For that one can use the Extended Euclidean<br />

algorithm, as presented in Algorithm 4. The time complexity <strong>of</strong> this algorithm is<br />

the same as that <strong>of</strong> the Euclidean algorithm, i.e, O(l 2 N ) for a,b with bitlength l N.<br />

1<br />

2<br />

3<br />

4<br />

5<br />

6<br />

7<br />

8<br />

9<br />

10<br />

11<br />

12<br />

13<br />

14<br />

15<br />

Input: Two positive integers a,b<br />

Output: r,s,t with r = sa+tb where r = gcd(a,b)<br />

Initialize a 0 = a,b 0 = b,t 0 = 0,t = 1,s 0 = 1,s = 0;<br />

q = ⌊ a 0<br />

b 0<br />

⌋;<br />

r = a 0 −qb 0 ;<br />

while r > 0 do<br />

t 1 = t 0 −qt;<br />

t 0 = t;<br />

t = t 1 ;<br />

t 1 = s 0 −qs;<br />

s 0 = s;<br />

a 0 = b 0 ;<br />

b 0 = r;<br />

q = ⌊ a 0<br />

b 0<br />

⌋;<br />

r = a 0 −qb 0 ;<br />

end<br />

r = b 0 ;<br />

return r,s,t.<br />

Algorithm 4: The Extended Euclidean Algorithm [126].<br />

Square and Multiply Algorithm<br />

For Steps 5 and 6 in Algorithm 1, one has to perform modular exponentiations.<br />

For this purpose, one may use the Square and Multiply Algorithm [126]. The<br />

time complexity <strong>of</strong> a single modular exponentiation x y mod N using the square<br />

and multiply algorithm is O(l y lN 2 ), which is O(l3 N ) as the exponents e,d are both<br />

less than N. For a quick reference, we present the famous square and multiply<br />

algorithm for modular exponentiation in Algorithm 5.

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

Saved successfully!

Ooh no, something went wrong!