RSA 0

RSA_0

Description

i think you know rsa now,you won't need the encryption code

Author : Z3U55

Files

  • output.txt

p = 867223096324845826661643022438920104515437327094904074774686324417603452288721853878472268583970172555209847588975703094795804052571961933774117589187684181391
q = 874045186492693623454466722678739667300702175746485950788337523490400766470118279731285204377247895273405431889058912152329712352404845968686954205719980645103
d = 609578977917092647591940468039350300627226479646249900560231698254956971177640561561034946874809849909598071693809558143693109740213691658398187080003609795936290006565772554201313610216512676953536468493788077239219972752166589663958242070746840934867820414646542611497953040505864523349323866156491879641979450871173
c = 296372098444171370740952166700432460565106373868649967547366810218490825770639806844520286422732378156064148942144395451821115384428992228250685282811550180078458385859713343578267137920964671205912349756802631162388337720920255519048645794400236376808570842995836727399442276913639339872505980283878033605817191885816

Description: Basic RSA decryption challenge where we're given p, q, d, and c.

Solution: We have all the components needed to decrypt:

  • p, q: Prime factors of n

  • d: Private exponent

  • c: Ciphertext

from Crypto.Util.number import long_to_bytes

p = 867223096324845826661643022438920104515437327094904074774686324417603452288721853878472268583970172555209847588975703094795804052571961933774117589187684181391
q = 874045186492693623454466722678739667300702175746485950788337523490400766470118279731285204377247895273405431889058912152329712352404845968686954205719980645103
d = 609578977917092647591940468039350300627226479646249900560231698254956971177640561561034946874809849909598071693809558143693109740213691658398187080003609795936290006565772554201313610216512676953536468493788077239219972752166589663958242070746840934867820414646542611497953040505864523349323866156491879641979450871173
c = 296372098444171370740952166700432460565106373868649967547366810218490825770639806844520286422732378156064148942144395451821115384428992228250685282811550180078458385859713343578267137920964671205912349756802631162388337720920255519048645794400236376808570842995836727399442276913639339872505980283878033605817191885816

n = p * q
m = pow(c, d, n)
flag = long_to_bytes(m)
print(flag.decode()) # Flag: Spark{ju5t_s1mpl3_rsa_3ncrypt10n}

Flag: Spark{ju5t_s1mpl3_rsa_3ncrypt10n}

Last updated

Was this helpful?