Skip to content

Instantly share code, notes, and snippets.

@RDxR10
Last active March 15, 2021 11:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RDxR10/4882da5a1d7abeb5783aa1737ec3f3a2 to your computer and use it in GitHub Desktop.
Save RDxR10/4882da5a1d7abeb5783aa1737ec3f3a2 to your computer and use it in GitHub Desktop.
Diff hell
p = 69691
g = 1001
A = 17016
B = 47643
arr = []
arr1 = []
for a in range(1, p):
if pow(g, a, p) == A:
arr.append(a)
for b in range(1, p):
if pow(g, b, p) == B:
arr1.append(b)
a = arr[0]
b = arr1[0]
ka = int(pow(int(pow(g,b,p)),a,p))
kb = int(pow(int(pow(g,a,p)),b,p))
if(ka==kb):
print(ka|kb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment