cscg24-cry1

CSCG 2024 Challenge 'Intro Crypto 1'
git clone https://git.sinitax.com/sinitax/cscg24-cry1
Log | Files | Refs | sfeed.txt

solve (514B)


      1#!/usr/bin/env python3
      2
      3from pwn import *
      4from sys import argv
      5
      6args = argv[1:]
      7if args == []:
      8    args = ["python3", "main.py"]
      9io = process(args)
     10
     11io.readuntil(b"(hex): ")
     12io.sendline(b"00" * 100)
     13
     14codes = []
     15for i in range(255):
     16    io.readuntil(f"Ciphertext {i:03}: ".encode())
     17    codes.append(bytes.fromhex(io.readline().strip().decode()))
     18
     19io.readuntil(b"Flag: ")
     20flag = bytes.fromhex(io.readline().decode())
     21
     22for k in range(255):
     23    print(bytes([c ^ codes[k][i] for i,c in enumerate(flag)]))
     24    print()
     25