Tags: xor 

Rating:

looser

Here's the challenge:

flag.png.crypt

I thought it can be single byte xor and I wrote a clear python2 script:


import binascii
filename = 'flag.png.crypt'
with open(filename, 'rb') as f:
    content = f.read()
XORdata = binascii.hexlify(content)

cipher = (XORdata).decode('hex')

for i in range(0x00,0xff):
    result = ""
    for j in cipher:
        result += chr(i^ord(j))
    if 'PNG' in result:
        solved = open("flag.png","w")
        solved.write(result)
        solved.close()

It worked and here's the flag.png

Original writeup (https://github.com/ozancetin/CTF-Writeups/blob/master/2018/Securinets%20CTF%20Quals%202018/looser/README.md).