update script

This commit is contained in:
gbucchino 2025-12-23 08:58:57 +01:00
parent 0a12ae2d13
commit 07d222afd6

4
dlp.py

@ -1,6 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
from Cryptotools.Numbers.primeNumber import isPrimeNumber
from Cryptotools.Groups.cyclic import Cyclic from Cryptotools.Groups.cyclic import Cyclic
from math import log, ceil from math import log, ceil
@ -17,14 +16,11 @@ g = cyclic.getPrimitiveRoot()
print(f"g: {g}") print(f"g: {g}")
#secretKey = 3257
#secretKey = 134
secretKey = 4057 secretKey = 4057
publicKey = ope(g, secretKey, n) publicKey = ope(g, secretKey, n)
print(f"Public key: {publicKey}") print(f"Public key: {publicKey}")
# Now, we need to find the secret key based on the DLP # Now, we need to find the secret key based on the DLP
for x in range(1, n): for x in range(1, n):
l = log(x, g) l = log(x, g)