Created
October 22, 2016 18:01
-
-
Save ibaaj/0f8a7b25b543d5474b447a601f6884f3 to your computer and use it in GitHub Desktop.
coppersmith_padding.gp
This file contains 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
default(realprecision,9000); | |
setrand(1); | |
p=nextprime(random(2^15)); | |
q=nextprime(random(2^15)); | |
N=p*q; | |
print("N=p*q="N); | |
P = random(N); \\ le padding | |
print("padding="P) | |
e = 3; \\ expo public | |
print("expo="e) | |
X = floor(N^(1/3)); \\ N^(1/e - epsilon) | |
print("X="X) | |
x0 = random(X); \\ le message inconnu | |
print("X0="x0) | |
C = lift( (Mod(x0,N) + P)^e ); \\ le chiffré | |
print("C="C) | |
print("coppersmith........") | |
print(zncoppersmith((P + x)^3 - C, N, X)) | |
print(" = X0 ") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment