#!/usr/bin/python3

key = "fallen"
keysz = len(key)

f = open("ch3.bmp", mode="rb")
data = f.read()
f.close()

out = bytearray()
for i in range(len(data)):
	out.append(data[i] ^ ord(key[(i) % keysz]))

f = open("ch3.out.bmp", mode="wb")
f.write(out)
f.close()
