Killer Queen CTF 2021
Road Safety Association [140 pts]
That’s what it stands for, right?
kqctf{y0uv3_6r4du473d_fr0m_r54_3l3m3n74ry_5ch00l_ac8770bdcebc}
tl;dr
Introduction
Simple RSA task. We are given:
c: 34709089913401150635163820358938916881993556790698827096314474131695180194656373592831158701400832173951061153349955626770351918715134102729180082310540500929299260384727841272328651482716425284903562937949838801126975821205390573428889205747236795476232421245684253455346750459684786949905537837807616524618
p: 7049378199874518503065880299491083072359644394572493724131509322075604915964637314839516681795279921095822776593514545854149110798068329888153907702700969
q: 11332855855499101423426736341398808093169269495239972781080892932533129603046914334311158344125602053367004567763440106361963142912346338848213535638676857
e: 65537
So we can calculate everything necessary:
\(N = p \cdot q\) \(\phi(N) = (p - 1)\cdot(q - 1)\) \(d = e^{-1} \mod \phi(N)\)
And use this to decrypt the ciphertext:
\[m = c^d \mod N\]The result is
85864906659763422561653568489400511655349240436969157483848855496149510475365879249036092641751572924400235279715867588628107017830691486103186334589
which converted to bytes (e.g. using long_to_bytes
from Crypto.Util.number
in Python) gives the flag: