Project Euler #182: RSA encryption

Sort by

recency

|

10 Discussions

|

  • + 0 comments

    This can be solved via evalutaing arithemtic sums using inclusion/exclusion principle. We have to handle special case where there are no odd prime factors in phi. The most challenging part is derive conditions for candidates e and properly evaluate sums using inclusion/exlcusion principle.

  • + 0 comments

    This problem can be transformed into a problem of evaluating sums of the form

    over a system of linear congruences
    where
    are distinct prime factors of the Carmichael totient , and subsequently adding up the sums using the inclusion-exclusion principle based on the number of equations chosen in each system. The value of depends on . This algorithm can be derived from the constraint
    and the observation that
    when the number of unconcealed messages for is minimum. Ergo, this algorithm is equivalent to summing up all potential candidates for and then subtracting those candidates that fail to meet the constraints. The prime factorization for large numbers in the ballpark of
    can be computed rapidly using the Pollard's rho algorithm. Some care is needed to prevent loss of precision while dividing big numbers in Pollard's algorithm. Each system of linear congruences can be solved via the Chinese remainder theorem.

  • + 0 comments

    Those two pages shall help: https://en.wikipedia.org/wiki/Chinese_remainder_theorem https://math.stackexchange.com/questions/58373/rsa-unconcealed-messages

  • + 0 comments

    Can anyone give a hint to the next step? I observed that the minimum sum is always 9. So I have to find e such that 1. gcd(e, t) == 1 2. gcd(e-1, p-1) == 2 3. gcd(e-1, q-1) == 2

  • + 0 comments

    Terminated due to timeout after 7 Testcases? Any hints?