Challenge
Two images that look like noise on their own.
Solution
The hidden content falls out when the two images are XOR’d pixel by pixel. Line them up to the same size, convert to a common mode, and XOR each channel.
1
2
3
4
5
6
7
8
9
10
11
12
| from PIL import Image
img1 = Image.open(image_path1).convert('RGB')
img2 = Image.open(image_path2).resize(img1.size).convert('RGB')
result = Image.new('RGB', img1.size)
p1, p2, pr = img1.load(), img2.load(), result.load()
for y in range(img1.size[1]):
for x in range(img1.size[0]):
r1, g1, b1 = p1[x, y]
r2, g2, b2 = p2[x, y]
pr[x, y] = (r1 ^ r2, g1 ^ g2, b1 ^ b2)
|
The combined image shows the message. No flag string was recorded in our notes.