1
0
Fork 0
mirror of https://github.com/dirtbags/moth.git synced 2025-01-07 04:20:39 -07:00
moth/doc/2010-10-NMT/posters/scavenger.py
2011-08-29 09:38:45 -06:00

21 lines
458 B
Python
Executable file

#! /usr/bin/python3
import random
import binascii
def mask(buf1, buf2):
return bytes(a^b for (a,b) in zip(buf1, buf2))
ptext = b"xecip-nvkop-zogyr-manef-voxyx"
pads = [b"Good job figuring out the hex",
b"encoding, but there's more to",
b"it! Bring your result to the",
b"contest for points! "]
t = ptext
for p in pads:
print(binascii.hexlify(p).decode())
t = mask(p, t)
print(binascii.hexlify(t).decode())