[picoCTF][Cryptography][miniRSA]
Writeup
- eが小さいと、Low Public Exponent Attackが使えるらしい。
ということで、3乗根を求める。
dec.py
from Crypto.Util.number import *
c = 2205316413931134031074603746928247799030155221252519872650073010782049179856976080512716237308882294226369300412719995904064931819531456392957957122459640736424089744772221933500860936331459280832211445548332429338572369823704784625368933
def cube_root(c):
start = 0
end = c
while start <= end:
mid = (start + end) // 2
if mid * mid * mid == c:
return mid
elif mid * mid * mid < c:
start = mid + 1
else:
end = mid - 1
return -1 # 3乗根が整数でない場合
print(long_to_bytes(cube_root(c)).decode())
- 参考サイトに値を入力するだけでも行けた。
- Nは何だったんだろう。
以上です。
参考サイト