Farm

Explore the Farm very carefully!

Files given:


F = list(GF(64))

def keygen(l):
	key = [F[randint(1, 63)] for _ in range(l)] 
	key = math.prod(key) # Optimization the key length :D
	return key

...

# KEEP IT SECRET
key = keygen(14) # I think 64**14 > 2**64 is not brute-forcible :P

enc = encrypt(flag, key)
print(f'enc = {enc}')

The code uses a key that looks like it should have a \(64^{14}\) search space, but since it is operating in \(\mb F_{2^8}\), the key space is actually \(2^8=64\), hence we can write a simple brute force script to enumerate all possible keys and get the flag.

Solution at solve.sage

Flag: CCTF{EnCrYp7I0n_4nD_5u8STitUtIn9_iN_Fi3Ld!}