RSA 256Bit Known p q e Decrypt

import math
import sys
from Crypto.PublicKey import RSA
keypair = RSA.generate(1024)
keypair.p =
keypair.q =
keypair.e =
keypair.n = keypair.p * keypair.q
Qn = long((keypair.p-1) * (keypair.q-1))
i = 1
while (True):
x = (Qn * i ) + 1
if (x % keypair.e == 0):
keypair.d = x / keypair.e
break
i += 1
private = open('private.pem','w')
private.write(keypair.exportKey())
private.close()

吾爱博客|AYFRE.COM 版权所有,转载请标明出处
吾爱博客 » RSA 256Bit Known p q e Decrypt

发表评论

吾爱博客|AYFRE.COM