Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import gmpy2
- p = 37695552863496519102529529237697236356564761462473034817143171507539505592876823
- q = 30688846506122145447167547376484001727943229468821365234314074958567173261717459
- e = 65537
- ct = 702196327672191685253299526552309507814646151700468483066037883331403163906310208217704733952374496441174033743111419784917700211883237349333860965241110698581
- t = (p-1)*(q-1)
- n = p*q
- # returns d such that e * d == 1 modulo t, or 0 if no such y exists.
- d = gmpy2.invert(e,t)
- # Decryption
- m = pow(ct,d,n)
- print "Solved ! m = %d" % m
- print hex(m)[2:].decode('hex')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement