Лаборатория RuCTF 2013 Quals - Stegano [100]

, 20 марта 2013

Laboratory in the woods
It's a bit strange inscription in the laboratory, isn't it?

A picture with some noise is given.
After search by image I've found original image with the same size (1280x800).
Then I tried to make a difference between these two images.

from PIL import Image

def diff_images():
	file_stego_image = Image.open('picture.jpg')
	file_original_image = Image.open('orig.jpg')

	width, height = file_stego_image.size

	steg_pixels = file_stego_image.load()
	orig_pixels = file_original_image.load()

	diff_image = Image.new('RGB', (width, height))
	diff_pixels = diff_image.load()

	for y in xrange(height):
		for x in xrange(width):			
			steg_color = steg_pixels[x, y]
			orig_color = orig_pixels[x, y]
			diff_color = (abs(steg_color[0] - orig_color[0]), abs(steg_color[1] - orig_color[1]), abs(steg_color[2] - orig_color[2]))
			diff_pixels[x, y] = diff_color


And the result is an image with flag: AnSw3|2

Авторизуйтесь, что бы оставить комментарий