古典密碼學的範疇很大,不過現今的CTF題目都是現代密碼學。
llkjmlmpadkkc
金鑰:thisisalilkey
secretmessage
cvpbPGS{guvf_vf_pelcgb!}
picoCTF{this_is_crypto!}
Dr. Xernon made the mistake of rolling his own crypto.. Can you find the bug and decrypt the message?
nc 2018shell2.picoctf.com 59208
from Crypto.Util.number import *
import gmpy2
p = 138873400617639818142290700050114985179
q = 109998464739103330461289147649384134274509
n = 15275860861038824209873749378641369526079415895246568701858306343944764452502111
e = 65537
c = 7030597768026774310122104133160676217061526490101791811961111564793541177307659
phi = (p-1)*(q-1)
d = int(gmpy2.invert(e, phi))
m = pow(c,d,n)
print(long_to_bytes(m))