1 Replies - 1421 Views - Last Post: 28 February 2015 - 08:12 PM

#1 wtp   User is offline

  • D.I.C Regular

Reputation: 28
  • View blog
  • Posts: 338
  • Joined: 08-December 11

Given: e,n Solve for d; d*e mod n = 1

Posted 28 February 2015 - 04:55 PM

Given: e,n
Solve for d

d*e mod n = 1

ex d * 21 mod 28 = 1

How do I solve this type of problem? I know how to solve power mods like 4^723 mod 13, but I'm not sure about this one. Hope someone can point me in the right direction.
Is This A Good Question/Topic? 0
  • +

Replies To: Given: e,n Solve for d; d*e mod n = 1

#2 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12800
  • View blog
  • Posts: 45,992
  • Joined: 27-December 08

Re: Given: e,n Solve for d; d*e mod n = 1

Posted 28 February 2015 - 08:12 PM

By the way, you should be writing it as: de ≡ 1 (mod n).

You solve through the Extended Euclidean Algorithm to find gcd(21, 28), then work backwards. Note that a solution d exists if and only if gcd(21, 28) = 1.

If you've talked about reducing the exponent by the modulus, you may be familiar with Euler's Totient (phi) function. It counts the number of coprime congruence classes for a given modulus.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1