Created
November 5, 2018 10:32
-
-
Save minhtt159/78c63830bd0e2bf6ba25d70f43738bc5 to your computer and use it in GitHub Desktop.
LSB - SVATTT
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 | |
def main(): | |
img = Image.open("for1.png") | |
pixels = img.load() | |
h = img.size[0] | |
w = img.size[1] | |
out1 = '' | |
for row in range(h): | |
for col in range(w): | |
r,g,b,a = pixels[row,col] | |
if a < 255: | |
lsb = r & 0b00000001 | |
print row, col, lsb | |
out1 += str(lsb) | |
print out1 | |
flag = '' | |
for i in range(0, len(out1), 8): | |
binstr = out1[i:i+8] | |
flag += chr(int(binstr, 2)) | |
print flag | |
pass | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment