title: Using RSA encryption, how can i find d
body: <p>I am using the euclidean algorithm when i have p = 163, q = 311 and e = 281. Here is what i have so far </p>
  
  <pre><code>N = p * q = 50693
  Totient Symbol(n) = 162 x 310 = 50220
  
  1.  50220 = 178(281) + 202     
  2.  281 = 1 (202) + 79               
  3.  202 = 2 (79) + 44
  4.  79 = 1 (44) + 35
  5.  44 = 1 (35) + 9
  6.  35 = 3 (9) + 8
  7.  9 = 1 (8) + 1
  8.  8 = 8 (1) + 0
  </code></pre>
  
  <p>I then move on to back substitution</p>
  
  <pre><code>A.  9 = 1 (8) + 1   === 1 = 9-1(8)
  B.  8 = 35 – 3(9)
  C.  1 = 1(9)-1(35-3(9))  - 
  D.  1 = 3(9) – 1(35) + 1(9)   add similar items
  E.  1 = 4(9) -1(35)
  
  9 = 44 – 1(35)
  1 = 4 (44-1(35)) – 1(35)
  1 = 4(44)-4(35)-1(35)
  
  1 = 4(44) – 5(35)
  </code></pre>
  
  <p>Take value next to 35 (5), subtract it from totient
  50220 – 5 = 50215
  d = 50215</p>
  
  <p>This is wrong as i used an online calc to verify . Can anyone point me in the right direction here, i think the back substituion is wrong</p>