Created
February 21, 2012 20:24
-
-
Save poulter7/1878668 to your computer and use it in GitHub Desktop.
2column message crack: >python imagecrack.py http://staffwww.dcs.shef.ac.uk/people/R.Clayton/UoSsecret.png
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
# Run with: | |
# python imagecrack.py http://staffwww.dcs.shef.ac.uk/people/R.Clayton/UoSsecret.png | |
import Image | |
from numpy import asarray | |
from urllib2 import urlopen | |
from cStringIO import StringIO | |
from sys import argv | |
png = asarray(Image.open(StringIO(urlopen(argv[1]).read()))) # open the image from URL as an array | |
print ''.join([chr(png[x,y]) for (x,y) in png[:,0:2]-1]) # for each leading pair in the array find the corresponding character (-1 from its value MATLAB 1 indexing...) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment