Skip to content

Instantly share code, notes, and snippets.

@akrasuski1
Created March 18, 2018 17:29
Show Gist options
  • Save akrasuski1/394d8b631ca89d073605daab17428996 to your computer and use it in GitHub Desktop.
Save akrasuski1/394d8b631ca89d073605daab17428996 to your computer and use it in GitHub Desktop.
from PIL import Image
import sys
datas = []
for name in range(3):
im = Image.open("imgs/img-%d.png" % name)
data = im.getdata()
bits = []
for i in range(26):
for j in range(16):
bits.append(data[64*64*16*i+64*j]/255)
bytes = []
for i in range(26*2):
c = 0
for j in range(8):
c *= 2
c += bits[i*8+j]
bytes.append(c)
datas.append(bytes)
print "".join(chr(c^d) for c, d in zip(datas[0], datas[2]))
print "".join(chr(c^d) for c, d in zip(datas[1], datas[2]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment