Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. import gmpy2
  2. p = 37695552863496519102529529237697236356564761462473034817143171507539505592876823
  3. q = 30688846506122145447167547376484001727943229468821365234314074958567173261717459
  4. e = 65537
  5. ct = 702196327672191685253299526552309507814646151700468483066037883331403163906310208217704733952374496441174033743111419784917700211883237349333860965241110698581
  6.  
  7. t = (p-1)*(q-1)
  8. n = p*q
  9.  
  10. # returns d such that e * d == 1 modulo t, or 0 if no such y exists.
  11. d = gmpy2.invert(e,t)
  12.  
  13. # Decryption
  14. m = pow(ct,d,n)
  15. print "Solved ! m = %d" % m
  16. print hex(m)[2:].decode('hex')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement