Skip to content

Instantly share code, notes, and snippets.

@nick3499
Last active January 11, 2022 21:28
Show Gist options
  • Save nick3499/54c8030c2170116526d06de3e0c94aec to your computer and use it in GitHub Desktop.
Save nick3499/54c8030c2170116526d06de3e0c94aec to your computer and use it in GitHub Desktop.
Mind your Ps and Qs

picoCTF: Mind your Ps and Qs

PicoCTF's Mind your Ps and Qs challenge includes a hyperlink to a text file:

Decrypt my super sick RSA:
c: 62324783949134119159408816513334912534343517300880137691662780895409992760262021
n: 1280678415822214057864524798453297819181910621573945477544758171055968245116423923
e: 65537  

So I fed C, E and N to dcode.fr's RSA Cipher:

70 69 63 6F 43 54 46 7B 73 6D 61 31 31 5F 4E 5F 6E 30 5F 67 30 6F 64 5F 32 33 35 34 30 33 36 38 7D

I needed to convert all of the hexadecimal values into a single string with spaces removed:

>>> ''.join('70 69 63 6F 43 54 46 7B 73 6D 61 31 31 5F 4E 5F 6E 30 5F 67 30 6F 64 5F 32 33 35 34 30 33 36 38 7D'.split(' '))
'7069636F4354467B736D6131315F4E5F6E305F67306F645F32333534303336387D'

I wrote a Python script that converts hexadecimal numbers to characters:

$ python3 hex2cp1252.py
Enter hex: 7069636F4354467B736D6131315F4E5F6E305F67306F645F32333534303336387D
picoCTF{sma11_N_n0_g0od_23540368}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment