π Download challenge file 1.
π Download challenge file 2.
Description: I have these 2 images, can you make a flag out of them?
Difficulty: Medium
Author: Sara
Summary
In this challenge, weβre given two scrambled PNG images and need to combine them to reveal a hidden flag. This is an example of visual cryptography, where secret information is hidden across multiple images. Each image alone shows only random noise, but when you overlay them together correctly, the hidden message appears!
Think of it like two transparent sheets with random dots - when you stack them on top of each other, the dots align to form letters.
Analysis
We are given 2 scrambled PNG files:
$ file scrambled1.pngscrambled1.png: PNG image data, 256 x 256, 8-bit/color RGB, non-interlaced$ file scrambled2.pngscrambled2.png: PNG image data, 256 x 256, 8-bit/color RGB, non-interlacedBoth are 256Γ256 pixel PNG images in RGB color format and individually, they contain no readable information.

Visual Cryptography Explained
Visual cryptography is a special encryption method where:
- A secret message is split across multiple images
- Each image alone looks like random noise or garbage
- When you overlay (stack) the images together, the secret message becomes visible to the human eye
- No complex math or computer decryption is needed!
Imagine you have a secret message. Instead of encrypting it with math, you break it down into pixel patterns across multiple transparent sheets. When someone places all sheets on top of each other and holds them up to the light, the message appears!
The images
When we look at the two images, they appear to be completely random:
scrambled1.png- looks like random noise/staticscrambled2.png- looks like random noise/static
But when combined correctly, they reveal the hidden message!
Solution
Step 1: Understanding how to combine the images
When combining two noisy images that contain a hidden message:
- The random noise in each image is different and unpredictable
- The hidden message is encoded in BOTH images at the same locations
- When we add the pixel values together, the message pixels become much brighter (because theyβre bright in both images)
- The random noise stays relatively dark (because itβs different in each image)
Think of it this way: if both images have a white pixel in the same spot, adding them together gives an even brighter white. But if only one image has noise at a location, adding them gives a medium gray.
Step 2: Solution
We load both images, convert them into arrays, and add their pixel values together.
Hereβs the Python solution:
from PIL import Imageimport numpy as np
# Load both imagesimg1 = Image.open('scrambled1.png')img2 = Image.open('scrambled2.png')
# Convert to numpy arrays (keeps RGB format)array1 = np.asarray(img1)array2 = np.asarray(img2)
# Add the two images together# Where both have bright pixels (the message), result is very bright# Where they differ (noise), result is medium brightnessresult = np.add(array1, array2)
# Convert back to PIL Imageresult_img = Image.fromarray(result, mode="RGB")
# Display and save the resultresult_img.show()result_img.save('flag.png')Step 3: Read the flag
After running the script, the hidden text appears in the generated flag.png file:
Flag: picoCTF{8cdf93c3}
β‘ Raikiriπ Flag pwned!

π‘ TL;DR / Lesson Learned
- Each image alone is useless, the secret only appears when both are combined
- Pixel addition is enough; no complex math or encryption is needed
- Bright pixels in both images reinforce each other
- Visual cryptography relies on human vision, not cryptographic algorithms
- This challenge is about observation and image processing, not math