#!/usr/bin/env python3
import os
import random

with open('flag', 'rb') as data:
    flag = data.read()
    assert(flag.startswith(b'AIS3{'))

def extend(key, L):
    kL = len(key)
    return key * (L // kL) + key[:L % kL]

def xor(X, Y):
    return bytes([x ^ y for x, y in zip(X, Y)])

key = os.urandom(random.randint(8, 12))
plain = flag + key
key = extend(key, len(plain))
cipher = xor(plain, key)

with open('flag-encrypted', 'wb') as data:
    data.write(cipher)

09f175c1a9aa1e31ec613dfc6f1c1bb8c8777504
<mask token>


def extend(key, L):
    kL = len(key)
    return key * (L // kL) + key[:L % kL]


def xor(X, Y):
    return bytes([(x ^ y) for x, y in zip(X, Y)])


<mask token>

<mask token>
with open('flag', 'rb') as data:
    flag = data.read()
    assert flag.startswith(b'AIS3{')


def extend(key, L):
    kL = len(key)
    return key * (L // kL) + key[:L % kL]


def xor(X, Y):
    return bytes([(x ^ y) for x, y in zip(X, Y)])


<mask token>
with open('flag-encrypted', 'wb') as data:
    data.write(cipher)

<mask token>
with open('flag', 'rb') as data:
    flag = data.read()
    assert flag.startswith(b'AIS3{')


def extend(key, L):
    kL = len(key)
    return key * (L // kL) + key[:L % kL]


def xor(X, Y):
    return bytes([(x ^ y) for x, y in zip(X, Y)])


key = os.urandom(random.randint(8, 12))
plain = flag + key
key = extend(key, len(plain))
cipher = xor(plain, key)
with open('flag-encrypted', 'wb') as data:
    data.write(cipher)

import os
import random
with open('flag', 'rb') as data:
    flag = data.read()
    assert flag.startswith(b'AIS3{')


def extend(key, L):
    kL = len(key)
    return key * (L // kL) + key[:L % kL]


def xor(X, Y):
    return bytes([(x ^ y) for x, y in zip(X, Y)])


key = os.urandom(random.randint(8, 12))
plain = flag + key
key = extend(key, len(plain))
cipher = xor(plain, key)
with open('flag-encrypted', 'wb') as data:
    data.write(cipher)

#!/usr/bin/env python3
import os
import random

with open('flag', 'rb') as data:
    flag = data.read()
    assert(flag.startswith(b'AIS3{'))

def extend(key, L):
    kL = len(key)
    return key * (L // kL) + key[:L % kL]

def xor(X, Y):
    return bytes([x ^ y for x, y in zip(X, Y)])

key = os.urandom(random.randint(8, 12))
plain = flag + key
key = extend(key, len(plain))
cipher = xor(plain, key)

with open('flag-encrypted', 'wb') as data:
    data.write(cipher)
