mirror of https://github.com/dirtbags/moth.git
add poster generator for 2010 NMT event
This commit is contained in:
parent
008ef03d82
commit
051356303d
|
@ -0,0 +1,14 @@
|
||||||
|
#! /usr/bin/python3
|
||||||
|
|
||||||
|
import binascii
|
||||||
|
import sys
|
||||||
|
|
||||||
|
def mask(buf1, buf2):
|
||||||
|
return bytes(a^b for (a,b) in zip(buf1, buf2))
|
||||||
|
|
||||||
|
t = bytes([0]*29)
|
||||||
|
for line in sys.stdin:
|
||||||
|
line = line.strip().encode()
|
||||||
|
a = binascii.unhexlify(line)
|
||||||
|
t = mask(t, a)
|
||||||
|
print(t)
|
|
@ -0,0 +1,21 @@
|
||||||
|
#! /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())
|
Loading…
Reference in New Issue