{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw2sol - CS 170 Fall 2009 1(10 pts RSA Problem 1.42...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 170 Algorithms Fall 2009 Christos Papadimitriou HW 2 Solutions 1. (10 pts.) RSA Problem 1.42 Solution We know that p is a prime and gcd ( e , p - 1 ) = 1. Using the extended Euclidean algorithm find integers x , y such that xe + y ( p - 1 ) = 1. We then have that m xe + y ( p - 1 ) = m 1 ( mod p ) and using Fermat’s little theorem we get m xe = m ( mod p ) , i.e. ( m e ) x = m ( mod p ) . So the algorithm is as follows: Input: p , e , m e mod p Compute x , y such that xe + y ( p - 1 ) = 1 using extended euclidean algorithm (in Θ ( log ( p - 1 )) steps). Compute and output ( m e ) x mod p (in Θ ( log 3 p ) steps). The correctness of the algorithm follows from the previous discussion and its running time is Θ ( log 3 p ) , clearly polynomial. 2. (15 pts.) RSA Problem 1.43 Solution We first note that we must have 3 d = 1 ( mod ( p - 1 )( q - 1 )) or equivalently 3 d - 1 = k ( p - 1 )( q - 1 ) for some k Z ; we will try to find this k . First note that d < ( p - 1 )( q - 1 ) (since it is the inverse of 3 modulo ( p - 1 )( q - 1 ) ); hence kd < k ( p - 1 )( q - 1 ) = 3 d - 1 < 3 d k < 3. Moreover we have that k > 0 because 3 d - 1 > 0. So the only possible values for k are 1 and 2. Notice now that p 6 = 0 ( mod 3 ) (since p is prime) and p 6 = 1 ( mod 3 ) since 3 has an inverse modulo ( p - 1 )( q - 1 ) and therefore it has to be relatively prime to p - 1. So the only option left is p = 2 ( mod 3 ) . Likewise q = 2 ( mod 3 ) , so we have ( p - 1 )( q - 1 ) = 1 ( mod 3 ) . Suppose now that k = 1; then ( p - 1 )( q - 1 ) = 3 d - 1 = 2 ( mod 3 ) , a contradiction. Hence k = 2. So now we have two equations involving the two unknowns p , q , namely: 3 d - 1 = 2 ( p - 1 )( q - 1 ) and pq = N . We can now solve the first one to get p + q = N + 1 - 3 d - 1 2 , S and end up with two formulas of the form p + q = S and pq = N . We can now find p , q as the roots to the equation x 2 - Sx + N = 0. 3. (10 pts.) Attacking RSA Consider the RSA cryptosystem with N = pq , e , d as usual. Let x = m e ( mod N ) . An RSA-cycle for x is: x , x e , x e 2 , x e 3 ,..., x e t = x and t > 0 is the length of the cycle.
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern