Created
March 18, 2018 17:29
-
-
Save akrasuski1/394d8b631ca89d073605daab17428996 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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