title: Finding private key in RSA
body: <p>I've been trying to figure out how to find the private key in the RSA equation with no luck.
  Given</p>
  <pre><code> p = 31
   q = 23
   e = 223
   phi = (p-1)(q-1)
        = 660
  </code></pre>
  <p>The equation (d*e mod phi = 1) results in;</p>
  <pre><code>e mod phi = 1/d
  </code></pre>
  <p>so</p>
  <pre><code> 223 mod 660 = 1/d
   223 = 1/d
   1/223 = d
  </code></pre>
  <p>but in this example they get d = 367, which I can't get. What am I doing wrong?</p>