Add Elliptic Curve Cryptography

This commit is contained in:
gbucchino
2026-02-18 12:32:05 +01:00
parent be5f872019
commit 16efeaec2d
4 changed files with 645 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
#!/usr/bin/env python3
import matplotlib.pyplot as plt
from Cryptotools.Groups.elliptic import Point, Elliptic
a = 3
b = 8
n = 89 # Must be prime number
E = Elliptic(n, a, b)
E.quadraticResidues()
Ep = E.pointsE()
#print(E.getQuadraticResidues())
# For the graphic
MAX=n
fig, ax = plt.subplots()
ax.legend(fontsize=14)
ax.grid()
# We generate x for the graphic
x = list()
x = [i for i in range(0, MAX)]
# Drawing the point.
for p in Ep:
ax.plot(p.x, p.y, 'bo')
# Draw a line for the symmetry
plt.axline([0, 45], [45, 45], linestyle="--", color="red")
plt.show()