Skip to content

Instantly share code, notes, and snippets.

@CCCougar
Created December 23, 2021 09:36
Show Gist options
  • Save CCCougar/6145d4e828b4f12faf53c31b3d5af314 to your computer and use it in GitHub Desktop.
Save CCCougar/6145d4e828b4f12faf53c31b3d5af314 to your computer and use it in GitHub Desktop.
获得大量RSA公私钥对
# 获得所有e,d公私钥匙对
from Crypto.Util.number import GCD
p = 206373637029902328657596154026109496537
q = 230573583664314101337547147157742312101
N = p * q
phi = (p - 1) * (q - 1)
# group = {}
for test_e in range(1, phi):
if GCD(test_e, phi) == 1:
test_d = pow(test_e, -1, phi)
print("e:", test_e, "d:", test_d)
# group[test_e] = test_d
# print(group)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment