Ratification

redpwnCTF 2020
Cryptography
ac01010
June 26th, 2020
RSA Hard


Proclamation on ratification of redpwnCTF.

Download file: server_msfb11a.py

Ratification (Tux)

27 Solves, 494 Points


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("[3] 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("[3] 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())

Flag: flag{random_flags_are_secure-2504b7e69c65676367aef1d9658821030011f8968a640b504d320846ab5d5029b}