This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from Crypto.Util.number import * | |
| # global vars | |
| # Y^2= X + 497X + 1768 mod 9739 | |
| a=497 | |
| b=1768 | |
| p=9739 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |