Categories
Python Security Steganography

Lenna

Découvre le message que la petite coquine Lenna te cache en utilisant ton serpent.

Besoin d’un indice?

import urllib from PIL import Image def decode_image(img): width, height = img.size msg = "" index = 0 for row in range(height): for col in range(width): r, g, b = img.getpixel((col, row)) if row == 0 and col == 0: msg_length = r elif index <= msg_length: msg += chr(r) index += 1 return msg urllib.urlretrieve("http://blog.cedricbonhomme.org/wp-content/uploads/2014/08/Lenna_Simple_Method.png", "Lenna.png") img = Image.open("Lenna.png") print decode_image(img)