June 26th, 2020
Proclamation on ratification of redpwnCTF.
nc 2020.redpwnc.tf 31752
Like many others, we were able to cheese this challenge. Our method was to calculate by padding the message with zeroes. We can also abuse the fact that the given message is even, as shown:
Multiplying this with , we obtain:
Finally, we divide by 2:
All of the calculations were done modulo n, so we are able to submit this as a signature for the message. These calculations are implemented in the script below; credit to PMP for writing parts of the script.
from pwn import * from Crypto.Util.number import bytes_to_long, long_to_bytes msg = bytes_to_long(b'redpwnCTF is a cybersecurity competition hosted by the redpwn CTF team.') p = remote("2020.redpwnc.tf", 31752) def get_sig(n): print() p.sendlineafter(" Exit\n", "1") p.sendlineafter("Message: ", long_to_bytes(n)) p.recvline() return int(p.recvline()) ans=str((get_sig(msg*2**65536))*get_sig(2)//2) p.sendlineafter(" Exit\n", "2") p.sendlineafter("Message: ", b'redpwnCTF is a cybersecurity competition hosted by the redpwn CTF team.') p.sendlineafter("Signature: ", ans) p.recvline() print(p.recvline())