Skip to content

Instantly share code, notes, and snippets.

View IAnmar0's full-sized avatar
🌴
On vacation

Anmar Abu Eid IAnmar0

🌴
On vacation
View GitHub Profile
from Crypto.Util.number import *
def main():
m1, m2, m3 = 5, 11 ,17
a1, a2, a3 = 2, 3, 5
M=m1*m2*m3
M1=M//m1
M2=M//m2
M3=M//m3
# Import modular inverse from sympy
from sympy import mod_inverse
# Elliptic curve parameters
a = 497
b = 1768
p = 9739 # prime modulus
# Function to add two points on the elliptic curve
def elliptic_add(P, Q):
from Crypto.Util.number import *
# global vars
# Y^2= X + 497X + 1768 mod 9739
a=497
b=1768
p=9739