diff --git a/crypto/pixelated/flag.txt b/crypto/pixelated/flag.txt new file mode 100644 index 0000000..7d346e9 --- /dev/null +++ b/crypto/pixelated/flag.txt @@ -0,0 +1 @@ +picoCTF{8cdf93c3} diff --git a/crypto/pixelated/scrambled1.png b/crypto/pixelated/scrambled1.png new file mode 100644 index 0000000..e8812fa Binary files /dev/null and b/crypto/pixelated/scrambled1.png differ diff --git a/crypto/pixelated/scrambled2.png b/crypto/pixelated/scrambled2.png new file mode 100644 index 0000000..74a279c Binary files /dev/null and b/crypto/pixelated/scrambled2.png differ diff --git a/crypto/pixelated/solve.py b/crypto/pixelated/solve.py new file mode 100755 index 0000000..7a076ef --- /dev/null +++ b/crypto/pixelated/solve.py @@ -0,0 +1,20 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i python3 -p "python3.withPackages (ppkgs: with ppkgs; [ pillow numpy ])" + +from PIL import Image +import numpy as np + +def main(): + with Image.open("scrambled1.png") as im: + img1 = np.asarray(im) + + with Image.open("scrambled2.png") as im: + img2 = np.asarray(im) + + result_array = img1 + img2 + result = Image.fromarray(result_array) + result.save('out.png') + +if __name__ == "__main__": + main() +