jvdsn / crypto-attacks

Python implementations of cryptographic attacks and utilities.
MIT License
935 stars 121 forks source link

something wrong when I run the code:rsa/wiener_attack_common_rsa_prime.py #11

Closed yzd6k closed 1 year ago

yzd6k commented 1 year ago

IndexError: list index out of range

image

n = 253784908428481171520644795825628119823506176672683456544539675613895749357067944465796492899363087465652749951069021248729871498716450122759675266109104893465718371075137027806815473672093804600537277140261127375373193053173163711234309619016940818893190549811778822641165586070952778825226669497115448984409 e = 31406775715899560162787869974700016947595840438708247549520794775013609818293759112173738791912355029131497095419469938722402909767606953171285102663874040755958087885460234337741136082351825063419747360169129165 c = 97724073843199563126299138557100062208119309614175354104566795999878855851589393774478499956448658027850289531621583268783154684298592331328032682316868391120285515076911892737051842116394165423670275422243894220422196193336551382986699759756232962573336291032572968060586136317901595414796229127047082707519 delta = 0.132 print(delta) p, q, d = attack(n, e, delta) print(long_to_bytes(pow(c, d, n)))

jvdsn commented 1 year ago

This was a bug, but you should try m = 2, which will give you the solution.

yzd6k commented 1 year ago

This was a bug, but you should try m = 2, which will give you the solution.

thanks